Class: EasyAuto::EasySetup
Instance Attribute Summary collapse
Instance Method Summary
collapse
#check_install, #cli_send, #os
#config_manager
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
8
9
10
|
# File 'lib/easy_auto/easy_setup.rb', line 8
def email
@email
end
|
#password ⇒ Object
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_authorization ⇒ Object
24
25
26
27
28
29
30
31
32
|
# 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
p "It appears you had an SSL error. Read http://mislav.uniqpath.com/2013/07/ruby-openssl/ to fix it."
rescue
puts "make sure you have octokit installed and have run easy-authorize!"
system_exit
end
|
42
43
44
|
# File 'lib/easy_auto/easy_setup.rb', line 42
def
check_install "git-extras"
end
|
#check_git_install ⇒ Object
38
39
40
|
# File 'lib/easy_auto/easy_setup.rb', line 38
def check_git_install
check_install "git"
end
|
#os_check ⇒ Object
46
47
48
49
50
51
52
53
|
# File 'lib/easy_auto/easy_setup.rb', line 46
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
|
#run ⇒ Object
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_authorization
success_message
end
|
#setup_message ⇒ Object
55
56
57
|
# File 'lib/easy_auto/easy_setup.rb', line 55
def setup_message
puts "this will check to make sure your computer is set up!"
end
|
#success_message ⇒ Object
34
35
36
|
# File 'lib/easy_auto/easy_setup.rb', line 34
def success_message
puts "all set!"
end
|
#system_exit ⇒ Object
20
21
22
|
# File 'lib/easy_auto/easy_setup.rb', line 20
def system_exit
exit 1
end
|