keyword_arguments 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/keyword_arguments.gemspec +2 -2
- data/lib/keyword_arguments.rb +18 -6
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ Echoe.new('keyword_arguments') do |p|
|
|
7
7
|
p.summary = %q{named_arguments comes with a bunch of convenient methods for making "named arguments" (hashes as method arguments) in Ruby less painfull}
|
8
8
|
|
9
9
|
p.url = "http://keywordargs.rubyforge.org/"
|
10
|
-
p.docs_host = "
|
10
|
+
p.docs_host = "rubyforge.org:/var/www/gforge-projects/"
|
11
11
|
|
12
12
|
p.ruby_version = '>= 1.9.0'
|
13
13
|
|
data/keyword_arguments.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{keyword_arguments}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Dominik Honnef"]
|
9
9
|
s.cert_chain = ["/home/dominikh/.rubyforge/gem-public_cert.pem"]
|
10
|
-
s.date = %q{2009-07-
|
10
|
+
s.date = %q{2009-07-28}
|
11
11
|
s.description = %q{named_arguments comes with a bunch of convenient methods for making "named arguments" (hashes as method arguments) in Ruby less painfull}
|
12
12
|
s.email = %q{dominikho@gmx.net}
|
13
13
|
s.extra_rdoc_files = ["README.markdown", "CHANGELOG", "LICENSE", "lib/keyword_arguments.rb"]
|
data/lib/keyword_arguments.rb
CHANGED
@@ -22,6 +22,7 @@ class Module
|
|
22
22
|
private
|
23
23
|
def define_our_temporary_method_added
|
24
24
|
# only define our hooks once, even if we add requirements as well as defaults/allowed arguments
|
25
|
+
@defined_temporary_method_added ||= false
|
25
26
|
return if @defined_temporary_method_added
|
26
27
|
@defined_temporary_method_added = true
|
27
28
|
|
@@ -70,12 +71,23 @@ class Module
|
|
70
71
|
raise ArgumentError, "Missing arguments: #{missing.join(', ')}", caller
|
71
72
|
end
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
begin
|
75
|
+
# call the real method
|
76
|
+
case hook
|
77
|
+
when :method_added
|
78
|
+
our_method.bind(self).call(args)
|
79
|
+
when :singleton_method_added
|
80
|
+
our_method.call(args)
|
81
|
+
end
|
82
|
+
rescue => e
|
83
|
+
# hiding ourself from the backtrace
|
84
|
+
bt = e.backtrace
|
85
|
+
r = /^#{Regexp.escape(__FILE__)}:\d+:in/
|
86
|
+
bt.delete_if do |line|
|
87
|
+
line =~ r
|
88
|
+
end
|
89
|
+
e.set_backtrace bt
|
90
|
+
raise e
|
79
91
|
end
|
80
92
|
end
|
81
93
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keyword_arguments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Honnef
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
YEfDWg==
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2009-07-
|
33
|
+
date: 2009-07-28 00:00:00 +02:00
|
34
34
|
default_executable:
|
35
35
|
dependencies: []
|
36
36
|
|
metadata.gz.sig
CHANGED
Binary file
|