Class: BundleUpdateInteractive::CLI::Options
- Inherits:
-
Object
- Object
- BundleUpdateInteractive::CLI::Options
- Defined in:
- lib/bundle_update_interactive/cli/options.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
writeonly
Sets the attribute commit.
-
#exclusively ⇒ Object
Returns the value of attribute exclusively.
-
#latest ⇒ Object
writeonly
Sets the attribute latest.
Class Method Summary collapse
-
.help ⇒ Object
rubocop:disable Metrics/AbcSize.
- .parse(argv = ARGV) ⇒ Object
- .summary ⇒ Object
Instance Method Summary collapse
- #commit? ⇒ Boolean
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #latest? ⇒ Boolean
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
98 99 100 101 102 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 98 def initialize @exclusively = [] @commit = false @latest = false end |
Instance Attribute Details
#commit=(value) ⇒ Object (writeonly)
Sets the attribute commit
96 97 98 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 96 def commit=(value) @commit = value end |
#exclusively ⇒ Object
Returns the value of attribute exclusively.
95 96 97 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 95 def exclusively @exclusively end |
#latest=(value) ⇒ Object (writeonly)
Sets the attribute latest
96 97 98 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 96 def latest=(value) @latest = value end |
Class Method Details
.help ⇒ Object
rubocop:disable Metrics/AbcSize
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 20 def help # rubocop:disable Metrics/AbcSize <<~HELP Provides an easy way to update gems to their latest versions. #{pastel.bold.underline('USAGE')} #{pastel.green('bundle update-interactive')} #{pastel.yellow('[options]')} #{pastel.green('bundle ui')} #{pastel.yellow('[options]')} #{pastel.bold.underline('OPTIONS')} #{summary} #{pastel.bold.underline('DESCRIPTION')} Displays the list of gems that would be updated by `bundle update`, allowing you to navigate them by keyboard and pick which ones to update. A changelog URL, when available, is displayed alongside each update. Gems with known security vulnerabilities are also highlighted. Your Gemfile.lock will be updated conservatively based on the gems you select. Transitive dependencies are not affected. More information: #{pastel.blue('https://github.com/mattbrictson/bundle_update_interactive')} #{pastel.bold.underline('EXAMPLES')} Show all gems that can be updated. #{pastel.green('bundle update-interactive')} The "ui" command alias can also be used. #{pastel.green('bundle ui')} Show updates for development and test gems only, leaving production gems untouched. #{pastel.green('bundle update-interactive')} #{pastel.yellow('-D')} Allow the latest gem versions, ignoring Gemfile pins. May modify the Gemfile. #{pastel.green('bundle update-interactive')} #{pastel.yellow('--latest')} HELP end |
.parse(argv = ARGV) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 8 def parse(argv=ARGV) = new remaining = build_parser().parse!(argv.dup) raise Error, "update-interactive does not accept arguments. See --help for available options." if remaining.any? .freeze end |
.summary ⇒ Object
16 17 18 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 16 def summary build_parser(new).summarize.join.gsub(/^\s+-.*? /, pastel.yellow('\0')) end |
Instance Method Details
#commit? ⇒ Boolean
104 105 106 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 104 def commit? @commit end |
#latest? ⇒ Boolean
108 109 110 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 108 def latest? @latest end |