Class: Rys::Bundler::Commands::Build
- Defined in:
- lib/rys/bundler/commands/build.rb
Direct Known Subclasses
Constant Summary collapse
- COMMENT_PREFIX =
'# RYS_BUILDER #'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Build
constructor
A new instance of Build.
- #run ⇒ Object
- #run_revert ⇒ Object
Methods inherited from Base
#command, #get_redmine_plugin!, #pastel, #prompt, #ui
Constructor Details
#initialize(options) ⇒ Build
Returns a new instance of Build.
66 67 68 |
# File 'lib/rys/bundler/commands/build.rb', line 66 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/rys/bundler/commands/build.rb', line 11 def @options end |
Class Method Details
.run(args) ⇒ Object
13 14 15 16 17 18 19 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 56 57 58 59 60 61 62 63 64 |
# File 'lib/rys/bundler/commands/build.rb', line 13 def self.run(args) = OpenStruct.new .deployment = false .submodules = false .redmine_plugin = nil OptionParser.new do |opts| opts. = 'Usage: bundle rys build [options]' opts.on('-d', '--deployment', 'Prepare gems for deployment') do |value| .deployment = value end # Quite a dangerous switch so do not add a short switch!!! opts.on('--revert', 'Revert build (dangerous operation)') do |value| .revert = value end opts.on('-s', '--submodules', 'Add gems as submodules (experimental)') do |value| .submodules = value abort('Not yet implemented') end opts.on('-r', '--redmine-plugin PATH', 'Redmine plugin for rys gems') do |value| .redmine_plugin = Pathname.new(value) end opts.on_tail('-h', '--help', 'Show this message') do puts opts exit end opts.on_tail('-v', '--version', 'Show version') do puts ::Rys::Bundler::VERSION exit end end.parse(args) if .deployment klass = BuildDeployment else klass = BuildLocal end instance = klass.new() if .revert instance.run_revert else instance.run end end |
Instance Method Details
#run ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/rys/bundler/commands/build.rb', line 70 def run prepare_target prepare_to_copy copy_dependencies comment_copied save_report ui.info '' ui.info 'You may want run bundle install again (just for sure)' end |
#run_revert ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/rys/bundler/commands/build.rb', line 81 def run_revert prepare_target prepare_to_delete delete_dependencies uncomment_deleted delete_report end |