bogo 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 495624d0b24d9c6511abe8044be96c32506c473d
4
- data.tar.gz: b3e80eeaf01de11a50e34c723ff574affdcba142
3
+ metadata.gz: 5ef23bc2efa4e4bfcaf1de4a924eaa6e2ef4fd98
4
+ data.tar.gz: b6db055fcf8ae478a604078c1bb3ff8dcb814b9e
5
5
  SHA512:
6
- metadata.gz: 3e57145c2f42b320bb64b2324ad407ad3362e98038d17bf28f4764432c0da0679fc456bcd2cd4cde994db89a5358c7749b611d8788a01542f413b52076a5abc1
7
- data.tar.gz: d1109277e24b9ac77f74366c925f8136755371f321bbd04bb427ce13f3d4dfe5f31275575ecc793f32640c4fc4f633097828389105daeb8509c99de9b679c4a1
6
+ metadata.gz: 09b6a5b951c920aaf1e8ba050ba703f70ade67efb61839ef7666d81120bd24b51a4aca5ceca43281499ce34601ba83d6cc6fb6925e2dc66ae02d012dbb4a9e3b
7
+ data.tar.gz: 80f99d175bc7a81233caaee8147adf367bb0985d3878bbda0e23094bafeb217849e4c97a134557e7a2c7a999015baa2c73da50a62db5dd5871db9d6b34b45635
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.6
2
+ * Add utility module for easy direct access to helpers
3
+ * Add support for automatic key conversion (:snake or :camel) on `Smash#to_smash`
4
+
1
5
  ## v0.1.4
2
6
  * Add constant helpers
3
7
  * Add support for freezing Smashes
data/lib/bogo.rb CHANGED
@@ -6,6 +6,7 @@ module Bogo
6
6
  autoload :Lazy, 'bogo/lazy'
7
7
  autoload :Memoization, 'bogo/memoization'
8
8
  autoload :Smash, 'bogo/smash'
9
+ autoload :Utility, 'bogo/utility'
9
10
  end
10
11
 
11
12
  # Always load smash
data/lib/bogo/smash.rb CHANGED
@@ -121,6 +121,11 @@ class Hash
121
121
  process = self
122
122
  end
123
123
  process.each do |k,v|
124
+ if(args.include?(:snake))
125
+ k = Bogo::Utility.snake(k.to_s)
126
+ elsif(args.include?(:camel))
127
+ k = Bogo::Utility.camel(k.to_s)
128
+ end
124
129
  smash[k.is_a?(Symbol) ? k.to_s : k] = smash_conversion(v, convert_call, *args)
125
130
  end
126
131
  end
@@ -0,0 +1,9 @@
1
+ require 'bogo'
2
+
3
+ module Bogo
4
+ # Utility module for direct access to helpers
5
+ module Utility
6
+ extend Bogo::AnimalStrings
7
+ extend Bogo::Constants
8
+ end
9
+ end
data/lib/bogo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bogo
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.1.4')
3
+ VERSION = Gem::Version.new('0.1.6')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-17 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -55,6 +55,7 @@ files:
55
55
  - lib/bogo/lazy.rb
56
56
  - lib/bogo/memoization.rb
57
57
  - lib/bogo/smash.rb
58
+ - lib/bogo/utility.rb
58
59
  - lib/bogo/version.rb
59
60
  homepage: https://github.com/spox/bogo
60
61
  licenses: