configutron 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/core_ext.rb +21 -0
- data/rails/init.rb +1 -0
- metadata +2 -1
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/core_ext.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/195959
|
2
|
+
|
3
|
+
class Object
|
4
|
+
def to_openstruct
|
5
|
+
self
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class Array
|
10
|
+
def to_openstruct
|
11
|
+
map{ |el| el.to_openstruct }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Hash
|
16
|
+
def to_openstruct
|
17
|
+
mapped = {}
|
18
|
+
each{ |key,value| mapped[key] = value.to_openstruct }
|
19
|
+
OpenStruct.new(mapped)
|
20
|
+
end
|
21
|
+
end
|
data/rails/init.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configutron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neal Clark
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- Rakefile
|
59
59
|
- VERSION
|
60
60
|
- lib/configutron.rb
|
61
|
+
- lib/core_ext.rb
|
61
62
|
- rails/init.rb
|
62
63
|
- spec/configutron_spec.rb
|
63
64
|
- spec/fake_rails_root/config/settings/development.yml
|