laserlemon-with_recursive_options 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/Manifest +13 -0
- data/README.rdoc +13 -0
- data/Rakefile +14 -0
- data/VERSION.yml +4 -0
- data/init.rb +4 -0
- data/lib/hash.rb +12 -0
- data/lib/mapper.rb +3 -0
- data/lib/object.rb +5 -0
- data/lib/recursive_option_merger.rb +14 -0
- data/test/test_helper.rb +3 -0
- data/test/with_recursive_options_test.rb +8 -0
- data/with_recursive_options.gemspec +31 -0
- metadata +75 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Steve Richert
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest
ADDED
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('with_recursive_options', '0.1.0') do |g|
|
6
|
+
g.description = %(Extend Rails Object#with_options to recursively merge options)
|
7
|
+
g.url = 'http://github.com/laserlemon/with_recursive_options'
|
8
|
+
g.author = 'Steve Richert'
|
9
|
+
g.email = 'steve@laserlemon.com'
|
10
|
+
g.ignore_pattern = %w(tmp/* script/*)
|
11
|
+
g.development_dependencies = []
|
12
|
+
end
|
13
|
+
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each{|t| load t }
|
data/VERSION.yml
ADDED
data/init.rb
ADDED
data/lib/hash.rb
ADDED
data/lib/mapper.rb
ADDED
data/lib/object.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module ActiveSupport
|
2
|
+
class RecursiveOptionMerger < OptionMerger
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
def merge_argument_options!(arguments)
|
7
|
+
arguments << if arguments.last.respond_to? :to_hash
|
8
|
+
@options.recursive_merge(arguments.pop)
|
9
|
+
else
|
10
|
+
@options.dup
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{with_recursive_options}
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Steve Richert"]
|
9
|
+
s.date = %q{2009-05-29}
|
10
|
+
s.description = %q{Extend Rails Object#with_options to recursively merge options}
|
11
|
+
s.email = %q{steve@laserlemon.com}
|
12
|
+
s.extra_rdoc_files = ["lib/hash.rb", "lib/mapper.rb", "lib/object.rb", "lib/recursive_option_merger.rb", "README.rdoc"]
|
13
|
+
s.files = ["init.rb", "lib/hash.rb", "lib/mapper.rb", "lib/object.rb", "lib/recursive_option_merger.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README.rdoc", "test/test_helper.rb", "test/with_recursive_options_test.rb", "VERSION.yml", "with_recursive_options.gemspec"]
|
14
|
+
s.homepage = %q{http://github.com/laserlemon/with_recursive_options}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "With_recursive_options", "--main", "README.rdoc"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{with_recursive_options}
|
18
|
+
s.rubygems_version = %q{1.3.3}
|
19
|
+
s.summary = %q{Extend Rails Object#with_options to recursively merge options}
|
20
|
+
s.test_files = ["test/test_helper.rb", "test/with_recursive_options_test.rb"]
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
s.specification_version = 3
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
+
else
|
28
|
+
end
|
29
|
+
else
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: laserlemon-with_recursive_options
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Steve Richert
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-29 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Extend Rails Object#with_options to recursively merge options
|
17
|
+
email: steve@laserlemon.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- lib/hash.rb
|
24
|
+
- lib/mapper.rb
|
25
|
+
- lib/object.rb
|
26
|
+
- lib/recursive_option_merger.rb
|
27
|
+
- README.rdoc
|
28
|
+
files:
|
29
|
+
- init.rb
|
30
|
+
- lib/hash.rb
|
31
|
+
- lib/mapper.rb
|
32
|
+
- lib/object.rb
|
33
|
+
- lib/recursive_option_merger.rb
|
34
|
+
- Manifest
|
35
|
+
- MIT-LICENSE
|
36
|
+
- Rakefile
|
37
|
+
- README.rdoc
|
38
|
+
- test/test_helper.rb
|
39
|
+
- test/with_recursive_options_test.rb
|
40
|
+
- VERSION.yml
|
41
|
+
- with_recursive_options.gemspec
|
42
|
+
has_rdoc: false
|
43
|
+
homepage: http://github.com/laserlemon/with_recursive_options
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options:
|
46
|
+
- --line-numbers
|
47
|
+
- --inline-source
|
48
|
+
- --title
|
49
|
+
- With_recursive_options
|
50
|
+
- --main
|
51
|
+
- README.rdoc
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "1.2"
|
65
|
+
version:
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project: with_recursive_options
|
69
|
+
rubygems_version: 1.2.0
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Extend Rails Object#with_options to recursively merge options
|
73
|
+
test_files:
|
74
|
+
- test/test_helper.rb
|
75
|
+
- test/with_recursive_options_test.rb
|