a9n 0.4.7 → 0.4.8

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: 6c42b5f9aaf76bc887465a6fdd0a79ee562d9295
4
- data.tar.gz: f0451023f9ef4e7868040ed028ca0c7c375a6672
3
+ metadata.gz: 8d7b6f67761f28850dea8e4597faab3adca453c2
4
+ data.tar.gz: 2ef0b7f9f6c5bed14c886d47421766f9393153f9
5
5
  SHA512:
6
- metadata.gz: 2b3d29df86f51828f13546861bb0839424a14606d6724798ae7893c43aa06200899693e6267d538f0167d9a062c88776e2721c1363d8879b2eea50e2860b673c
7
- data.tar.gz: d972cf3270b4b97f87aae0f7806b4b6c2fbd5f917150c4a80ec8b6686f3eb5a7250f8bf68be1ef0f77189110cc908c2e290f9e77104f1ccca50a5522a3d827c8
6
+ metadata.gz: 6cdbf3cee8e569f20291055dc656121a4dc6370453c904c4fb2c4b470e87fdbc412dc441c15c71c54380c6fe834ce51c4dfd04e15ba994f0ebb933e7328b538f
7
+ data.tar.gz: 09abe59d61a6016e4a2e572430676380b5df99085b83c60f156d4d31751dce6b49294dd313d4c1c8fd0039823c45d224427f6fd1409e85fcfa357ec5fc13cb04
@@ -1 +1 @@
1
- 2.2.3@a9n
1
+ 2.3.0@a9n
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.1.7
4
- - 2.2.3
4
+ - 2.2.4
5
+ - 2.3.0
5
6
  addons:
6
7
  code_climate:
7
8
  repo_token: 9aa2aa2432639c57772b6917ad9da468709e5536b75617575b02b35201a2eaf8
@@ -1,19 +1,31 @@
1
- require 'ostruct'
2
-
3
1
  module A9n
4
- class Struct < OpenStruct
2
+ class Struct
5
3
  extend Forwardable
6
4
 
7
- def_delegators :@table, :empty?, :keys, :key?, :fetch
5
+ def_delegators :@data, :empty?, :keys, :key?, :fetch, :[], :[]=
8
6
 
9
- def merge(key_value)
10
- key_value.each_pair do |key, value|
11
- self[key] = value
12
- end
7
+ def initialize(data = {})
8
+ @data = data
9
+ end
10
+
11
+ def to_hash
12
+ data
13
+ end
14
+
15
+ def merge(another_data)
16
+ data.merge!(another_data)
13
17
  end
14
18
 
15
19
  def method_missing(name, *args)
16
- raise NoSuchConfigurationVariableError.new(name)
20
+ if data.key?(name)
21
+ fetch(name)
22
+ else
23
+ raise NoSuchConfigurationVariableError.new(name)
24
+ end
17
25
  end
26
+
27
+ private
28
+
29
+ attr_reader :data
18
30
  end
19
31
  end
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a9n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a9n - ruby/rails apps configuration manager
14
14
  email:
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.4.5.1
72
+ rubygems_version: 2.5.1
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: a9n is a tool to keep ruby/rails apps extra configuration easily maintainable