parameters_extra 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +35 -0
- data/README.markdown +45 -0
- data/Rakefile +21 -0
- data/lib/parameters_extra.rb +52 -0
- data/lib/parameters_extra/args.rb +66 -0
- data/lib/parameters_extra/method_mixins.rb +11 -0
- data/lib/parameters_extra/method_registry.rb +19 -0
- data/lib/parameters_extra/processor.rb +88 -0
- data/lib/parameters_extra/version.rb +3 -0
- data/parameters_extra.gemspec +30 -0
- data/test/fixtures/1.rb +21 -0
- data/test/fixtures/2.rb +18 -0
- data/test/fixtures/3.rb +4 -0
- data/test/fixtures/4.rb +4 -0
- data/test/fixtures/5.rb +17 -0
- data/test/helper.rb +4 -0
- data/test/test_autoload.rb +11 -0
- data/test/test_block.rb +9 -0
- data/test/test_bound_method.rb +22 -0
- data/test/test_nested.rb +12 -0
- data/test/test_simple.rb +33 -0
- data/test/test_subclass.rb +21 -0
- metadata +222 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
parameters_extra (0.2.0)
|
5
|
+
ruby2ruby (~> 1.2.4)
|
6
|
+
ruby_parser (~> 2.0)
|
7
|
+
sexp_processor (~> 3.0.4)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
callsite (0.0.4)
|
13
|
+
minitest (2.0.2)
|
14
|
+
phocus (1.1)
|
15
|
+
rake (0.8.7)
|
16
|
+
ruby2ruby (1.2.5)
|
17
|
+
ruby_parser (~> 2.0)
|
18
|
+
sexp_processor (~> 3.0)
|
19
|
+
ruby_parser (2.0.5)
|
20
|
+
sexp_processor (~> 3.0)
|
21
|
+
sexp_processor (3.0.5)
|
22
|
+
|
23
|
+
PLATFORMS
|
24
|
+
ruby
|
25
|
+
|
26
|
+
DEPENDENCIES
|
27
|
+
bundler (~> 1.0.0)
|
28
|
+
callsite (~> 0.0.4)
|
29
|
+
minitest
|
30
|
+
parameters_extra!
|
31
|
+
phocus
|
32
|
+
rake
|
33
|
+
ruby2ruby (~> 1.2.4)
|
34
|
+
ruby_parser (~> 2.0)
|
35
|
+
sexp_processor (~> 3.0.4)
|
data/README.markdown
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# ParametersExtra
|
2
|
+
|
3
|
+
## Purpose
|
4
|
+
|
5
|
+
You've got a method, but want to know more about the arguments? `#arity` and `#parameters` (if available) are useful,
|
6
|
+
but not nearly enough. You need something better. Like, the default arguments. *ParametersExtra* makes this simple. It operates
|
7
|
+
on a source file to supply the more details argument information by parsing the code itself.
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Pretend you have a file `your_ruby_file.rb`:
|
12
|
+
|
13
|
+
class MyClass
|
14
|
+
def initialize
|
15
|
+
@default_value = 'hello'
|
16
|
+
end
|
17
|
+
|
18
|
+
def something(one, two = 'two', three = @default_value, *more, &block)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
To look at the arguments to something and you're in Ruby 1.9 (please see https://twitter.com/igrigorik/status/19461463110320128), just require it normally:
|
23
|
+
|
24
|
+
require 'your_ruby_file'
|
25
|
+
MyClass.instance_method(:something).args
|
26
|
+
|
27
|
+
Otherwise, do the following:
|
28
|
+
|
29
|
+
ParametersExtra.load('your_ruby_file') # <-- this also requires the file
|
30
|
+
MyClass.instance_method(:something).args
|
31
|
+
|
32
|
+
This will return an `ArgList` object. You can then look at the names & types.
|
33
|
+
|
34
|
+
MyClass.instance_method(:something).args.names
|
35
|
+
# => [:one, :two, :three, :more, :block]
|
36
|
+
|
37
|
+
MyClass.instance_method(:something).args.types
|
38
|
+
# => [:required, :optional, :optional, :splat, :block]
|
39
|
+
|
40
|
+
If you want to get the value of a default argument, you'll need a context in which to evaluate it, namely,
|
41
|
+
an instance of the class from which the method derives.
|
42
|
+
|
43
|
+
obj = MyClass.new
|
44
|
+
obj.method(:something).args.last.default_value
|
45
|
+
# => 'hello'
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
|
4
|
+
desc "Run tests"
|
5
|
+
task :test do
|
6
|
+
$: << '.'
|
7
|
+
$: << 'lib'
|
8
|
+
require 'parameters_extra'
|
9
|
+
require 'test/helper'
|
10
|
+
Dir['test/**/test_*.rb'].each { |test| require test }
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'rake/rdoctask'
|
14
|
+
desc "Generate documentation"
|
15
|
+
Rake::RDocTask.new do |rd|
|
16
|
+
rd.main = "README.rdoc"
|
17
|
+
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
18
|
+
rd.rdoc_dir = 'rdoc'
|
19
|
+
end
|
20
|
+
|
21
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'ruby2ruby'
|
3
|
+
require 'ruby_parser'
|
4
|
+
require 'sexp_processor'
|
5
|
+
|
6
|
+
require 'parameters_extra/method_mixins'
|
7
|
+
require 'parameters_extra/args'
|
8
|
+
require 'parameters_extra/processor'
|
9
|
+
require 'parameters_extra/version'
|
10
|
+
require 'parameters_extra/method_registry'
|
11
|
+
|
12
|
+
module ParametersExtra
|
13
|
+
ClassMethodRegistry = Hash.new{|h, k| h[k] = MethodRegistry.new}
|
14
|
+
FileRegistry = Set.new
|
15
|
+
|
16
|
+
def self.load(file, require_file = true)
|
17
|
+
require file if require_file
|
18
|
+
register file
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.parameters_for_method(method)
|
22
|
+
k = class_key(method.owner)
|
23
|
+
ClassMethodRegistry[k][method.name.to_sym] if ClassMethodRegistry.key?(k)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.register(file)
|
27
|
+
file = expand_path(file)
|
28
|
+
unless FileRegistry.include?(file)
|
29
|
+
FileRegistry << file
|
30
|
+
parse(file).each { |cls, methods| ClassMethodRegistry[cls].add_methods!(methods) }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.parse(file, require_file = true)
|
35
|
+
parser = RubyParser.new
|
36
|
+
sexp = parser.process(File.read(expand_path(file)))
|
37
|
+
parameters_extra = Processor.new
|
38
|
+
parameters_extra.process(sexp)
|
39
|
+
parameters_extra.methods
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.class_key(cls)
|
43
|
+
nesting = cls.class_eval("Module.nesting")
|
44
|
+
nesting.pop
|
45
|
+
nesting.join('::')
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.expand_path(file)
|
49
|
+
file = File.expand_path(file)
|
50
|
+
File.exist?(file) ? file : "#{file}.rb"
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module ParametersExtra
|
2
|
+
class Args < Array
|
3
|
+
class Arg
|
4
|
+
|
5
|
+
attr_accessor :arg_list
|
6
|
+
attr_reader :name, :type
|
7
|
+
|
8
|
+
def initialize(name, type, default = nil)
|
9
|
+
@name, @type, @default = name, type, default
|
10
|
+
end
|
11
|
+
|
12
|
+
def required?
|
13
|
+
@type == :required
|
14
|
+
end
|
15
|
+
|
16
|
+
def optional?
|
17
|
+
@type == :optional
|
18
|
+
end
|
19
|
+
|
20
|
+
def splat?
|
21
|
+
@type == :splat
|
22
|
+
end
|
23
|
+
|
24
|
+
def default?
|
25
|
+
!@default.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def default_value(*args)
|
29
|
+
return nil if @default.nil?
|
30
|
+
receiver ||= arg_list.owning_method.receiver
|
31
|
+
raise "You must specify a receiver for the defaul value" if receiver.nil?
|
32
|
+
raise "You must evaluate defaults in the context of a matching class. #{receiver.class.name} is not a #{arg_list.cls.name}." unless receiver.is_a?(arg_list.cls)
|
33
|
+
receiver.instance_eval(@default)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
attr_accessor :owning_method
|
38
|
+
|
39
|
+
def initialize(cls)
|
40
|
+
@cls = cls
|
41
|
+
end
|
42
|
+
|
43
|
+
def cls
|
44
|
+
@cls.inject(Module) {|c, m| c.const_get(m)}
|
45
|
+
end
|
46
|
+
|
47
|
+
def clone
|
48
|
+
o = super
|
49
|
+
o.each {|arg| arg.arg_list = o}
|
50
|
+
o
|
51
|
+
end
|
52
|
+
|
53
|
+
def required_size
|
54
|
+
inject(0) {|count, arg| count += arg.required? ? 1 : 0}
|
55
|
+
end
|
56
|
+
alias_method :required_count, :required_size
|
57
|
+
|
58
|
+
def names
|
59
|
+
map(&:name)
|
60
|
+
end
|
61
|
+
|
62
|
+
def types
|
63
|
+
map(&:type)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module MethodMixin
|
2
|
+
def parameters_extra
|
3
|
+
ParametersExtra.register(source_location[0]) if respond_to?(:source_location)
|
4
|
+
args = ParametersExtra.parameters_for_method(self).clone
|
5
|
+
args.owning_method = self
|
6
|
+
args
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
Method.send(:include, MethodMixin)
|
11
|
+
UnboundMethod.send(:include, MethodMixin)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ParametersExtra
|
2
|
+
class MethodRegistry < Hash
|
3
|
+
attr_reader :method_names
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
super
|
7
|
+
@method_names = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_methods!(methods)
|
11
|
+
methods.each do |(method_name, args)|
|
12
|
+
unless key?(method_name)
|
13
|
+
self[method_name] = args
|
14
|
+
method_names << method_name
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module ParametersExtra
|
2
|
+
class Processor < SexpProcessor
|
3
|
+
|
4
|
+
attr_reader :methods
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@methods = Hash.new{|h,k| h[k] = []}
|
8
|
+
@current_class = []
|
9
|
+
super()
|
10
|
+
end
|
11
|
+
|
12
|
+
def process_module(exp)
|
13
|
+
exp.shift
|
14
|
+
@current_class << exp.first.to_sym
|
15
|
+
process(exp)
|
16
|
+
@current_class.pop
|
17
|
+
exp.clear
|
18
|
+
exp
|
19
|
+
end
|
20
|
+
|
21
|
+
def process_class(exp)
|
22
|
+
exp.shift
|
23
|
+
current_class_size = @current_class.size
|
24
|
+
case exp.first
|
25
|
+
when Symbol
|
26
|
+
@current_class << exp.first.to_sym
|
27
|
+
process(exp)
|
28
|
+
else
|
29
|
+
if exp.first.first == :colon2
|
30
|
+
exp.first.shift
|
31
|
+
class_exp = exp.shift
|
32
|
+
class_exp[0, class_exp.size - 1].each do |const|
|
33
|
+
@current_class << const.last
|
34
|
+
end
|
35
|
+
@current_class << class_exp.last
|
36
|
+
else
|
37
|
+
raise
|
38
|
+
end
|
39
|
+
exp.shift
|
40
|
+
process(exp.first)
|
41
|
+
end
|
42
|
+
@current_class.slice!(current_class_size, @current_class.size)
|
43
|
+
exp.clear
|
44
|
+
exp
|
45
|
+
end
|
46
|
+
|
47
|
+
def process_defn(exp)
|
48
|
+
exp.shift
|
49
|
+
@current_method = exp.shift
|
50
|
+
@ruby2ruby = Ruby2Ruby.new
|
51
|
+
process_args(exp.shift)
|
52
|
+
exp.shift
|
53
|
+
exp
|
54
|
+
end
|
55
|
+
|
56
|
+
def process_args(exp)
|
57
|
+
exp.shift
|
58
|
+
arg_list = Args.new(@current_class.clone)
|
59
|
+
while !exp.empty?
|
60
|
+
t = exp.shift
|
61
|
+
case t
|
62
|
+
when Symbol
|
63
|
+
arg_list << case t.to_s[0]
|
64
|
+
when ?* then Args::Arg.new(t.to_s[1, t.to_s.size].to_sym, :splat)
|
65
|
+
when ?& then Args::Arg.new(t.to_s[1, t.to_s.size].to_sym, :block)
|
66
|
+
else Args::Arg.new(t, :required)
|
67
|
+
end
|
68
|
+
when Sexp
|
69
|
+
case t.shift
|
70
|
+
when :block
|
71
|
+
while lasgn = t.shift
|
72
|
+
lasgn.shift
|
73
|
+
name = lasgn.shift
|
74
|
+
new_arg = Args::Arg.new(name, :optional, @ruby2ruby.process(lasgn.last))
|
75
|
+
arg_list.each_with_index{|arg, idx| arg_list[idx] = new_arg if arg.name == name}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
@methods[current_classname] << [@current_method, arg_list]
|
81
|
+
exp
|
82
|
+
end
|
83
|
+
|
84
|
+
def current_classname
|
85
|
+
@current_class.map{|c| c.to_s}.join('::')
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "parameters_extra/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "parameters_extra"
|
7
|
+
s.version = ParametersExtra::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Joshua Hull"]
|
10
|
+
s.email = ["joshbuddy@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/joshbuddy/parameters_extra"
|
12
|
+
s.summary = "Get back more detailed information about the parameters for a method"
|
13
|
+
s.description = "Get back more detailed information about the parameters for a method."
|
14
|
+
|
15
|
+
s.rubyforge_project = "parameters_extra"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_dependency "ruby_parser", "~> 2.0"
|
23
|
+
s.add_dependency "ruby2ruby", "~> 1.2.4"
|
24
|
+
s.add_dependency "sexp_processor", "~> 3.0.4"
|
25
|
+
s.add_development_dependency "callsite", "~> 0.0.4"
|
26
|
+
s.add_development_dependency "bundler", "~> 1.0.0"
|
27
|
+
s.add_development_dependency "rake"
|
28
|
+
s.add_development_dependency "phocus"
|
29
|
+
s.add_development_dependency "minitest"
|
30
|
+
end
|
data/test/fixtures/1.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
class One
|
2
|
+
attr_accessor :two_method
|
3
|
+
|
4
|
+
def no_args
|
5
|
+
end
|
6
|
+
|
7
|
+
def one_args(one)
|
8
|
+
end
|
9
|
+
|
10
|
+
def two_args(one, two)
|
11
|
+
end
|
12
|
+
|
13
|
+
def splat_args(one, two, *three)
|
14
|
+
end
|
15
|
+
|
16
|
+
def default_args(one, two = 'two')
|
17
|
+
end
|
18
|
+
|
19
|
+
def default_args_with_dependant_value(one, two = two_method)
|
20
|
+
end
|
21
|
+
end
|
data/test/fixtures/2.rb
ADDED
data/test/fixtures/3.rb
ADDED
data/test/fixtures/4.rb
ADDED
data/test/fixtures/5.rb
ADDED
data/test/helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
if Method.instance_method(:source_location)
|
2
|
+
class TestAutoload < MiniTest::Unit::TestCase
|
3
|
+
def setup
|
4
|
+
require ~'fixtures/4'
|
5
|
+
end
|
6
|
+
|
7
|
+
def test_arg_counts
|
8
|
+
assert_equal 0, Autoloaded.instance_method(:some_method).parameters_extra.count
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end rescue nil
|
data/test/test_block.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class TestBoundMethod < MiniTest::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
ParametersExtra.load(~'fixtures/1')
|
4
|
+
end
|
5
|
+
|
6
|
+
def test_default_args
|
7
|
+
one = One.new
|
8
|
+
one.two_method = 'happy times'
|
9
|
+
two = One.new
|
10
|
+
two.two_method = 'more happy times'
|
11
|
+
assert_equal 'happy times', one.method(:default_args_with_dependant_value).parameters_extra.last.default_value
|
12
|
+
assert_equal 'more happy times', two.method(:default_args_with_dependant_value).parameters_extra.last.default_value
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_binding_method
|
16
|
+
method = One.instance_method(:default_args_with_dependant_value)
|
17
|
+
one = One.new
|
18
|
+
one.two_method = 'happy times'
|
19
|
+
assert_equal 'happy times', method.bind(one).parameters_extra.last.default_value
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/test/test_nested.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class TestNested < MiniTest::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
ParametersExtra.load(~'fixtures/5')
|
4
|
+
end
|
5
|
+
|
6
|
+
def test_nested
|
7
|
+
assert_equal 0, Top.instance_method(:one).parameters_extra.count
|
8
|
+
assert_equal 1, Top::Middle.instance_method(:one).parameters_extra.count
|
9
|
+
assert_equal 0, Top::Middle.instance_method(:two).parameters_extra.count
|
10
|
+
assert_equal 1, Top::Middle::End.instance_method(:two).parameters_extra.count
|
11
|
+
end
|
12
|
+
end
|
data/test/test_simple.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
class TestSimple < MiniTest::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
ParametersExtra.load(~'fixtures/1')
|
4
|
+
end
|
5
|
+
|
6
|
+
def test_arg_counts
|
7
|
+
assert_equal 0, One.instance_method(:no_args).parameters_extra.count
|
8
|
+
assert_equal 1, One.instance_method(:one_args).parameters_extra.count
|
9
|
+
assert_equal 2, One.instance_method(:two_args).parameters_extra.count
|
10
|
+
assert_equal 3, One.instance_method(:splat_args).parameters_extra.count
|
11
|
+
assert_equal 2, One.instance_method(:splat_args).parameters_extra.required_count
|
12
|
+
assert_equal 2, One.instance_method(:default_args).parameters_extra.count
|
13
|
+
assert_equal 1, One.instance_method(:default_args).parameters_extra.required_count
|
14
|
+
assert_equal 2, One.instance_method(:default_args_with_dependant_value).parameters_extra.count
|
15
|
+
assert_equal 1, One.instance_method(:default_args_with_dependant_value).parameters_extra.required_count
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_arg_types
|
19
|
+
assert_equal [], One.instance_method(:no_args).parameters_extra.types
|
20
|
+
assert_equal [:required], One.instance_method(:one_args).parameters_extra.types
|
21
|
+
assert_equal [:required, :required], One.instance_method(:two_args).parameters_extra.types
|
22
|
+
assert_equal [:required, :required, :splat], One.instance_method(:splat_args).parameters_extra.types
|
23
|
+
assert_equal [:required, :optional], One.instance_method(:default_args).parameters_extra.types
|
24
|
+
assert_equal [:required, :optional], One.instance_method(:default_args_with_dependant_value).parameters_extra.types
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_default_args
|
28
|
+
one = One.new
|
29
|
+
one.two_method = 'happy times'
|
30
|
+
assert_equal 'happy times', One.instance_method(:default_args_with_dependant_value).bind(one).parameters_extra.last.default_value
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class TestSubclass < MiniTest::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
ParametersExtra.load(~'fixtures/2')
|
4
|
+
end
|
5
|
+
|
6
|
+
def test_normal_visibility
|
7
|
+
assert_equal [:one, :more], TwoSubclass.instance_method(:two).parameters_extra.names
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_subclass_overridding
|
11
|
+
assert_equal [:hi, :there, :more], TwoSubclass.instance_method(:one).parameters_extra.names
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_superclass_visibility
|
15
|
+
assert_equal [:hi, :there], Two.instance_method(:one).parameters_extra.names
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_module_visibility
|
19
|
+
assert_equal [:from, :mod], TwoSubclass.instance_method(:mod).parameters_extra.names
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: parameters_extra
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Joshua Hull
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-01-24 00:00:00 -08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: ruby_parser
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
version: "2.0"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: ruby2ruby
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 23
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 2
|
48
|
+
- 4
|
49
|
+
version: 1.2.4
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: sexp_processor
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 15
|
61
|
+
segments:
|
62
|
+
- 3
|
63
|
+
- 0
|
64
|
+
- 4
|
65
|
+
version: 3.0.4
|
66
|
+
type: :runtime
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: callsite
|
70
|
+
prerelease: false
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 23
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
- 0
|
80
|
+
- 4
|
81
|
+
version: 0.0.4
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: bundler
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 23
|
93
|
+
segments:
|
94
|
+
- 1
|
95
|
+
- 0
|
96
|
+
- 0
|
97
|
+
version: 1.0.0
|
98
|
+
type: :development
|
99
|
+
version_requirements: *id005
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rake
|
102
|
+
prerelease: false
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
type: :development
|
113
|
+
version_requirements: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: phocus
|
116
|
+
prerelease: false
|
117
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 3
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
type: :development
|
127
|
+
version_requirements: *id007
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: minitest
|
130
|
+
prerelease: false
|
131
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
hash: 3
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
version: "0"
|
140
|
+
type: :development
|
141
|
+
version_requirements: *id008
|
142
|
+
description: Get back more detailed information about the parameters for a method.
|
143
|
+
email:
|
144
|
+
- joshbuddy@gmail.com
|
145
|
+
executables: []
|
146
|
+
|
147
|
+
extensions: []
|
148
|
+
|
149
|
+
extra_rdoc_files: []
|
150
|
+
|
151
|
+
files:
|
152
|
+
- .gitignore
|
153
|
+
- Gemfile
|
154
|
+
- Gemfile.lock
|
155
|
+
- README.markdown
|
156
|
+
- Rakefile
|
157
|
+
- lib/parameters_extra.rb
|
158
|
+
- lib/parameters_extra/args.rb
|
159
|
+
- lib/parameters_extra/method_mixins.rb
|
160
|
+
- lib/parameters_extra/method_registry.rb
|
161
|
+
- lib/parameters_extra/processor.rb
|
162
|
+
- lib/parameters_extra/version.rb
|
163
|
+
- parameters_extra.gemspec
|
164
|
+
- test/fixtures/1.rb
|
165
|
+
- test/fixtures/2.rb
|
166
|
+
- test/fixtures/3.rb
|
167
|
+
- test/fixtures/4.rb
|
168
|
+
- test/fixtures/5.rb
|
169
|
+
- test/helper.rb
|
170
|
+
- test/test_autoload.rb
|
171
|
+
- test/test_block.rb
|
172
|
+
- test/test_bound_method.rb
|
173
|
+
- test/test_nested.rb
|
174
|
+
- test/test_simple.rb
|
175
|
+
- test/test_subclass.rb
|
176
|
+
has_rdoc: true
|
177
|
+
homepage: https://github.com/joshbuddy/parameters_extra
|
178
|
+
licenses: []
|
179
|
+
|
180
|
+
post_install_message:
|
181
|
+
rdoc_options: []
|
182
|
+
|
183
|
+
require_paths:
|
184
|
+
- lib
|
185
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
hash: 3
|
191
|
+
segments:
|
192
|
+
- 0
|
193
|
+
version: "0"
|
194
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
|
+
none: false
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
hash: 3
|
200
|
+
segments:
|
201
|
+
- 0
|
202
|
+
version: "0"
|
203
|
+
requirements: []
|
204
|
+
|
205
|
+
rubyforge_project: parameters_extra
|
206
|
+
rubygems_version: 1.3.7
|
207
|
+
signing_key:
|
208
|
+
specification_version: 3
|
209
|
+
summary: Get back more detailed information about the parameters for a method
|
210
|
+
test_files:
|
211
|
+
- test/fixtures/1.rb
|
212
|
+
- test/fixtures/2.rb
|
213
|
+
- test/fixtures/3.rb
|
214
|
+
- test/fixtures/4.rb
|
215
|
+
- test/fixtures/5.rb
|
216
|
+
- test/helper.rb
|
217
|
+
- test/test_autoload.rb
|
218
|
+
- test/test_block.rb
|
219
|
+
- test/test_bound_method.rb
|
220
|
+
- test/test_nested.rb
|
221
|
+
- test/test_simple.rb
|
222
|
+
- test/test_subclass.rb
|