parentry 1.2.0 → 1.3.0

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
- SHA1:
3
- metadata.gz: 359ac207e141ac7b492e7644d0e887c48de78511
4
- data.tar.gz: 09e8ad1f84b86254fef7a2ff1384f063c040083f
2
+ SHA256:
3
+ metadata.gz: 150d028e7c67a5ba486cc8cb1ce84dc0ca3eaf44aca39574aadac17e4547538e
4
+ data.tar.gz: 57b4a9473187ae9f9f207ad6fb2e09eab953db324eaddbb32f33265ace8b4cdc
5
5
  SHA512:
6
- metadata.gz: d82ae9d62dcb8aff2ee38c54b63c5e4206d33c7574f6e8c846c7a23788939828480f0a197d4868af653bc3b8b9e9cd461888f598eea8fc2b25858d7d2ca9929a
7
- data.tar.gz: caf3b3d828229f236756ae8605a2a01b8510d1e64399d1e0c46851f5352ede3655cbfe789336df5bc67af240cfdf37271c972b439d66c9996b2b1db901d3f349
6
+ metadata.gz: 6a3de9008810d9930a6f7243a6dcb1533af06df80c864c9bf3c81ba1d4a0b6330c693122e139cb441811c7be14f9506468657d44c3888234ce77df2faf2f3e62
7
+ data.tar.gz: b95e3f69a71e6d4151d093dcf7395e641a9e02089c298681e85c60d09e5a1e179affeb383359b585fc521876832ef091036bd67474a062d885bab3e20329543f
@@ -1,12 +1,25 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.5
4
- - 2.3.4
5
- - 2.4.1
3
+ - 2.5.3
4
+ - 2.6.3
6
5
  env:
7
- - STRATEGY=array
8
- - STRATEGY=ltree
6
+ global:
7
+ - CC_TEST_REPORTER_ID=4a8875ec1a4bd9cc55d9fe48779be866f90ac331155d039fa3d13b2a61b4fa9f
8
+ matrix:
9
+ - STRATEGY=array
10
+ - STRATEGY=ltree
11
+ before_script:
12
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
13
+ - chmod +x ./cc-test-reporter
14
+ - ./cc-test-reporter before-build
9
15
  gemfile:
10
16
  - gemfiles/activerecord_5.1.5.gemfile
11
17
  - gemfiles/activerecord_5.2.0.gemfile
18
+ - gemfiles/activerecord_6.0.0.gemfile
12
19
  before_install: gem install bundler -v 1.10.6
20
+ after_script:
21
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
22
+ addons:
23
+ postgresql: "9.6"
24
+ services:
25
+ - postgresql
data/Appraisals CHANGED
@@ -5,3 +5,7 @@ end
5
5
  appraise 'activerecord-5.2.0' do
6
6
  gem 'activerecord', '5.2.0'
7
7
  end
8
+
9
+ appraise 'activerecord-6.0.0' do
10
+ gem 'activerecord', '6.0.0'
11
+ end
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  [![Build Status](https://travis-ci.org/hasghari/parentry.svg?branch=master)](https://travis-ci.org/hasghari/parentry)
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/cc7180328fffcbdea2bb/maintainability)](https://codeclimate.com/github/hasghari/parentry/maintainability)
3
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/cc7180328fffcbdea2bb/test_coverage)](https://codeclimate.com/github/hasghari/parentry/test_coverage)
2
4
 
3
5
  # Parentry
4
6
 
@@ -24,11 +26,26 @@ Or install it yourself as:
24
26
 
25
27
  ## Usage
26
28
 
27
- This gem requires 2 columns for each table: `parentry` and `parent_id`. A sample migration would look like:
29
+ This gem requires 2 columns for each table: `parentry` and `parent_id`, and can leverage either the `ltree` postgresql extension, or else postgres `array` columns. A sample migration would look like:
28
30
 
29
31
  ```ruby
30
- add_column :my_table, :parentry, :ltree
32
+ enable_extension 'ltree' # ltree is not turned on by default; skip if you use the array strategy
33
+
31
34
  add_column :my_table, :parent_id, :integer
35
+
36
+ add_column :my_table, :parentry, :ltree
37
+ add_column :my_table, :parentry_depth, :integer, default: 0 # optional
38
+
39
+ add_index :my_table, :parentry, using: :gist
40
+ ```
41
+
42
+ ```ruby
43
+ class MyTable < ApplicationRecord
44
+ include Parentry
45
+ parentry cache_depth: true
46
+ # to change strategy to array, and avoid dependency on ltree
47
+ # parentry strategy: :array
48
+ end
32
49
  ```
33
50
 
34
51
  ## Contributing
@@ -2,7 +2,7 @@ PATH
2
2
  remote: ..
3
3
  specs:
4
4
  parentry (1.2.0)
5
- activerecord (>= 5.1, < 6.0)
5
+ activerecord (>= 5.1, < 6.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -38,7 +38,7 @@ GEM
38
38
  arel (8.0.0)
39
39
  builder (3.2.3)
40
40
  coderay (1.1.2)
41
- combustion (0.9.0)
41
+ combustion (1.1.1)
42
42
  activesupport (>= 3.0.0)
43
43
  railties (>= 3.0.0)
44
44
  thor (>= 0.14.6)
@@ -46,9 +46,11 @@ GEM
46
46
  crass (1.0.3)
47
47
  database_cleaner (1.6.2)
48
48
  diff-lcs (1.3)
49
+ docile (1.3.0)
49
50
  erubi (1.7.1)
50
51
  i18n (0.9.5)
51
52
  concurrent-ruby (~> 1.0)
53
+ json (2.1.0)
52
54
  loofah (2.2.2)
53
55
  crass (~> 1.0.2)
54
56
  nokogiri (>= 1.5.9)
@@ -93,6 +95,11 @@ GEM
93
95
  rspec-mocks (~> 3.7.0)
94
96
  rspec-support (~> 3.7.0)
95
97
  rspec-support (3.7.1)
98
+ simplecov (0.16.1)
99
+ docile (~> 1.1)
100
+ json (>= 1.8, < 3)
101
+ simplecov-html (~> 0.10.0)
102
+ simplecov-html (0.10.2)
96
103
  thor (0.20.0)
97
104
  thread_safe (0.3.6)
98
105
  tzinfo (1.2.5)
@@ -105,13 +112,14 @@ DEPENDENCIES
105
112
  activerecord (= 5.1.5)
106
113
  appraisal
107
114
  bundler (~> 1.10)
108
- combustion (= 0.9.0)
115
+ combustion (~> 1.1)
109
116
  database_cleaner (~> 1.6)
110
117
  parentry!
111
118
  pg (~> 0.21)
112
119
  pry (~> 0.10)
113
120
  rake (~> 10.0)
114
121
  rspec-rails (~> 3.7)
122
+ simplecov (~> 0.16)
115
123
 
116
124
  BUNDLED WITH
117
- 1.14.6
125
+ 1.17.2
@@ -2,7 +2,7 @@ PATH
2
2
  remote: ..
3
3
  specs:
4
4
  parentry (1.2.0)
5
- activerecord (>= 5.1, < 6.0)
5
+ activerecord (>= 5.1, < 6.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -38,7 +38,7 @@ GEM
38
38
  arel (9.0.0)
39
39
  builder (3.2.3)
40
40
  coderay (1.1.2)
41
- combustion (0.9.0)
41
+ combustion (1.1.1)
42
42
  activesupport (>= 3.0.0)
43
43
  railties (>= 3.0.0)
44
44
  thor (>= 0.14.6)
@@ -46,9 +46,11 @@ GEM
46
46
  crass (1.0.4)
47
47
  database_cleaner (1.6.2)
48
48
  diff-lcs (1.3)
49
+ docile (1.3.0)
49
50
  erubi (1.7.1)
50
51
  i18n (1.0.0)
51
52
  concurrent-ruby (~> 1.0)
53
+ json (2.1.0)
52
54
  loofah (2.2.2)
53
55
  crass (~> 1.0.2)
54
56
  nokogiri (>= 1.5.9)
@@ -93,6 +95,11 @@ GEM
93
95
  rspec-mocks (~> 3.7.0)
94
96
  rspec-support (~> 3.7.0)
95
97
  rspec-support (3.7.1)
98
+ simplecov (0.16.1)
99
+ docile (~> 1.1)
100
+ json (>= 1.8, < 3)
101
+ simplecov-html (~> 0.10.0)
102
+ simplecov-html (0.10.2)
96
103
  thor (0.20.0)
97
104
  thread_safe (0.3.6)
98
105
  tzinfo (1.2.5)
@@ -105,13 +112,14 @@ DEPENDENCIES
105
112
  activerecord (= 5.2.0)
106
113
  appraisal
107
114
  bundler (~> 1.10)
108
- combustion (= 0.9.0)
115
+ combustion (~> 1.1)
109
116
  database_cleaner (~> 1.6)
110
117
  parentry!
111
118
  pg (~> 0.21)
112
119
  pry (~> 0.10)
113
120
  rake (~> 10.0)
114
121
  rspec-rails (~> 3.7)
122
+ simplecov (~> 0.16)
115
123
 
116
124
  BUNDLED WITH
117
- 1.14.6
125
+ 1.17.2
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "activerecord", "6.0.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,125 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ parentry (1.2.0)
5
+ activerecord (>= 5.1, < 6.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (6.0.0)
11
+ actionview (= 6.0.0)
12
+ activesupport (= 6.0.0)
13
+ rack (~> 2.0)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
+ actionview (6.0.0)
18
+ activesupport (= 6.0.0)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
+ activemodel (6.0.0)
24
+ activesupport (= 6.0.0)
25
+ activerecord (6.0.0)
26
+ activemodel (= 6.0.0)
27
+ activesupport (= 6.0.0)
28
+ activesupport (6.0.0)
29
+ concurrent-ruby (~> 1.0, >= 1.0.2)
30
+ i18n (>= 0.7, < 2)
31
+ minitest (~> 5.1)
32
+ tzinfo (~> 1.1)
33
+ zeitwerk (~> 2.1, >= 2.1.8)
34
+ appraisal (2.2.0)
35
+ bundler
36
+ rake
37
+ thor (>= 0.14.0)
38
+ builder (3.2.3)
39
+ coderay (1.1.2)
40
+ combustion (1.1.1)
41
+ activesupport (>= 3.0.0)
42
+ railties (>= 3.0.0)
43
+ thor (>= 0.14.6)
44
+ concurrent-ruby (1.1.5)
45
+ crass (1.0.4)
46
+ database_cleaner (1.7.0)
47
+ diff-lcs (1.3)
48
+ docile (1.3.2)
49
+ erubi (1.8.0)
50
+ i18n (1.6.0)
51
+ concurrent-ruby (~> 1.0)
52
+ json (2.2.0)
53
+ loofah (2.2.3)
54
+ crass (~> 1.0.2)
55
+ nokogiri (>= 1.5.9)
56
+ method_source (0.9.2)
57
+ mini_portile2 (2.4.0)
58
+ minitest (5.11.3)
59
+ nokogiri (1.10.4)
60
+ mini_portile2 (~> 2.4.0)
61
+ pg (0.21.0)
62
+ pry (0.12.2)
63
+ coderay (~> 1.1.0)
64
+ method_source (~> 0.9.0)
65
+ rack (2.0.7)
66
+ rack-test (1.1.0)
67
+ rack (>= 1.0, < 3)
68
+ rails-dom-testing (2.0.3)
69
+ activesupport (>= 4.2.0)
70
+ nokogiri (>= 1.6)
71
+ rails-html-sanitizer (1.2.0)
72
+ loofah (~> 2.2, >= 2.2.2)
73
+ railties (6.0.0)
74
+ actionpack (= 6.0.0)
75
+ activesupport (= 6.0.0)
76
+ method_source
77
+ rake (>= 0.8.7)
78
+ thor (>= 0.20.3, < 2.0)
79
+ rake (10.5.0)
80
+ rspec-core (3.8.2)
81
+ rspec-support (~> 3.8.0)
82
+ rspec-expectations (3.8.4)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.8.0)
85
+ rspec-mocks (3.8.1)
86
+ diff-lcs (>= 1.2.0, < 2.0)
87
+ rspec-support (~> 3.8.0)
88
+ rspec-rails (3.8.2)
89
+ actionpack (>= 3.0)
90
+ activesupport (>= 3.0)
91
+ railties (>= 3.0)
92
+ rspec-core (~> 3.8.0)
93
+ rspec-expectations (~> 3.8.0)
94
+ rspec-mocks (~> 3.8.0)
95
+ rspec-support (~> 3.8.0)
96
+ rspec-support (3.8.2)
97
+ simplecov (0.17.0)
98
+ docile (~> 1.1)
99
+ json (>= 1.8, < 3)
100
+ simplecov-html (~> 0.10.0)
101
+ simplecov-html (0.10.2)
102
+ thor (0.20.3)
103
+ thread_safe (0.3.6)
104
+ tzinfo (1.2.5)
105
+ thread_safe (~> 0.1)
106
+ zeitwerk (2.1.9)
107
+
108
+ PLATFORMS
109
+ ruby
110
+
111
+ DEPENDENCIES
112
+ activerecord (= 6.0.0)
113
+ appraisal
114
+ bundler (~> 1.10)
115
+ combustion (~> 1.1)
116
+ database_cleaner (~> 1.6)
117
+ parentry!
118
+ pg (~> 0.21)
119
+ pry (~> 0.10)
120
+ rake (~> 10.0)
121
+ rspec-rails (~> 3.7)
122
+ simplecov (~> 0.16)
123
+
124
+ BUNDLED WITH
125
+ 1.17.2
@@ -1,3 +1,3 @@
1
1
  module Parentry
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -16,13 +16,14 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_dependency 'activerecord', '>= 5.1', '< 6.0'
19
+ spec.add_dependency 'activerecord', '>= 5.1', '< 6.1'
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.10'
22
22
  spec.add_development_dependency 'rake', '~> 10.0'
23
23
  spec.add_development_dependency 'rspec-rails', '~> 3.7'
24
24
  spec.add_development_dependency 'pg', '~> 0.21'
25
- spec.add_development_dependency 'combustion', '0.9.0'
25
+ spec.add_development_dependency 'combustion', '~> 1.1'
26
26
  spec.add_development_dependency 'database_cleaner', '~> 1.6'
27
27
  spec.add_development_dependency 'pry', '~> 0.10'
28
+ spec.add_development_dependency 'simplecov', '~> 0.16'
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamed Asghari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-14 00:00:00.000000000 Z
11
+ date: 2019-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.0'
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.0'
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -90,16 +90,16 @@ dependencies:
90
90
  name: combustion
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '='
93
+ - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.9.0
95
+ version: '1.1'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '='
100
+ - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 0.9.0
102
+ version: '1.1'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: database_cleaner
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0.10'
131
+ - !ruby/object:Gem::Dependency
132
+ name: simplecov
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '0.16'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '0.16'
131
145
  description:
132
146
  email:
133
147
  - hasghari@gmail.com
@@ -150,6 +164,8 @@ files:
150
164
  - gemfiles/activerecord_5.1.5.gemfile.lock
151
165
  - gemfiles/activerecord_5.2.0.gemfile
152
166
  - gemfiles/activerecord_5.2.0.gemfile.lock
167
+ - gemfiles/activerecord_6.0.0.gemfile
168
+ - gemfiles/activerecord_6.0.0.gemfile.lock
153
169
  - lib/parentry.rb
154
170
  - lib/parentry/class_methods.rb
155
171
  - lib/parentry/instance_methods.rb
@@ -182,8 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
198
  - !ruby/object:Gem::Version
183
199
  version: '0'
184
200
  requirements: []
185
- rubyforge_project:
186
- rubygems_version: 2.6.13
201
+ rubygems_version: 3.0.3
187
202
  signing_key:
188
203
  specification_version: 4
189
204
  summary: ActiveRecord adapter for the Postgres ltree module