Class: Licensed::CLI
- Inherits:
-
Thor
- Object
- Thor
- Licensed::CLI
- Defined in:
- lib/licensed/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
If an error occurs (e.g. a missing command or argument), exit 1.
Instance Method Summary collapse
- #cache ⇒ Object
- #env ⇒ Object
- #list ⇒ Object
- #migrate ⇒ Object
- #notices ⇒ Object
- #status ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
If an error occurs (e.g. a missing command or argument), exit 1.
97 98 99 |
# File 'lib/licensed/cli.rb', line 97 def self.exit_on_failure? true end |
Instance Method Details
#cache ⇒ Object
17 18 19 20 |
# File 'lib/licensed/cli.rb', line 17 def cache run Licensed::Commands::Cache.new(config: config), force: [:force], sources: [:sources], reporter: [:format] end |
#env ⇒ Object
72 73 74 |
# File 'lib/licensed/cli.rb', line 72 def env run Licensed::Commands::Environment.new(config: config), reporter: [:format] end |
#list ⇒ Object
45 46 47 |
# File 'lib/licensed/cli.rb', line 45 def list run Licensed::Commands::List.new(config: config), sources: [:sources], reporter: [:format], licenses: [:licenses] end |
#migrate ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/licensed/cli.rb', line 81 def migrate shell = Thor::Base.shell.new case ["from"] when "v1" Licensed::Migrations::V2.migrate(["config"]) when "v2" shell.say "No configuration or cached file migration needed." shell.say "Please see the documentation at https://github.com/github/licensed/tree/master/docs/migrations/v3.md for details." else shell.say "Unrecognized option from=#{["from"]}", :red CLI.command_help(shell, "migrate") exit 1 end end |
#notices ⇒ Object
56 57 58 |
# File 'lib/licensed/cli.rb', line 56 def notices run Licensed::Commands::Notices.new(config: config), sources: [:sources], computed: [:computed] end |