Class: EasyAuto::EasySetup

Inherits:
Object
  • Object
show all
Includes:
ConfigManagerWrapper, SystemHelper
Defined in:
lib/easy_auto/easy_setup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SystemHelper

#check_install, #cli_send, #os

Methods included from ConfigManagerWrapper

#config_manager

Instance Attribute Details

#emailObject

Returns the value of attribute email.



8
9
10
# File 'lib/easy_auto/easy_setup.rb', line 8

def email
  @email
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/easy_auto/easy_setup.rb', line 9

def password
  @password
end

Instance Method Details

#check_authorizationObject



24
25
26
27
28
29
30
31
# File 'lib/easy_auto/easy_setup.rb', line 24

def check_authorization
  Octokit::Client.new(login: config_manager.github_email, access_token: config_manager.github_token).user
rescue Faraday::Error::ConnectionFailed => e
  p e
rescue
  puts "make sure you have octokit installed and have run easy-authorize!"
  system_exit
end

#check_git_extras_installObject



41
42
43
# File 'lib/easy_auto/easy_setup.rb', line 41

def check_git_extras_install
  check_install "git-extras"
end

#check_git_installObject



37
38
39
# File 'lib/easy_auto/easy_setup.rb', line 37

def check_git_install
  check_install "git"
end

#os_checkObject



45
46
47
48
49
50
51
52
# File 'lib/easy_auto/easy_setup.rb', line 45

def os_check
  if os == "Linux" || os == "Darwin"
    puts "You have an acceptable os!"
  else
    puts "Sorry, your OS isn't supported."
    system_exit
  end
end

#runObject



11
12
13
14
15
16
17
18
# File 'lib/easy_auto/easy_setup.rb', line 11

def run
  setup_message
  os_check
  check_git_install
  check_git_extras_install
  check_authorization
  success_message
end

#setup_messageObject



54
55
56
# File 'lib/easy_auto/easy_setup.rb', line 54

def setup_message
  puts "this will check to make sure your computer is set up!"
end

#success_messageObject



33
34
35
# File 'lib/easy_auto/easy_setup.rb', line 33

def success_message
  puts "all set!"
end

#system_exitObject



20
21
22
# File 'lib/easy_auto/easy_setup.rb', line 20

def system_exit
  exit 1
end