Class: Greyatom::CLI
- Inherits:
-
Thor
- Object
- Thor
- Greyatom::CLI
- Defined in:
- lib/greyatom/cli.rb
Instance Method Summary collapse
- #hello ⇒ Object
- #open(*puzzle_name) ⇒ Object
- #reset ⇒ Object
- #setup(retries: 5) ⇒ Object
- #submit ⇒ Object
- #test ⇒ Object
- #version ⇒ Object
Instance Method Details
#hello ⇒ Object
12 13 14 |
# File 'lib/greyatom/cli.rb', line 12 def hello() puts "Hello World!" end |
#open(*puzzle_name) ⇒ Object
40 41 42 43 44 |
# File 'lib/greyatom/cli.rb', line 40 def open(*puzzle_name) # Fork and Clone User's current lesson lab_name = Greyatom::Puzzle::Parser.new(puzzle_name.join(' ')).parse! Greyatom::Open.new().openALesson(lab_name) end |
#reset ⇒ Object
35 36 37 |
# File 'lib/greyatom/cli.rb', line 35 def reset() Greyatom::User.new().confirmAndReset end |
#setup(retries: 5) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/greyatom/cli.rb', line 17 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
47 48 49 |
# File 'lib/greyatom/cli.rb', line 47 def submit() Greyatom::Submit.new().run end |