bootstripe 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/bootstripe.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Bootstripe::VERSION
8
8
  s.authors = ["Mike Laurence"]
9
9
  s.email = ["mike@bytebin.com"]
10
- s.homepage = "http://github.com/bytebin/bootstripe"
10
+ s.homepage = "http://bytebin.com"
11
11
  s.summary = %q{A handful of useful additions for Ruby}
12
12
  s.description = %q{A handful of useful additions for Ruby}
13
13
 
@@ -0,0 +1,12 @@
1
+ class Hash
2
+ def nested_keys
3
+ keys = []
4
+ self.each do |key, value|
5
+ keys << key
6
+ if value.is_a?(Hash)
7
+ keys += value.nested_keys
8
+ end
9
+ end
10
+ keys
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Bootstripe
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/lib/bootstripe.rb CHANGED
@@ -2,6 +2,7 @@ require 'bootstripe/version'
2
2
 
3
3
  # Additions
4
4
  require 'bootstripe/array_additions'
5
+ require 'bootstripe/hash_additions'
5
6
  require 'bootstripe/date_additions'
6
7
  require 'bootstripe/number_additions'
7
8
  require 'bootstripe/string_additions'
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Hash do
4
+
5
+ it 'should extract all nested keys' do
6
+ { :a => { :b => { :c => :d, :e => :f }}}.nested_keys.should =~ [:a, :b, :c, :e]
7
+ end
8
+
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-19 00:00:00.000000000Z
12
+ date: 2012-01-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70096044310980 !ruby/object:Gem::Requirement
16
+ requirement: &70185416102000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70096044310980
24
+ version_requirements: *70185416102000
25
25
  description: A handful of useful additions for Ruby
26
26
  email:
27
27
  - mike@bytebin.com
@@ -36,15 +36,17 @@ files:
36
36
  - lib/bootstripe.rb
37
37
  - lib/bootstripe/array_additions.rb
38
38
  - lib/bootstripe/date_additions.rb
39
+ - lib/bootstripe/hash_additions.rb
39
40
  - lib/bootstripe/number_additions.rb
40
41
  - lib/bootstripe/string_additions.rb
41
42
  - lib/bootstripe/version.rb
42
43
  - lib/bootstripe/www_middleware.rb
43
44
  - spec/array_additions_spec.rb
45
+ - spec/hash_additions_spec.rb
44
46
  - spec/number_additions_spec.rb
45
47
  - spec/spec_helper.rb
46
48
  - spec/string_additions_spec.rb
47
- homepage: http://github.com/bytebin/bootstripe
49
+ homepage: http://bytebin.com
48
50
  licenses: []
49
51
  post_install_message:
50
52
  rdoc_options: []
@@ -64,12 +66,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
66
  version: '0'
65
67
  requirements: []
66
68
  rubyforge_project: bootstripe
67
- rubygems_version: 1.8.11
69
+ rubygems_version: 1.8.10
68
70
  signing_key:
69
71
  specification_version: 3
70
72
  summary: A handful of useful additions for Ruby
71
73
  test_files:
72
74
  - spec/array_additions_spec.rb
75
+ - spec/hash_additions_spec.rb
73
76
  - spec/number_additions_spec.rb
74
77
  - spec/spec_helper.rb
75
78
  - spec/string_additions_spec.rb