Class: CommitLive::CLI
- Inherits:
-
Thor
- Object
- Thor
- CommitLive::CLI
- Defined in:
- lib/commit-live/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/commit-live/cli.rb', line 12 def hello() puts "Hello World!" end |
#open(*puzzle_name) ⇒ Object
40 41 42 43 44 |
# File 'lib/commit-live/cli.rb', line 40 def open(*puzzle_name) # Fork and Clone User's current lesson lab_name = CommitLive::Puzzle::Parser.new(puzzle_name.join(' ')).parse! CommitLive::Open.new().openALesson(lab_name) end |
#reset ⇒ Object
35 36 37 |
# File 'lib/commit-live/cli.rb', line 35 def reset() CommitLive::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/commit-live/cli.rb', line 17 def setup(retries: 5) # Check if token already present login, password = CommitLive::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 = CommitLive::User.new() user.validate(password) user.setDefaultWorkspace end |
#submit ⇒ Object
47 48 49 |
# File 'lib/commit-live/cli.rb', line 47 def submit() CommitLive::Submit.new().run end |
#test ⇒ Object
52 53 54 55 |
# File 'lib/commit-live/cli.rb', line 52 def test() puts 'Testing...' CommitLive::Test.new().run end |
#version ⇒ Object
58 59 60 |
# File 'lib/commit-live/cli.rb', line 58 def version puts CommitLive::Cli::VERSION end |