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.
-
#only_explicit ⇒ Object
writeonly
Sets the attribute only_explicit.
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
- #only_explicit? ⇒ Boolean
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
102 103 104 105 106 107 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 102 def initialize @exclusively = [] @commit = false @latest = false @only_explicit = false end |
Instance Attribute Details
#commit=(value) ⇒ Object (writeonly)
Sets the attribute commit
100 101 102 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 100 def commit=(value) @commit = value end |
#exclusively ⇒ Object
Returns the value of attribute exclusively.
99 100 101 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 99 def exclusively @exclusively end |
#latest=(value) ⇒ Object (writeonly)
Sets the attribute latest
100 101 102 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 100 def latest=(value) @latest = value end |
#only_explicit=(value) ⇒ Object (writeonly)
Sets the attribute only_explicit
100 101 102 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 100 def only_explicit=(value) @only_explicit = value end |
Class Method Details
.help ⇒ Object
rubocop:disable Metrics/AbcSize
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 56 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 21 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
9 10 11 12 13 14 15 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 9 def parse(argv=ARGV) = new remain = build_parser().parse!(argv.dup) raise Error, "update-interactive does not accept arguments. See --help for available options." if remain.any? .freeze end |
.summary ⇒ Object
17 18 19 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 17 def summary build_parser(new).summarize.join.gsub(/^\s+-.*? /, pastel.yellow('\0')) end |
Instance Method Details
#commit? ⇒ Boolean
109 110 111 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 109 def commit? @commit end |
#latest? ⇒ Boolean
113 114 115 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 113 def latest? @latest end |
#only_explicit? ⇒ Boolean
117 118 119 |
# File 'lib/bundle_update_interactive/cli/options.rb', line 117 def only_explicit? @only_explicit end |