watir_model 0.3.0 → 0.3.1

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: 93dd97375c9cde4f1f0248a82f41112b20ac2c70
4
- data.tar.gz: 95284dab556334ff3ef5bf1cf1cab1764801d4f6
3
+ metadata.gz: 9085dc14b69f2a8e1ed12aecd5241f513e990524
4
+ data.tar.gz: 2be96f1b547f5f1b7b572f87bd02f808c704fad4
5
5
  SHA512:
6
- metadata.gz: 55e94841ba3795a67b045325c235ff7e5295200f9ef4dbce1f983bc54c42fc80c888140b8f8e68e91dd4df953deb1fa161e7d3f1a6a2b55943dcc300270c4999
7
- data.tar.gz: 02520b948b3879bd9702d4dad4fd5553c0e0fb47f3af896abc7bf1ce4dcfcc5ce65df7a49f7ce744195ce062aa8512603915044eff1626fd2fa0e14cb0e26fd1
6
+ metadata.gz: a15324a7547c57422ffeec87c1c3a957ba6acfb9341b198145f59aa6857e488d42b4d104c3d38cbad75c46fb6faef945a8d15c0a5028e579e16cd25f0a516520
7
+ data.tar.gz: ed15f70dc9e37ee0fac354d173b11b65caa73b4920105a3ed8b1685b3a9922b1fbf391f545bac116f13341602b79c0261f5f589b202d7f823eb7d8039bb86cc0
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.1 (2017-05-19)
2
+
3
+ * initialize and convert Model using Hash with keys as Strings
4
+
1
5
  ### 0.3.0 (2016-12-31)
2
6
 
3
7
  * move ENV variable override into ConfigModel subclass
data/lib/watir_model.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'pp'
1
+ require 'active_support/hash_with_indifferent_access'
2
2
 
3
3
  class WatirModel
4
4
  class << self
@@ -26,6 +26,7 @@ class WatirModel
26
26
  end
27
27
 
28
28
  def convert(hash, *args)
29
+ hash.deep_symbolize_keys!
29
30
  filtered = hash.reject { |k| !keys.include?(k) }
30
31
  model = new(filtered)
31
32
  args.each do |key|
@@ -38,6 +39,7 @@ class WatirModel
38
39
  end
39
40
 
40
41
  def initialize(hash={})
42
+ hash.deep_symbolize_keys!
41
43
  update(hash)
42
44
 
43
45
  (self.class.defaults.keys - hash.keys).each do |key|
data/watir_model.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "watir_model"
5
- spec.version = "0.3.0"
5
+ spec.version = "0.3.1"
6
6
  spec.authors = ["Titus Fortner"]
7
7
  spec.email = ["titusfortner@gmail.com"]
8
8
 
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
26
 
27
+ spec.add_runtime_dependency 'activesupport'
28
+
27
29
  spec.add_development_dependency "bundler", "~> 1.9"
28
30
  spec.add_development_dependency "rake", "~> 10.0"
29
31
  spec.add_development_dependency "rspec", "~> 3.3"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Fortner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2017-05-20 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: '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
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement