Sha256: 799cd2cefbd89cd71d54d1f86b0f385e8995e7605ed174550469b0077352523e

Contents?: true

Size: 478 Bytes

Versions: 93

Compression:

Stored size: 478 Bytes

Contents

module Origen
  module CommandHelpers
    def self.extend_options(opts, app_opts, options)
      app_opts.each do |app_option|
        if app_option.last.is_a?(Proc)
          ao_proc = app_option.pop
          if ao_proc.arity == 1
            opts.on(*app_option) { ao_proc.call(options) }
          else
            opts.on(*app_option) { |arg| ao_proc.call(options, arg) }
          end
        else
          opts.on(*app_option) {}
        end
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
origen-0.60.17 lib/origen/commands/helpers.rb
origen-0.60.16 lib/origen/commands/helpers.rb
origen-0.60.14 lib/origen/commands/helpers.rb
origen-0.60.13 lib/origen/commands/helpers.rb
origen-0.60.12 lib/origen/commands/helpers.rb
origen-0.60.11 lib/origen/commands/helpers.rb
origen-0.60.10 lib/origen/commands/helpers.rb
origen-0.60.9 lib/origen/commands/helpers.rb
origen-0.60.8 lib/origen/commands/helpers.rb
origen-0.60.7 lib/origen/commands/helpers.rb
origen-0.60.6 lib/origen/commands/helpers.rb
origen-0.60.5 lib/origen/commands/helpers.rb
origen-0.60.4 lib/origen/commands/helpers.rb
origen-0.60.3 lib/origen/commands/helpers.rb
origen-0.60.2 lib/origen/commands/helpers.rb
origen-0.60.1 lib/origen/commands/helpers.rb
origen-0.60.0 lib/origen/commands/helpers.rb
origen-0.59.8 lib/origen/commands/helpers.rb
origen-0.59.7 lib/origen/commands/helpers.rb
origen-0.59.6 lib/origen/commands/helpers.rb