constantizer 1.1.0 → 1.1.2

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: 8666bfac9f1c149ca9e9047aae66854ef27cf2db
4
- data.tar.gz: d7e4c10ef4ad138c955f1620237d5e235ce49310
3
+ metadata.gz: 7d42dfa92d44a7445cc3841a24a3de0c3a10543a
4
+ data.tar.gz: 97eee5c20a5bce98ca953192ea00a8c0dbdb7640
5
5
  SHA512:
6
- metadata.gz: a1d3fcf4f7c99f5bce312e443ccb02185f018c3c198d9527108d1f2bf71aee134acf534731f865c11cc5a709ee5c532eae749bd86eca11bd51a3f814a7a52345
7
- data.tar.gz: 8476140aafd89e7b926e40d07cb5d5bc847b6c770ebfb9e10abd26be2b0e6d717f65092af0d9dafbbcaab644565d8d40ce662f943b86c48c6668db39ecb21925
6
+ metadata.gz: e09c859c2d8253898b074938b762093a3bf56f03129ac150d65cc7734a0370548b1ea8290e6546c5ffc83971ff78e65e893c8dfdb96569d0ee36bceccaf73823
7
+ data.tar.gz: 16c52c53456fce9ca2e0e8427ddd20ffd54c8718be26c32bb0e75b3193a8c96eaf7e8d3961e43a2d28cc4b4f2d35c2a213e40ce5fd1210ae5db0cbae3819e903
@@ -1,4 +1,4 @@
1
- CURRENCIES:
1
+ currencies:
2
2
  - USD
3
3
  - EUR
4
- DEFAULT_CURRENCY: <%= CURRENCIES.first %>
4
+ default_currency: USD
@@ -1,3 +1,3 @@
1
1
  module Constantizer
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.2'
3
3
  end
data/lib/constantizer.rb CHANGED
@@ -1,12 +1,16 @@
1
1
  require 'constantizer/version'
2
2
  require 'constantizer/configuration'
3
- require 'erb'
3
+ require 'yaml'
4
4
 
5
5
  module Constantizer
6
6
 
7
7
  def self.load!(path)
8
8
  @path = path
9
- Dir.glob(File.join(path,'/*.yml')).each { |file| YAML.load(ERB.new(IO.read(file)).result).each { |k, v| Object.const_set k.upcase, v } }
9
+ Dir.glob(File.join(path,'/*.yml')).each do |file|
10
+ YAML.load(IO.read(file)).each do |key, value|
11
+ Kernel.const_set(key.upcase, value)
12
+ end
13
+ end
10
14
  end
11
15
 
12
16
  def self.reload!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constantizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baraa Al-Bourghli
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-25 00:00:00.000000000 Z
12
+ date: 2014-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -39,15 +39,45 @@ dependencies:
39
39
  - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - <
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - <
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: pry
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
42
70
  description:
43
71
  email:
44
- - essam.a0@gmail.com
45
72
  - baraa.bourghli@gmail.com
73
+ - essam.a0@gmail.com
46
74
  executables:
47
75
  - constantizer
48
76
  extensions: []
49
77
  extra_rdoc_files: []
50
78
  files:
79
+ - bin/constantizer
80
+ - lib/constantizer.rb
51
81
  - lib/constantizer/configuration.rb
52
82
  - lib/constantizer/integration/rails.rb
53
83
  - lib/constantizer/integration/sinatra.rb
@@ -56,8 +86,6 @@ files:
56
86
  - lib/constantizer/tasks/install.rake
57
87
  - lib/constantizer/templates/common.yml
58
88
  - lib/constantizer/version.rb
59
- - lib/constantizer.rb
60
- - bin/constantizer
61
89
  homepage: https://github.com/baraabourghli/constantizer
62
90
  licenses:
63
91
  - MIT
@@ -78,9 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
106
  version: '0'
79
107
  requirements: []
80
108
  rubyforge_project:
81
- rubygems_version: 2.0.0
109
+ rubygems_version: 2.2.2
82
110
  signing_key:
83
111
  specification_version: 4
84
112
  summary: constantizer is a gem for bulding constants in the app using YAML files
85
113
  test_files: []
86
- has_rdoc: