rails_core_extensions 0.11.0.beta.11 → 0.12.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
2
  SHA256:
3
- metadata.gz: 5ccb364109694e5146403ee03a9083c0702aa442e8e57a0c7530c7729f74a33b
4
- data.tar.gz: 69b3dcaa3c1b31d2bb896d934bbd173e79f1506b1e1c590fce7a96525bd3a9f7
3
+ metadata.gz: 4e362185defe03c222c8b0d0cf77b3281f0fac38fde27f90ed1273d026bb28d7
4
+ data.tar.gz: 4f91461d5666fdb4ce836c50e11d0808a27da50605f40343e3c0b17cf53e441f
5
5
  SHA512:
6
- metadata.gz: 3cbdd58723a57b2230f74ba5ec42a91256e2ab2152d30c84e271b15cab8a2e910b40adacef32ce48aca90bd372ddddd2cc9a4d0909af04b03942993f4a69af4c
7
- data.tar.gz: c6ad9dd46a34fc8680f681fa19f8b4e412e4df4c90ff167cd126dbb8c6b89d2a4757c01ff235ceb37030ce87165485ef19252a62d649761307ad1e899fadb0b0
6
+ metadata.gz: b73a245c3f1039fed5d0b2246d3b758a452364a114af36972ecfbeef970c426389271b9eac2feab4da7d0147b133532477dea28506f5b9cdb486ab943b396b3d
7
+ data.tar.gz: 101efda04a0f37b08757be11b4e2d89314e99d3e8935de832d550bd0dae4046d3c69eb9ec124c428dd9c62d59341a2f9015fc98d6619ca8a16329818b2613e83
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
@@ -6,7 +6,20 @@ on:
6
6
  - "v*"
7
7
 
8
8
  jobs:
9
+ build:
10
+ name: Build
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ bundler-cache: true
18
+ - run: bundle exec rake
19
+
9
20
  release:
21
+ needs: build
22
+ name: Release
10
23
  runs-on: ubuntu-latest
11
24
  steps:
12
25
  - name: Checkout
@@ -26,6 +39,7 @@ jobs:
26
39
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
40
 
28
41
  publish:
42
+ needs: [build, release]
29
43
  name: Publish
30
44
  runs-on: ubuntu-latest
31
45
 
@@ -1,12 +1,12 @@
1
- name: Build
1
+ name: Build and Test
2
2
  on: [push, pull_request]
3
3
  jobs:
4
4
  test:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
- gemfile: [rails60, rails61]
9
- ruby: ["2.6", "2.7", "3.0"]
8
+ gemfile: [rails60, rails61, rails70]
9
+ ruby: ["2.7", "3.0", "3.1"]
10
10
  runs-on: ubuntu-latest
11
11
  env:
12
12
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
@@ -17,3 +17,8 @@ jobs:
17
17
  ruby-version: ${{ matrix.ruby }}
18
18
  bundler-cache: true
19
19
  - run: bundle exec rake
20
+ - name: Coveralls
21
+ uses: coverallsapp/github-action@master
22
+ with:
23
+ github-token: ${{ secrets.GITHUB_TOKEN }}
24
+ path-to-lcov: coverage/lcov.info
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,9 +1,25 @@
1
1
  # Changelog
2
2
 
3
- ## 0.11.0.beta.11
3
+ ## 0.12.0
4
4
 
5
- * [TT-] Switch from travis to gihthub actions
6
- * [TT-] Add support for Rails 6.1 / Ruby 3
5
+ - [PLAT-183] Ruby 3.1, Rails 7.0 and publish coverage with github action
6
+
7
+ ## 0.11.3
8
+
9
+ - [TT-8647] Fix issue with position_helpers_for active record change
10
+
11
+ ## 0.11.2
12
+
13
+ * [TT-8640] Add dependabot config
14
+
15
+ ## 0.11.1
16
+
17
+ * [TT-8608] Fix broken rake command in the gem publish stage
18
+
19
+ ## 0.11.0
20
+
21
+ * [TT-8608] Switch from travis to gihthub actions
22
+ * [TT-8608] Add support for Rails 6.1 / Ruby 3
7
23
 
8
24
  ## 0.10.0
9
25
 
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
- Rails Core Extensions
2
- ====================
1
+ # Rails Core Extensions
3
2
 
4
- [![Build Status](https://travis-ci.org/sealink/rails_core_extensions.png?branch=master)](https://travis-ci.org/sealink/rails_core_extensions)
3
+ [![Build Status](https://github.com/sealink/rails_core_extensions/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/rails_core_extensions/actions)
5
4
  [![Coverage Status](https://coveralls.io/repos/sealink/rails_core_extensions/badge.png)](https://coveralls.io/r/sealink/rails_core_extensions)
6
- [![Dependency Status](https://gemnasium.com/sealink/rails_core_extensions.png?travis)](https://gemnasium.com/sealink/rails_core_extensions)
7
5
  [![Code Climate](https://codeclimate.com/github/sealink/rails_core_extensions.png)](https://codeclimate.com/github/sealink/rails_core_extensions)
8
6
 
9
7
  # DESCRIPTION
@@ -30,7 +28,7 @@ end
30
28
 
31
29
  config/routes.rb
32
30
 
33
- In Rails 4/5:
31
+ In Rails 6:
34
32
  resources :types do
35
33
  collection
36
34
  post :sort
@@ -42,18 +40,32 @@ You need to submit a collection of objects named the same as the controller.
42
40
 
43
41
  e.g. for the above the params should be:
44
42
 
43
+ ```ruby
45
44
  types_body[]=1
46
45
  types_body[]=3
47
- etc.
46
+ ```
48
47
 
49
48
  Where the value is the id, and the position of submission is the new order, e.g.
50
49
  In the above, the item of id 3 will be updated to position 2
51
50
 
52
51
  If you have scoped sorts, e.g. sorts within categories you also need to pass in 2 params:
53
- * scope (e.g. category_id)
54
- * a variable by that name, e.g. category_id
52
+
53
+ - scope (e.g. category_id)
54
+ - a variable by that name, e.g. category_id
55
55
 
56
56
  So in the above if you want to upgrade category_id 6, you could submit
57
57
  scope=category_id&category_id=6
58
58
 
59
59
  along with type_body[]=7.. for all the types in category 6
60
+
61
+ # RELEASE
62
+
63
+ To publish a new version of this gem the following steps must be taken.
64
+
65
+ - Update the version in the following files
66
+ ```
67
+ CHANGELOG.md
68
+ lib/rails_core_extensions/version.rb
69
+ ```
70
+ - Create a tag using the format v0.1.0
71
+ - Follow build progress in GitHub actions
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => '../'
3
+
4
+ group :development, :test do
5
+ gem 'activerecord', '~> 7.0'
6
+ end
@@ -70,7 +70,7 @@ module ActiveRecordExtensions
70
70
  reload
71
71
  #{collection}.sort_by(&:position).each_with_index do |o, index|
72
72
  if o.position != (index + 1)
73
- o.update(:position, index + 1)
73
+ o.update_attribute(:position, index + 1)
74
74
  end
75
75
  end
76
76
  end
@@ -1,3 +1,3 @@
1
1
  module RailsCoreExtensions
2
- VERSION = '0.11.0.beta.11'
2
+ VERSION = '0.12.0'
3
3
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
+ spec.required_ruby_version = '>= 2.7'
21
22
 
22
23
  spec.add_dependency 'activerecord', ['>= 6.0.0']
23
24
  spec.add_dependency 'actionpack', ['>= 6.0.0']
@@ -27,9 +28,6 @@ Gem::Specification.new do |spec|
27
28
  spec.add_development_dependency 'rspec'
28
29
  spec.add_development_dependency 'activerecord-nulldb-adapter'
29
30
  spec.add_development_dependency 'coverage-kit'
30
- spec.add_development_dependency 'simplecov-rcov'
31
- spec.add_development_dependency 'coveralls'
32
31
  spec.add_development_dependency 'rubocop'
33
32
  spec.add_development_dependency 'sqlite3'
34
- spec.add_development_dependency 'travis'
35
33
  end
@@ -1,5 +1,3 @@
1
- require 'simplecov-rcov'
2
- require 'coveralls'
3
1
  require 'coverage/kit'
4
2
 
5
3
  Coverage::Kit.setup(minimum_coverage: 86.7)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_core_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.beta.11
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Noack
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-01 00:00:00.000000000 Z
12
+ date: 2022-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -109,34 +109,6 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: simplecov-rcov
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: coveralls
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: '0'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: '0'
140
112
  - !ruby/object:Gem::Dependency
141
113
  name: rubocop
142
114
  requirement: !ruby/object:Gem::Requirement
@@ -165,20 +137,6 @@ dependencies:
165
137
  - - ">="
166
138
  - !ruby/object:Gem::Version
167
139
  version: '0'
168
- - !ruby/object:Gem::Dependency
169
- name: travis
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: '0'
175
- type: :development
176
- prerelease: false
177
- version_requirements: !ruby/object:Gem::Requirement
178
- requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- version: '0'
182
140
  description: Set of extensions to core rails libraries.
183
141
  email:
184
142
  - support@travellink.com.au
@@ -186,15 +144,12 @@ executables: []
186
144
  extensions: []
187
145
  extra_rdoc_files: []
188
146
  files:
189
- - ".github/workflows/gem-push.yml"
147
+ - ".github/dependabot.yml"
190
148
  - ".github/workflows/release.yml"
191
149
  - ".github/workflows/ruby.yml"
192
150
  - ".gitignore"
193
- - ".hound.yml"
194
151
  - ".rspec"
195
- - ".ruby-style.yml"
196
152
  - ".ruby-version"
197
- - ".travis.yml"
198
153
  - CHANGELOG.md
199
154
  - Gemfile
200
155
  - LICENSE.txt
@@ -202,6 +157,7 @@ files:
202
157
  - Rakefile
203
158
  - gemfiles/rails60.gemfile
204
159
  - gemfiles/rails61.gemfile
160
+ - gemfiles/rails70.gemfile
205
161
  - lib/rails_core_extensions.rb
206
162
  - lib/rails_core_extensions/action_controller_sortable.rb
207
163
  - lib/rails_core_extensions/action_view_extensions.rb
@@ -248,14 +204,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
248
204
  requirements:
249
205
  - - ">="
250
206
  - !ruby/object:Gem::Version
251
- version: '0'
207
+ version: '2.7'
252
208
  required_rubygems_version: !ruby/object:Gem::Requirement
253
209
  requirements:
254
- - - ">"
210
+ - - ">="
255
211
  - !ruby/object:Gem::Version
256
- version: 1.3.1
212
+ version: '0'
257
213
  requirements: []
258
- rubygems_version: 3.2.3
214
+ rubygems_version: 3.3.3
259
215
  signing_key:
260
216
  specification_version: 4
261
217
  summary: Set of extensions to core rails libraries.
@@ -1,25 +0,0 @@
1
- name: Ruby Gem
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- name: Build + Publish
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/checkout@v2
14
- - uses: ruby/setup-ruby@v1
15
-
16
- - name: Publish to RubyGems
17
- run: |
18
- mkdir -p $HOME/.gem
19
- touch $HOME/.gem/credentials
20
- chmod 0600 $HOME/.gem/credentials
21
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
22
- gem build *.gemspec
23
- gem push *.gem
24
- env:
25
- GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/.hound.yml DELETED
@@ -1,2 +0,0 @@
1
- ruby:
2
- config_file: .ruby-style.yml
data/.ruby-style.yml DELETED
@@ -1,217 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - "vendor/**/*"
4
- - "db/schema.rb"
5
- UseCache: false
6
- Style/CollectionMethods:
7
- Description: Preferred collection methods.
8
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
9
- Enabled: true
10
- PreferredMethods:
11
- collect: map
12
- collect!: map!
13
- find: detect
14
- find_all: select
15
- reduce: inject
16
- Layout/DotPosition:
17
- Description: Checks the position of the dot in multi-line method calls.
18
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
19
- Enabled: true
20
- EnforcedStyle: trailing
21
- SupportedStyles:
22
- - leading
23
- - trailing
24
- Naming/FileName:
25
- Description: Use snake_case for source file names.
26
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
27
- Enabled: false
28
- Exclude: []
29
- Style/GuardClause:
30
- Description: Check for conditionals that can be replaced with guard clauses
31
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
32
- Enabled: false
33
- MinBodyLength: 1
34
- Style/IfUnlessModifier:
35
- Description: Favor modifier if/unless usage when you have a single-line body.
36
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
37
- Enabled: false
38
- Style/OptionHash:
39
- Description: Don't use option hashes when you can use keyword arguments.
40
- Enabled: false
41
- Style/PercentLiteralDelimiters:
42
- Description: Use `%`-literal delimiters consistently
43
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
44
- Enabled: false
45
- PreferredDelimiters:
46
- "%": "()"
47
- "%i": "()"
48
- "%q": "()"
49
- "%Q": "()"
50
- "%r": "{}"
51
- "%s": "()"
52
- "%w": "()"
53
- "%W": "()"
54
- "%x": "()"
55
- Naming/PredicateName:
56
- Description: Check the names of predicate methods.
57
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
58
- Enabled: true
59
- NamePrefix:
60
- - is_
61
- - has_
62
- - have_
63
- NamePrefixBlacklist:
64
- - is_
65
- Exclude:
66
- - spec/**/*
67
- Style/RaiseArgs:
68
- Description: Checks the arguments passed to raise/fail.
69
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
70
- Enabled: false
71
- EnforcedStyle: exploded
72
- SupportedStyles:
73
- - compact
74
- - exploded
75
- Style/SignalException:
76
- Description: Checks for proper usage of fail and raise.
77
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
78
- Enabled: false
79
- EnforcedStyle: semantic
80
- SupportedStyles:
81
- - only_raise
82
- - only_fail
83
- - semantic
84
- Style/SingleLineBlockParams:
85
- Description: Enforces the names of some block params.
86
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
87
- Enabled: false
88
- Methods:
89
- - reduce:
90
- - a
91
- - e
92
- - inject:
93
- - a
94
- - e
95
- Style/SingleLineMethods:
96
- Description: Avoid single-line methods.
97
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
98
- Enabled: false
99
- AllowIfMethodIsEmpty: true
100
- Style/TrailingCommaInArguments:
101
- Description: Checks for trailing comma in argument lists.
102
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
103
- EnforcedStyleForMultiline: comma
104
- Enabled: true
105
- Style/TrailingCommaInArrayLiteral:
106
- Description: Checks for trailing comma in array and hash literals.
107
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
108
- EnforcedStyleForMultiline: comma
109
- Enabled: true
110
- Metrics/AbcSize:
111
- Description: A calculated magnitude based on number of assignments, branches, and
112
- conditions.
113
- Enabled: false
114
- Max: 15
115
- Metrics/ClassLength:
116
- Description: Avoid classes longer than 100 lines of code.
117
- Enabled: false
118
- CountComments: false
119
- Max: 100
120
- Metrics/ModuleLength:
121
- CountComments: false
122
- Max: 100
123
- Description: Avoid modules longer than 100 lines of code.
124
- Enabled: false
125
- Metrics/CyclomaticComplexity:
126
- Description: A complexity metric that is strongly correlated to the number of test
127
- cases needed to validate a method.
128
- Enabled: false
129
- Max: 6
130
- Metrics/MethodLength:
131
- Description: Avoid methods longer than 10 lines of code.
132
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
133
- Enabled: false
134
- CountComments: false
135
- Max: 10
136
- Metrics/ParameterLists:
137
- Description: Avoid parameter lists longer than three or four parameters.
138
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
139
- Enabled: false
140
- Max: 5
141
- CountKeywordArgs: true
142
- Metrics/PerceivedComplexity:
143
- Description: A complexity metric geared towards measuring complexity for a human
144
- reader.
145
- Enabled: false
146
- Max: 7
147
- Lint/AssignmentInCondition:
148
- Description: Don't use assignment in conditions.
149
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
150
- Enabled: false
151
- AllowSafeAssignment: true
152
- Style/InlineComment:
153
- Description: Avoid inline comments.
154
- Enabled: false
155
- Naming/AccessorMethodName:
156
- Description: Check the naming of accessor methods for get_/set_.
157
- Enabled: false
158
- Style/Alias:
159
- Description: Use alias_method instead of alias.
160
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
161
- Enabled: false
162
- Style/Documentation:
163
- Description: Document classes and non-namespace modules.
164
- Enabled: false
165
- Style/DoubleNegation:
166
- Description: Checks for uses of double negation (!!).
167
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
168
- Enabled: false
169
- Style/EachWithObject:
170
- Description: Prefer `each_with_object` over `inject` or `reduce`.
171
- Enabled: false
172
- Style/EmptyLiteral:
173
- Description: Prefer literals to Array.new/Hash.new/String.new.
174
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
175
- Enabled: false
176
- Style/ModuleFunction:
177
- Description: Checks for usage of `extend self` in modules.
178
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
179
- Enabled: false
180
- Style/OneLineConditional:
181
- Description: Favor the ternary operator(?:) over if/then/else/end constructs.
182
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
183
- Enabled: false
184
- Style/PerlBackrefs:
185
- Description: Avoid Perl-style regex back references.
186
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
187
- Enabled: false
188
- Style/Send:
189
- Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
190
- may overlap with existing methods.
191
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
192
- Enabled: false
193
- Style/SpecialGlobalVars:
194
- Description: Avoid Perl-style global variables.
195
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
196
- Enabled: false
197
- Style/VariableInterpolation:
198
- Description: Don't interpolate global, instance and class variables directly in
199
- strings.
200
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
201
- Enabled: false
202
- Style/WhenThen:
203
- Description: Use when x then ... for one-line cases.
204
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
205
- Enabled: false
206
- Lint/EachWithObjectArgument:
207
- Description: Check for immutable argument given to each_with_object.
208
- Enabled: true
209
- Lint/HandleExceptions:
210
- Description: Don't suppress exception.
211
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
212
- Enabled: false
213
- Lint/LiteralInInterpolation:
214
- Description: Checks for literals used in interpolation.
215
- Enabled: false
216
- Style/FrozenStringLiteralComment:
217
- Enabled: false
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6
4
- - 2.7
5
-
6
- script: "bundle exec rake spec"
7
- gemfile:
8
- - gemfiles/rails6.gemfile
9
- sudo: false
10
- cache: bundler
11
- before_install:
12
- - gem update --system
13
- - gem install bundler