jsonb_accessor 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: b3280838fd8b45ffea5fd3892240799bbb6785f7
4
- data.tar.gz: 561e28860a5d43e25afc95ef79473480d2cc368e
3
+ metadata.gz: 9565410763ee9eea5acf3d6777d05499bcc252e2
4
+ data.tar.gz: 437f4d27e4798c1fedc0fc8cac83ab819cbbdd04
5
5
  SHA512:
6
- metadata.gz: 080851d0cc5ea02c5d443a65473d97fd588de21c24011bbb65ab1ec7a96bdbc74b9b44298234d322dc942f8adf7ee775fb0d2fdb336cdb59455ec3f6d9a72e52
7
- data.tar.gz: 1430c66ba53b9a01ce052043fbb49e75a1f90233f27de85a77e619eaa04e397853aeb7c82a5f2f1e8a0cf5f2ebe1f859e6680b9fc7161b160389c3b0366986b5
6
+ metadata.gz: 6cd4aac8ddcf212710f4daff6891493a1a8c62633e5e9c88038d2532215fed58c9b6f1a901dde9101941f8cc18ce05f0c5a57d0b946fb9510637304846309325
7
+ data.tar.gz: 0d063060883e0c77de74d10bc7470cc08a03133a7a452d83ee4c6d3648fbbb55bd80a48f89919a58e8304ec826ef69feacc54c6d23d6cea36a8c5649ed46c8fe
data/.rubocop.yml CHANGED
@@ -3,6 +3,7 @@ AllCops:
3
3
  - "**/Rakefile"
4
4
  Exclude:
5
5
  - db/**/*
6
+ - gemfiles/**/*
6
7
  - vendor/**/*
7
8
  Lint/SpaceBeforeFirstArg:
8
9
  Enabled: false
data/.travis.yml CHANGED
@@ -12,3 +12,8 @@ before_script:
12
12
  - bundle exec rake db:create
13
13
  - bundle exec rake db:migrate
14
14
  cache: bundler
15
+ gemfile:
16
+ - gemfiles/activerecord_4.2.1.gemfile
17
+ - gemfiles/activerecord_4.2.2.gemfile
18
+ - gemfiles/activerecord_4.2.3.gemfile
19
+ - gemfiles/activerecord_4.2.4.gemfile
data/Appraisals CHANGED
@@ -1,7 +1,19 @@
1
1
  appraise "activerecord-4.2.1" do
2
+ gemspec
2
3
  gem "activerecord", "4.2.1"
3
4
  end
4
5
 
5
6
  appraise "activerecord-4.2.2" do
7
+ gemspec
6
8
  gem "activerecord", "4.2.2"
7
9
  end
10
+
11
+ appraise "activerecord-4.2.3" do
12
+ gemspec
13
+ gem "activerecord", "4.2.3"
14
+ end
15
+
16
+ appraise "activerecord-4.2.4" do
17
+ gemspec
18
+ gem "activerecord", "4.2.4"
19
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- jsonb_accessor (0.3.0)
4
+ jsonb_accessor (0.3.1)
5
5
  activerecord (>= 4.2.1)
6
6
  pg
7
7
 
@@ -49,17 +49,17 @@ GEM
49
49
  diff-lcs (1.2.5)
50
50
  erubis (2.7.0)
51
51
  i18n (0.7.0)
52
- json (1.8.2)
52
+ json (1.8.3)
53
53
  loofah (2.0.1)
54
54
  nokogiri (>= 1.5.9)
55
55
  method_source (0.8.2)
56
56
  mini_portile (0.6.2)
57
- minitest (5.5.1)
57
+ minitest (5.8.1)
58
58
  nokogiri (1.6.6.2)
59
59
  mini_portile (~> 0.6.0)
60
60
  parser (2.2.2.5)
61
61
  ast (>= 1.1, < 3.0)
62
- pg (0.18.1)
62
+ pg (0.18.3)
63
63
  powerpack (0.1.1)
64
64
  pry (0.10.1)
65
65
  coderay (~> 1.1.0)
@@ -108,8 +108,8 @@ GEM
108
108
  rainbow (>= 1.99.1, < 3.0)
109
109
  ruby-progressbar (~> 1.4)
110
110
  ruby-progressbar (1.7.5)
111
- shoulda-matchers (2.8.0)
112
- activesupport (>= 3.0.0)
111
+ shoulda-matchers (3.0.0)
112
+ activesupport (>= 4.0.0)
113
113
  slop (3.6.0)
114
114
  standalone_migrations (4.0.1)
115
115
  activerecord (~> 4.2.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- jsonb_accessor (0.3.0)
4
+ jsonb_accessor (0.3.1)
5
5
  activerecord (>= 4.2.1)
6
6
  pg
7
7
 
@@ -55,12 +55,12 @@ GEM
55
55
  nokogiri (>= 1.5.9)
56
56
  method_source (0.8.2)
57
57
  mini_portile (0.6.2)
58
- minitest (5.7.0)
58
+ minitest (5.8.1)
59
59
  nokogiri (1.6.6.2)
60
60
  mini_portile (~> 0.6.0)
61
61
  parser (2.3.0.pre.2)
62
62
  ast (>= 1.1, < 3.0)
63
- pg (0.18.2)
63
+ pg (0.18.3)
64
64
  powerpack (0.1.1)
65
65
  pry (0.10.1)
66
66
  coderay (~> 1.1.0)
@@ -109,8 +109,8 @@ GEM
109
109
  rainbow (>= 1.99.1, < 3.0)
110
110
  ruby-progressbar (~> 1.4)
111
111
  ruby-progressbar (1.7.5)
112
- shoulda-matchers (2.8.0)
113
- activesupport (>= 3.0.0)
112
+ shoulda-matchers (3.0.0)
113
+ activesupport (>= 4.0.0)
114
114
  slop (3.6.0)
115
115
  standalone_migrations (4.0.2)
116
116
  activerecord (~> 4.2.0)
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "4.2.3"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jsonb_accessor (0.3.1)
5
+ activerecord (>= 4.2.1)
6
+ pg
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.2.3)
12
+ actionview (= 4.2.3)
13
+ activesupport (= 4.2.3)
14
+ rack (~> 1.6)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (4.2.3)
19
+ activesupport (= 4.2.3)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ activemodel (4.2.3)
25
+ activesupport (= 4.2.3)
26
+ builder (~> 3.1)
27
+ activerecord (4.2.3)
28
+ activemodel (= 4.2.3)
29
+ activesupport (= 4.2.3)
30
+ arel (~> 6.0)
31
+ activesupport (4.2.3)
32
+ i18n (~> 0.7)
33
+ json (~> 1.7, >= 1.7.7)
34
+ minitest (~> 5.1)
35
+ thread_safe (~> 0.3, >= 0.3.4)
36
+ tzinfo (~> 1.1)
37
+ appraisal (2.1.0)
38
+ bundler
39
+ rake
40
+ thor (>= 0.14.0)
41
+ arel (6.0.3)
42
+ ast (2.1.0)
43
+ astrolabe (1.3.1)
44
+ parser (~> 2.2)
45
+ awesome_print (1.6.1)
46
+ builder (3.2.2)
47
+ coderay (1.1.0)
48
+ database_cleaner (1.5.1)
49
+ diff-lcs (1.2.5)
50
+ erubis (2.7.0)
51
+ i18n (0.7.0)
52
+ json (1.8.3)
53
+ loofah (2.0.3)
54
+ nokogiri (>= 1.5.9)
55
+ method_source (0.8.2)
56
+ mini_portile (0.6.2)
57
+ minitest (5.8.1)
58
+ nokogiri (1.6.6.2)
59
+ mini_portile (~> 0.6.0)
60
+ parser (2.2.3.0)
61
+ ast (>= 1.1, < 3.0)
62
+ pg (0.18.3)
63
+ powerpack (0.1.1)
64
+ pry (0.10.3)
65
+ coderay (~> 1.1.0)
66
+ method_source (~> 0.8.1)
67
+ slop (~> 3.4)
68
+ pry-doc (0.8.0)
69
+ pry (~> 0.9)
70
+ yard (~> 0.8)
71
+ pry-nav (0.2.4)
72
+ pry (>= 0.9.10, < 0.11.0)
73
+ rack (1.6.4)
74
+ rack-test (0.6.3)
75
+ rack (>= 1.0)
76
+ rails-deprecated_sanitizer (1.0.3)
77
+ activesupport (>= 4.2.0.alpha)
78
+ rails-dom-testing (1.0.7)
79
+ activesupport (>= 4.2.0.beta, < 5.0)
80
+ nokogiri (~> 1.6.0)
81
+ rails-deprecated_sanitizer (>= 1.0.1)
82
+ rails-html-sanitizer (1.0.2)
83
+ loofah (~> 2.0)
84
+ railties (4.2.3)
85
+ actionpack (= 4.2.3)
86
+ activesupport (= 4.2.3)
87
+ rake (>= 0.8.7)
88
+ thor (>= 0.18.1, < 2.0)
89
+ rainbow (2.0.0)
90
+ rake (10.4.2)
91
+ rspec (3.2.0)
92
+ rspec-core (~> 3.2.0)
93
+ rspec-expectations (~> 3.2.0)
94
+ rspec-mocks (~> 3.2.0)
95
+ rspec-core (3.2.3)
96
+ rspec-support (~> 3.2.0)
97
+ rspec-expectations (3.2.1)
98
+ diff-lcs (>= 1.2.0, < 2.0)
99
+ rspec-support (~> 3.2.0)
100
+ rspec-mocks (3.2.1)
101
+ diff-lcs (>= 1.2.0, < 2.0)
102
+ rspec-support (~> 3.2.0)
103
+ rspec-support (3.2.2)
104
+ rubocop (0.31.0)
105
+ astrolabe (~> 1.3)
106
+ parser (>= 2.2.2.1, < 3.0)
107
+ powerpack (~> 0.1)
108
+ rainbow (>= 1.99.1, < 3.0)
109
+ ruby-progressbar (~> 1.4)
110
+ ruby-progressbar (1.7.5)
111
+ shoulda-matchers (3.0.0)
112
+ activesupport (>= 4.0.0)
113
+ slop (3.6.0)
114
+ standalone_migrations (4.0.2)
115
+ activerecord (~> 4.2.0)
116
+ railties (~> 4.2.0)
117
+ rake (~> 10.0)
118
+ thor (0.19.1)
119
+ thread_safe (0.3.5)
120
+ tzinfo (1.2.2)
121
+ thread_safe (~> 0.1)
122
+ yard (0.8.7.6)
123
+
124
+ PLATFORMS
125
+ ruby
126
+
127
+ DEPENDENCIES
128
+ actionpack (~> 4.2.1)
129
+ activerecord (= 4.2.3)
130
+ appraisal
131
+ awesome_print
132
+ bundler (~> 1.9)
133
+ database_cleaner
134
+ jsonb_accessor!
135
+ pry
136
+ pry-doc
137
+ pry-nav
138
+ rake (~> 10.0)
139
+ rspec (~> 3.2.0)
140
+ rubocop (= 0.31.0)
141
+ shoulda-matchers
142
+ standalone_migrations
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "4.2.4"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jsonb_accessor (0.3.1)
5
+ activerecord (>= 4.2.1)
6
+ pg
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.2.4)
12
+ actionview (= 4.2.4)
13
+ activesupport (= 4.2.4)
14
+ rack (~> 1.6)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (4.2.4)
19
+ activesupport (= 4.2.4)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ activemodel (4.2.4)
25
+ activesupport (= 4.2.4)
26
+ builder (~> 3.1)
27
+ activerecord (4.2.4)
28
+ activemodel (= 4.2.4)
29
+ activesupport (= 4.2.4)
30
+ arel (~> 6.0)
31
+ activesupport (4.2.4)
32
+ i18n (~> 0.7)
33
+ json (~> 1.7, >= 1.7.7)
34
+ minitest (~> 5.1)
35
+ thread_safe (~> 0.3, >= 0.3.4)
36
+ tzinfo (~> 1.1)
37
+ appraisal (2.1.0)
38
+ bundler
39
+ rake
40
+ thor (>= 0.14.0)
41
+ arel (6.0.3)
42
+ ast (2.1.0)
43
+ astrolabe (1.3.1)
44
+ parser (~> 2.2)
45
+ awesome_print (1.6.1)
46
+ builder (3.2.2)
47
+ coderay (1.1.0)
48
+ database_cleaner (1.5.1)
49
+ diff-lcs (1.2.5)
50
+ erubis (2.7.0)
51
+ i18n (0.7.0)
52
+ json (1.8.3)
53
+ loofah (2.0.3)
54
+ nokogiri (>= 1.5.9)
55
+ method_source (0.8.2)
56
+ mini_portile (0.6.2)
57
+ minitest (5.8.1)
58
+ nokogiri (1.6.6.2)
59
+ mini_portile (~> 0.6.0)
60
+ parser (2.2.3.0)
61
+ ast (>= 1.1, < 3.0)
62
+ pg (0.18.3)
63
+ powerpack (0.1.1)
64
+ pry (0.10.3)
65
+ coderay (~> 1.1.0)
66
+ method_source (~> 0.8.1)
67
+ slop (~> 3.4)
68
+ pry-doc (0.8.0)
69
+ pry (~> 0.9)
70
+ yard (~> 0.8)
71
+ pry-nav (0.2.4)
72
+ pry (>= 0.9.10, < 0.11.0)
73
+ rack (1.6.4)
74
+ rack-test (0.6.3)
75
+ rack (>= 1.0)
76
+ rails-deprecated_sanitizer (1.0.3)
77
+ activesupport (>= 4.2.0.alpha)
78
+ rails-dom-testing (1.0.7)
79
+ activesupport (>= 4.2.0.beta, < 5.0)
80
+ nokogiri (~> 1.6.0)
81
+ rails-deprecated_sanitizer (>= 1.0.1)
82
+ rails-html-sanitizer (1.0.2)
83
+ loofah (~> 2.0)
84
+ railties (4.2.4)
85
+ actionpack (= 4.2.4)
86
+ activesupport (= 4.2.4)
87
+ rake (>= 0.8.7)
88
+ thor (>= 0.18.1, < 2.0)
89
+ rainbow (2.0.0)
90
+ rake (10.4.2)
91
+ rspec (3.2.0)
92
+ rspec-core (~> 3.2.0)
93
+ rspec-expectations (~> 3.2.0)
94
+ rspec-mocks (~> 3.2.0)
95
+ rspec-core (3.2.3)
96
+ rspec-support (~> 3.2.0)
97
+ rspec-expectations (3.2.1)
98
+ diff-lcs (>= 1.2.0, < 2.0)
99
+ rspec-support (~> 3.2.0)
100
+ rspec-mocks (3.2.1)
101
+ diff-lcs (>= 1.2.0, < 2.0)
102
+ rspec-support (~> 3.2.0)
103
+ rspec-support (3.2.2)
104
+ rubocop (0.31.0)
105
+ astrolabe (~> 1.3)
106
+ parser (>= 2.2.2.1, < 3.0)
107
+ powerpack (~> 0.1)
108
+ rainbow (>= 1.99.1, < 3.0)
109
+ ruby-progressbar (~> 1.4)
110
+ ruby-progressbar (1.7.5)
111
+ shoulda-matchers (3.0.0)
112
+ activesupport (>= 4.0.0)
113
+ slop (3.6.0)
114
+ standalone_migrations (4.0.2)
115
+ activerecord (~> 4.2.0)
116
+ railties (~> 4.2.0)
117
+ rake (~> 10.0)
118
+ thor (0.19.1)
119
+ thread_safe (0.3.5)
120
+ tzinfo (1.2.2)
121
+ thread_safe (~> 0.1)
122
+ yard (0.8.7.6)
123
+
124
+ PLATFORMS
125
+ ruby
126
+
127
+ DEPENDENCIES
128
+ actionpack (~> 4.2.1)
129
+ activerecord (= 4.2.4)
130
+ appraisal
131
+ awesome_print
132
+ bundler (~> 1.9)
133
+ database_cleaner
134
+ jsonb_accessor!
135
+ pry
136
+ pry-doc
137
+ pry-nav
138
+ rake (~> 10.0)
139
+ rspec (~> 3.2.0)
140
+ rubocop (= 0.31.0)
141
+ shoulda-matchers
142
+ standalone_migrations
@@ -4,20 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require "jsonb_accessor/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "jsonb_accessor"
8
- spec.version = JsonbAccessor::VERSION
9
- spec.authors = ["Michael Crismali", "Joe Hirn"]
10
- spec.email = ["michael.crismali@gmail.com", "joe@devmynd.com"]
7
+ spec.name = "jsonb_accessor"
8
+ spec.version = JsonbAccessor::VERSION
9
+ spec.authors = ["Michael Crismali", "Joe Hirn"]
10
+ spec.email = ["michael.crismali@gmail.com", "joe@devmynd.com"]
11
11
 
12
- spec.summary = %q{Adds typed jsonb backed fields to your ActiveRecord models.}
13
- spec.description = %q{Adds typed jsonb backed fields to your ActiveRecord models.}
14
- spec.homepage = "https://github.com/devmynd/jsonb_accessor"
15
- spec.license = "MIT"
12
+ spec.summary = %q{Adds typed jsonb backed fields to your ActiveRecord models.}
13
+ spec.description = %q{Adds typed jsonb backed fields to your ActiveRecord models.}
14
+ spec.homepage = "https://github.com/devmynd/jsonb_accessor"
15
+ spec.license = "MIT"
16
+ spec.required_ruby_version = "~> 2.0"
16
17
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
21
22
 
22
23
  spec.add_dependency "activerecord", ">= 4.2.1"
23
24
  spec.add_dependency "pg"
@@ -38,9 +38,11 @@ module JsonbAccessor
38
38
 
39
39
  def _initialize_jsonb_attrs(jsonb_attribute, fields_map, jsonb_attribute_initialization_method_name)
40
40
  define_method(jsonb_attribute_initialization_method_name) do
41
- jsonb_attribute_hash = send(jsonb_attribute) || {}
42
- fields_map.names.each do |field|
43
- send("#{field}=", jsonb_attribute_hash[field.to_s])
41
+ if has_attribute?(jsonb_attribute)
42
+ jsonb_attribute_hash = send(jsonb_attribute) || {}
43
+ fields_map.names.each do |field|
44
+ send("#{field}=", jsonb_attribute_hash[field.to_s])
45
+ end
44
46
  end
45
47
  end
46
48
  after_initialize(jsonb_attribute_initialization_method_name)
@@ -1,3 +1,3 @@
1
1
  module JsonbAccessor
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonb_accessor
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
  - Michael Crismali
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-06-18 00:00:00.000000000 Z
12
+ date: 2015-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -250,6 +250,10 @@ files:
250
250
  - gemfiles/activerecord_4.2.1.gemfile.lock
251
251
  - gemfiles/activerecord_4.2.2.gemfile
252
252
  - gemfiles/activerecord_4.2.2.gemfile.lock
253
+ - gemfiles/activerecord_4.2.3.gemfile
254
+ - gemfiles/activerecord_4.2.3.gemfile.lock
255
+ - gemfiles/activerecord_4.2.4.gemfile
256
+ - gemfiles/activerecord_4.2.4.gemfile.lock
253
257
  - jsonb_accessor.gemspec
254
258
  - lib/jsonb_accessor.rb
255
259
  - lib/jsonb_accessor/class_builder.rb
@@ -269,9 +273,9 @@ require_paths:
269
273
  - lib
270
274
  required_ruby_version: !ruby/object:Gem::Requirement
271
275
  requirements:
272
- - - ">="
276
+ - - "~>"
273
277
  - !ruby/object:Gem::Version
274
- version: '0'
278
+ version: '2.0'
275
279
  required_rubygems_version: !ruby/object:Gem::Requirement
276
280
  requirements:
277
281
  - - ">="