watir_model 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/config/data/default_model.yml +3 -0
- data/lib/config_model.rb +7 -2
- data/lib/watir_model.rb +3 -1
- data/watir_model.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 274dcadc9cddab4d7cacdd063b01a37327679463
|
4
|
+
data.tar.gz: 75988bb4db16b6908a81d763640ce34baa35989e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1ad427cd4b8b9dcc630205b7ff80db52c1249bd8413c79173b629849b06d58616b8c745aaf067c36b50d0b78489d853a88745555f558fcaf9247002167f1069
|
7
|
+
data.tar.gz: cfca5bbf471cb2f19841dab263d8f42366991b7f01b5ccc93ac892debe1dd205b8da4f8dd9285628794da7610d1066a3cd9a9188f798e6ce5ff2d693344d3496
|
data/CHANGES.md
CHANGED
data/lib/config_model.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
require 'pp'
|
2
|
-
|
3
1
|
class ConfigModel < WatirModel
|
2
|
+
def self.create(hash = {})
|
3
|
+
file = factory_file(self)
|
4
|
+
env = ENV[self.to_s.underscore.upcase]
|
5
|
+
data = data_from_yaml(file, env)
|
6
|
+
new(data.merge hash)
|
7
|
+
end
|
8
|
+
|
4
9
|
def default_value(key, block)
|
5
10
|
ENV[key.to_s.upcase] || instance_exec(&block)
|
6
11
|
end
|
data/lib/watir_model.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'active_support/hash_with_indifferent_access'
|
2
|
+
require 'active_support/core_ext/string'
|
3
|
+
|
2
4
|
require 'json'
|
3
5
|
require 'date'
|
4
6
|
require 'time'
|
@@ -113,7 +115,7 @@ class WatirModel
|
|
113
115
|
end
|
114
116
|
|
115
117
|
def factory_file(type)
|
116
|
-
Dir.glob("#{WatirModel.yml_directory}/#{type.to_s[/[^:]*$/].
|
118
|
+
Dir.glob("#{WatirModel.yml_directory}/#{type.to_s[/[^:]*$/].underscore}.yml").first
|
117
119
|
end
|
118
120
|
|
119
121
|
def data_from_yaml(file, value)
|
data/watir_model.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- Rakefile
|
111
111
|
- config/alternate/address.yml
|
112
112
|
- config/data/address.yml
|
113
|
+
- config/data/default_model.yml
|
113
114
|
- lib/config_model.rb
|
114
115
|
- lib/watir_model.rb
|
115
116
|
- watir_model.gemspec
|