flyml 0.2.0 → 0.3.0

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: ede51d369e710a8baf7e06e11e897063ff2820ca
4
- data.tar.gz: 25128f85465dff74556142b119c45bb50352313c
3
+ metadata.gz: 85acf4f52f6b9df263318fad5fa856f424722844
4
+ data.tar.gz: 00b520b6d77508dc0935e57f041287748c32ab48
5
5
  SHA512:
6
- metadata.gz: 785933acd29f64ca64815fb7015a650d872a9cb018840c1609cdb68782a77ee6571be4a5cbf30a308b56653cfaa082be566cd623b8d954b95463b12ea9c55da2
7
- data.tar.gz: 3c87a5657867b50659037c3a075193238ae6ad643938c8a107d5a0092aa683a0bf52cd941a0afcdc3bd372e09a8a46712ff6f25f5badbae43f5215fb0f7eb05f
6
+ metadata.gz: bdad220c9566d54fee9f31103ecab44096af46b6494b2743fed6d2ee9447d828ffad91f5179acdfdaaad954eb4083cc7ff1a61dfa2a34ff064b441d1272a2320
7
+ data.tar.gz: 1f239c5111c25f372a1df1f6078786b6d70d9cab4b8f278c479b0fb673d616ccd0879c451aca8c42b03e310f76c4e711ae0aa38f360d3de84dd974aa6b1c72c3
data/README.md CHANGED
@@ -51,7 +51,7 @@ Here's how you would use Flyml:
51
51
  ```ruby
52
52
  require 'flyml'
53
53
 
54
- config = Flyml.config(root: '/path/to/project_root', env: Flyml.env = 'development')
54
+ config = Flyml.config(root: '/path/to/project_root', env: 'development')
55
55
 
56
56
  config[:redis][:host] # 'dev.local'
57
57
  config[:redis][:port] # 6379
@@ -19,8 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "activesupport", ">= 3.2.0"
23
-
24
22
  spec.add_development_dependency "bundler", ">= 1.9"
25
23
  spec.add_development_dependency "rake", "~> 10.0"
26
24
  spec.add_development_dependency "rspec", "~> 3.4"
@@ -1,18 +1,36 @@
1
- require 'active_support/core_ext/hash/keys'
2
-
3
1
  class Hash
2
+ def symbolize_keys!
3
+ keys.each do |key|
4
+ new_key = begin
5
+ key.to_sym
6
+ rescue
7
+ key
8
+ end
9
+
10
+ self[new_key] = delete(key)
11
+ end
12
+ end
13
+
4
14
  def recursive_symbolize_keys!
5
15
  symbolize_keys!
16
+
6
17
  # symbolize each hash in .values
7
18
  values.each { |h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
19
+
8
20
  # symbolize each hash inside an array in .values
9
- values.select { |v| v.is_a?(Array) }.flatten.each { |h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
21
+ values.
22
+ select { |v| v.is_a?(Array) }.
23
+ flatten.
24
+ each { |h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
25
+
10
26
  self
11
27
  end
12
28
 
13
29
  def deep_fetch(*args, &block)
14
30
  return self if args.empty?
31
+
15
32
  value = fetch(args.shift, &block)
33
+
16
34
  if value.is_a?(Hash)
17
35
  value.deep_fetch(*args, &block)
18
36
  elsif value.is_a?(Array) && !args.empty?
@@ -1,3 +1,3 @@
1
1
  module Flyml
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flyml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - peerTransfer tech
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.2.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 3.2.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement