Class: Greyatom::CLI
- Inherits:
-
Thor
- Object
- Thor
- Greyatom::CLI
- Defined in:
- lib/greyatom/cli.rb
Instance Method Summary collapse
- #hello ⇒ Object
- #open ⇒ Object
- #reset ⇒ Object
- #setup(retries: 5) ⇒ Object
- #submit ⇒ Object
- #test ⇒ Object
- #version ⇒ Object
Instance Method Details
#hello ⇒ Object
11 12 13 |
# File 'lib/greyatom/cli.rb', line 11 def hello() puts "Hello World!" end |
#open ⇒ Object
39 40 41 42 |
# File 'lib/greyatom/cli.rb', line 39 def open() # Fork and Clone User's current lesson Greyatom::Open.new().openALesson end |
#reset ⇒ Object
34 35 36 |
# File 'lib/greyatom/cli.rb', line 34 def reset() Greyatom::User.new().confirmAndReset end |
#setup(retries: 5) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/greyatom/cli.rb', line 16 def setup(retries: 5) # Check if token already present login, password = Greyatom::NetrcInteractor.new().read if login.nil? || password.nil? print 'Enter your github token here and press [ENTER]: ' password = STDIN.gets.chomp if password.empty? puts "No token provided." exit end end # Check if token is valid user = Greyatom::User.new() user.validate(password) user.setDefaultWorkspace end |
#submit ⇒ Object
45 46 47 |
# File 'lib/greyatom/cli.rb', line 45 def submit() Greyatom::Submit.new().run end |
#test ⇒ Object
50 51 52 53 |
# File 'lib/greyatom/cli.rb', line 50 def test() puts 'Testing...' Greyatom::Test.new().run end |
#version ⇒ Object
56 57 58 |
# File 'lib/greyatom/cli.rb', line 56 def version puts Greyatom::Cli::VERSION end |