confickle 1.0.0.alpha.1 → 1.0.0.alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +5 -13
  2. data/lib/confickle.rb +23 -0
  3. metadata +19 -5
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWVmMTM0MDI2MDEwNjg3NDlhYTBhMDI4ZDA1ODdjMDI4ZTFmNjU2ZA==
5
- data.tar.gz: !binary |-
6
- MzUxMjM2MDExNzI4ZDQ0OGY3YzM4ZTUzYjc1MWMwYzk4MTg5ODBiNQ==
2
+ SHA1:
3
+ metadata.gz: 2651c3d266c38b8f441a9c3ae9ab58b45cd7d16b
4
+ data.tar.gz: 5416958146b6d074f5f3835374d953592ed04b7c
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTkzYzY3NWQzOGU3MTUxNDA1ZWQ3ZDJjNmU2NDdiNjEyY2YxYTZkNTAwMWM4
10
- YjRkNDFhNTNhNTBlMDJkMzk4NmY5ZWRhMDg3NzUxNDBmMTRkMTdmMzRhZjk2
11
- M2YwODgyZDhlZWM5YmRlMjcyNzA5MjI3MDkyMmVhNDZkY2MzNWE=
12
- data.tar.gz: !binary |-
13
- YjRlMTQ3ODlmNTI1MWY5MmU4MDBkODBmOGFlYjA4OGNiMGY3MjllMTBiZWI4
14
- ZDE4OWQ4ZDZkZThjYjgyZjZjNWMzNTllNTJjMDRlN2RhNjRhMTdkZDFlZGRm
15
- YzNmODJlZTBiMjFiZDhjMzI5ZjAwYzkzMjU3MDlmNDkwNTZhODI=
6
+ metadata.gz: 0d0599ba632876babadf307654f88d05e031b09ea46b840b866b37aa53af2d50fc8d060b22585e8e9e73a00b942bd4638422c3918948ed424daafbc34ab6612b
7
+ data.tar.gz: 60c237f43054146119f43e5589d4ca71d910bc45d076dcdef73cfff37b4e8cdafc0ae592fce2eb3968bcdc7d56f2465fc7cd71b7c7d71f8ed2c0fd8f26125021
data/lib/confickle.rb CHANGED
@@ -1,5 +1,8 @@
1
1
 
2
2
  require 'json'
3
+ require 'yaml'
4
+
5
+ require 'recsym'
3
6
 
4
7
  class Confickle
5
8
 
@@ -22,6 +25,7 @@ class Confickle
22
25
  def content(*args)
23
26
  File.read(self.path(*args))
24
27
  end
28
+ alias_method :contents, :content
25
29
 
26
30
  def json(*args)
27
31
  if args.last.is_a? Hash
@@ -39,6 +43,25 @@ class Confickle
39
43
  end
40
44
 
41
45
 
46
+ def yaml(*args)
47
+ if args.last.is_a? Hash
48
+ args = args.dup
49
+ options = args.pop
50
+ else
51
+ options = {}
52
+ end
53
+
54
+ retval = YAML.load_file(path(*args))
55
+
56
+ sn = options.fetch(:symbolize_names, self.symbolize_names)
57
+ if sn
58
+ RecSym.this(retval)
59
+ else
60
+ retval
61
+ end
62
+ end
63
+
64
+
42
65
  end
43
66
 
44
67
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confickle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.1
4
+ version: 1.0.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lauber
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-12-11 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: recsym
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Simplified access to config files.
14
28
  email: constructible.truth@gmail.com
15
29
  executables: []
@@ -27,17 +41,17 @@ require_paths:
27
41
  - lib
28
42
  required_ruby_version: !ruby/object:Gem::Requirement
29
43
  requirements:
30
- - - ! '>='
44
+ - - ">="
31
45
  - !ruby/object:Gem::Version
32
46
  version: '0'
33
47
  required_rubygems_version: !ruby/object:Gem::Requirement
34
48
  requirements:
35
- - - ! '>'
49
+ - - ">"
36
50
  - !ruby/object:Gem::Version
37
51
  version: 1.3.1
38
52
  requirements: []
39
53
  rubyforge_project:
40
- rubygems_version: 2.1.11
54
+ rubygems_version: 2.2.2
41
55
  signing_key:
42
56
  specification_version: 4
43
57
  summary: Simplified access to config files.