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.59.5 lib/origen/commands/helpers.rb
origen-0.59.4 lib/origen/commands/helpers.rb
origen-0.59.3 lib/origen/commands/helpers.rb
origen-0.59.2 lib/origen/commands/helpers.rb
origen-0.59.1 lib/origen/commands/helpers.rb
origen-0.59.0 lib/origen/commands/helpers.rb
origen-0.58.0 lib/origen/commands/helpers.rb
origen-0.57.2 lib/origen/commands/helpers.rb
origen-0.57.1 lib/origen/commands/helpers.rb
origen-0.57.0 lib/origen/commands/helpers.rb
origen-0.56.0 lib/origen/commands/helpers.rb
origen-0.55.5 lib/origen/commands/helpers.rb
origen-0.55.4 lib/origen/commands/helpers.rb
origen-0.55.3 lib/origen/commands/helpers.rb
origen-0.55.2 lib/origen/commands/helpers.rb
origen-0.55.1 lib/origen/commands/helpers.rb
origen-0.55.0 lib/origen/commands/helpers.rb
origen-0.54.6 lib/origen/commands/helpers.rb
origen-0.54.5 lib/origen/commands/helpers.rb
origen-0.54.4 lib/origen/commands/helpers.rb