Class: Willpower::CLI
- Inherits:
-
Thor
- Object
- Thor
- Willpower::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/willpower.rb,
lib/willpower/commands/dod.rb,
lib/willpower/commands/dor.rb,
lib/willpower/commands/help.rb,
lib/willpower/commands/init.rb,
lib/willpower/commands/hello.rb,
lib/willpower/commands/login.rb,
lib/willpower/commands/users.rb,
lib/willpower/commands/events.rb,
lib/willpower/commands/values.rb,
lib/willpower/commands/remotes.rb,
lib/willpower/commands/tickets.rb,
lib/willpower/commands/version.rb,
lib/willpower/commands/projects.rb,
lib/willpower/commands/manifesto.rb,
lib/willpower/commands/principles.rb
Class Method Summary collapse
Instance Method Summary collapse
- #DoD ⇒ Object
- #DoR ⇒ Object
- #hello ⇒ Object
- #init(remote) ⇒ Object
- #login ⇒ Object
- #manifesto ⇒ Object
- #principles ⇒ Object
- #values ⇒ Object
- #version ⇒ Object
Class Method Details
.help(shell, subcommand = false) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/willpower/commands/help.rb', line 6 def help(shell, subcommand = false) list = printable_commands(true, subcommand) Thor::Util.thor_classes_in(self).each do |klass| list += klass.printable_commands(false) end list.sort! { |a, b| a[0] <=> b[0] } list.reject! { |l| l[0].split[1] == 'help' } if defined?(@package_name) && @package_name shell.say "#{@package_name} commands:" else shell.say Rainbow('Commands:').whitesmoke end shell.print_table(list, indent: 2, truncate: true) shell.say (shell) shell.say Rainbow('All commands can be run with -h (or --help) for more information.').whitesmoke end |
Instance Method Details
#DoD ⇒ Object
6 7 8 9 10 |
# File 'lib/willpower/commands/dod.rb', line 6 def DoD dod = [] dod << File.read("#{GEM_PATH}/willpower/assets/definition_of_done.txt") say Terminal::Table.new title: "Definition of Done", rows: [dod], style: TERMINAL_STYLE end |
#DoR ⇒ Object
6 7 8 9 10 |
# File 'lib/willpower/commands/dor.rb', line 6 def DoR dor = [] dor << File.read("#{GEM_PATH}/willpower/assets/definition_of_ready.txt") say Terminal::Table.new title: "Definition of Ready", rows: [dor], style: TERMINAL_STYLE end |
#hello ⇒ Object
4 5 6 |
# File 'lib/willpower/commands/hello.rb', line 4 def hello say "Hello world!" end |
#init(remote) ⇒ Object
7 8 9 10 11 |
# File 'lib/willpower/commands/init.rb', line 7 def init(remote) error_checking_init write_remote_to_config(remote) say "Successfully added new remote!" end |
#login ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/willpower/commands/login.rb', line 6 def login error_checking_login open_link @secret_node = call_cli @response = RestClient.get "#{CONFIG['current_remote']}/api/v1/users/#{@secret_node}" if JSON.parse(@response)["data"]["attributes"] parse_login else say "Something went wrong" end end |
#manifesto ⇒ Object
4 5 6 7 8 |
# File 'lib/willpower/commands/manifesto.rb', line 4 def manifesto manifest = [] manifest << File.read("#{GEM_PATH}/willpower/assets/manifesto.txt") say Terminal::Table.new title: "Manifesto", rows: [manifest], style: TERMINAL_STYLE end |
#principles ⇒ Object
4 5 6 7 8 |
# File 'lib/willpower/commands/principles.rb', line 4 def principles principl = [] principl << File.read("#{GEM_PATH}/willpower/assets/agile_principles.txt") say Terminal::Table.new title: "Agile principles", rows: [principl], style: TERMINAL_STYLE end |
#values ⇒ Object
4 5 6 7 8 |
# File 'lib/willpower/commands/values.rb', line 4 def values values = [] values << File.read("#{GEM_PATH}/willpower/assets/agile_values.txt") say Terminal::Table.new title: "Values", rows: [values], style: TERMINAL_STYLE end |