Skip to content

Commit e406a56

Browse files
committed
Fix canonical gem root:
- Correct script.build: "NODE_PATH=\"$(bundle show 'pagy')/javascripts\" - Move pagy.gemspec inside the gem root dir - Remove rake:manifest gem
1 parent e782ceb commit e406a56

File tree

13 files changed

+36
-148
lines changed

13 files changed

+36
-148
lines changed

.github/gemfiles/default

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ gem 'oj', require: false # false is for testing with or without it
1010
gem 'rack'
1111
gem 'rackup'
1212
gem 'rake'
13-
gem 'rake-manifest'
1413

1514
group :test do
1615
gem 'activesupport'
@@ -29,6 +28,4 @@ group :apps do
2928
gem 'puma'
3029
gem 'sinatra'
3130
gem 'sinatra-contrib'
32-
# gem 'slim'
33-
# gem 'haml'
3431
end

.github/workflows/pagy-ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ jobs:
4747
ruby-version: ${{ matrix.ruby-version }}
4848
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
4949

50-
- name: Check gem manifest
51-
run: bundle exec rake manifest:check
52-
5350
- name: Check Rubocop compliance
5451
run: bundle exec rubocop --format github
5552

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/.bundle/
1010
/coverage/
1111
node_modules/
12-
/pkg/
12+
/gem/pkg/
1313
/tmp/
1414
pnpm
1515
.pnpm-debug.log

CHANGELOG.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ icon: versions-24
66

77
## ⚠ WARNING
88

9-
We may drop pagy's less used CSS extras.
9+
We may drop pagy's less used CSS extras.
1010

1111
If you wish to keep them alive, please, [vote here](https://github.com/ddnexus/pagy/discussions/categories/survey).
1212

@@ -30,7 +30,8 @@ None
3030

3131
## Version 8.0.1
3232

33-
- Reorganize the gem root dir: it was the lib dir (containing everything), now is the gem dir (containing lib and everything else).
33+
- Reorganize the gem root dir: it was the lib dir (containing everything), now is the gem dir (containing lib and everything
34+
else).
3435
- Fix broken link in README
3536

3637
## Version 8.0.0
@@ -44,28 +45,35 @@ None
4445
- The `item_i18n_key` has been removed: pass the interpolated/pluralized value as the `item_name:` argument
4546
- The `link_extra:` has been removed: its cumulative mechanism was confusing and error prone. The `:anchor_string` pagy
4647
variable substitutes it, however it's not an helper argument anymore, so you can assign it as the `DEFAULT[:anchor_string]`
47-
and/or pass it as any other pagy variable at object construction. (See [customize the link attributes](https://ddnexus.github.io/pagy/docs/how-to/#customize-the-link-attributes))
48-
- HTML structure, classes and internal methods have been changed: they may break your views if you used custom stylesheets,
48+
and/or pass it as any other pagy variable at object construction. (
49+
See [customize the link attributes](https://ddnexus.github.io/pagy/docs/how-to/#customize-the-link-attributes))
50+
- HTML structure, classes and internal methods have been changed: they may break your views if you used custom stylesheets,
4951
templates or helper overrides. See the complete changes below if you notice any cosmetic changes or get some exception.
50-
- The `navs` and `support` extras has been merged into the new [pagy extra](https://ddnexus.github.io/pagy/docs/extras/pagy).
51-
Search for `"extra/navs"` and
52+
- The `navs` and `support` extras has been merged into the new [pagy extra](https://ddnexus.github.io/pagy/docs/extras/pagy).
53+
Search for `"extra/navs"` and
5254
`"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both)
53-
- The build path for javascript builders has moved from the `lib` to the `gem` dir so the correct setup in `package.json` is:
54-
`build: "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"`
55+
- The build path for javascript builders has been updated to the canonical paths for gems, and has moved from the `lib` to
56+
the gem root. Notice that the correct setup in `package json` was still wrongly wrapped in the `gem` dir for 8.0.0-8.0.1, and it
57+
has finally been fixed in 8.0.2 (sorry for that):
58+
- 8.0.0-8.0.1 only: `build: "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"`
59+
- 8.0.2+: `build: "NODE_PATH=\"$(bundle show 'pagy')/javascripts\" <your original command>"`
5560

5661
### Changes
5762

58-
- Streamlined HTML and CSS helper structure. You may want to look at the actual output by running the [pagy demo](https://ddnexus.github.io/pagy/playground.md#3-demo-app)
63+
- Streamlined HTML and CSS helper structure. You may want to look at the actual output by running
64+
the [pagy demo](https://ddnexus.github.io/pagy/playground.md#3-demo-app)
5965
- The `pagy_nav` and `pagy_nav_js` helpers output a series of `a` tags inside a wrapper `nav` tag (nothing else)
60-
- The disabled links are so because they are missing the `href` attributes. (They also have the `role="link"` and `aria-disabled="true"` attributes)
66+
- The disabled links are so because they are missing the `href` attributes. (They also have the `role="link"`
67+
and `aria-disabled="true"` attributes)
6168
- The `current` and `gap` classes are assigned to the specific `a` tags
6269
- HTML changes
6370
- All the pagy helper root classes have been changed according to the following rule. For example:
6471
- `"pagy-nav"` > `"pagy nav"`
6572
- `"pagy-bootstrap-nav-js"` > `"pagy-bootstrap nav-js"`
6673
- and so on for all the helpers
6774
- The `active` class of the `*nav`/`*nav_js` links as been renamed as `current`
68-
- The `disabled`, `prev`, `next` and `pagy-combo-input` link classes have been removed (see the [stylesheets](https://ddnexus.github.io/pagy/docs/api/stylesheets/#pagy-scss) for details)
75+
- The `disabled`, `prev`, `next` and `pagy-combo-input` link classes have been removed (see
76+
the [stylesheets](https://ddnexus.github.io/pagy/docs/api/stylesheets/#pagy-scss) for details)
6977
- The `rel="prev"` and `rel="next"` attributes have been dropped (they are obsolete)
7078
- The `<label>`/`</label>` and `<b>`/`</b>` wrappers in the dictionary files have been removed
7179
- The `pagy_link_proc` method (only used internally or in your custom overriding) has been renamed to `pagy_anchor` and it works
@@ -83,7 +91,7 @@ None
8391
- The [stylesheets](https://ddnexus.github.io/pagy/docs/api/stylesheets/) are a lot simpler as a consequence of the changes above
8492
- All the `*combo-nav_js` of the framework extras use simpler structure and improve the look and feel consistently with their
8593
respective frameworks
86-
- All the frontend extra have been normalized and are totally consistent with each other; a few may add the `classes:`
94+
- All the frontend extra have been normalized and are totally consistent with each other; a few may add the `classes:`
8795
argument to a few components, when the framework allows it.
8896
- Created the [pagy playground](https://ddnexus.github.io/pagy/playground) system of apps working with the `pagy` executable.
8997
- Internal renaming `FrontendHelpers` > `JSTools`

Gemfile

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ group :test do
1717
gem 'oj', require: false # false is for testing with or without it
1818
gem 'rack'
1919
gem 'rackup'
20-
gem 'rake-manifest'
2120
gem 'rematch'
2221
gem 'rubocop'
2322
gem 'rubocop-minitest'
@@ -33,7 +32,6 @@ group :apps do
3332
gem 'rouge'
3433
gem 'sinatra'
3534
gem 'sinatra-contrib'
36-
gem 'slop'
3735
end
3836

3937
group :performance do

Gemfile.lock

-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ GEM
8484
webrick (~> 1.8)
8585
rainbow (3.1.1)
8686
rake (13.1.0)
87-
rake-manifest (0.2.3)
8887
rb-fsevent (0.11.2)
8988
rb-inotify (0.10.1)
9089
ffi (~> 1.0)
@@ -139,7 +138,6 @@ GEM
139138
rack-protection (= 4.0.0)
140139
sinatra (= 4.0.0)
141140
tilt (~> 2.0)
142-
slop (4.10.1)
143141
tilt (2.3.0)
144142
tzinfo (2.0.6)
145143
concurrent-ruby (~> 1.0)
@@ -163,7 +161,6 @@ DEPENDENCIES
163161
rack
164162
rackup
165163
rake
166-
rake-manifest
167164
readline-ext
168165
rematch
169166
rerun
@@ -176,7 +173,6 @@ DEPENDENCIES
176173
simplecov
177174
sinatra
178175
sinatra-contrib
179-
slop
180176

181177
BUNDLED WITH
182178
2.5.3

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Rake.add_rakelib 'tasks'
44

5-
task default: %i[manifest:check rubocop test check_coverage]
5+
task default: %i[rubocop test check_coverage]
66
task test_cov: %i[test check_coverage]

docs/api/javascript/setup.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ unless Rails.env.production?
167167
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
168168
```json package.json
169169
{
170-
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
170+
"build": "NODE_PATH=\"$(bundle show 'pagy')/javascripts\" <your original command>"
171171
}
172172
```
173173

174174
+++ Webpack
175175
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
176176
```json package.json
177177
{
178-
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
178+
"build": "NODE_PATH=\"$(bundle show 'pagy')/javascripts\" <your original command>"
179179
}
180180
```
181181

@@ -215,7 +215,7 @@ import './pagy.js.erb'
215215
Prepend the `NODE_PATH` environment variable to the `scripts.build` command:
216216
```json package.json
217217
{
218-
"build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" <your original command>"
218+
"build": "NODE_PATH=\"$(bundle show 'pagy')/javascripts\" <your original command>"
219219
}
220220
```
221221

gem/locales/README.md

-12
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ You can create a Pull Request for your language, and get all the help you need t
3737
for `one`, `few`, `many` and `other`, if it uses `:one_other`, you should provide `one` and `other` plurals. If it uses `:other`
3838
you should only provide a single value. Look into other dictionary files to get some example. Ask if in doubt.
3939

40-
- [ ] Update the manifest file.
41-
42-
```sh
43-
rake manifest:generate
44-
```
45-
46-
and then confirm it with:
47-
48-
```sh
49-
rake manifest:check
50-
```
51-
5240
Feel free to ask for help in your Pull Request.
5341

5442
### Useful Links

pagy.gemspec renamed to gem/pagy.gemspec

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

3-
lib = File.expand_path('gem/lib', __dir__)
4-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5-
require 'pagy'
3+
require_relative 'lib/pagy'
64

75
Gem::Specification.new do |s|
86
s.name = 'pagy'
@@ -13,15 +11,15 @@ Gem::Specification.new do |s|
1311
s.description = 'Agnostic pagination in plain ruby. It does it all. Better.'
1412
s.homepage = 'https://github.com/ddnexus/pagy'
1513
s.license = 'MIT'
16-
s.files = File.read('pagy.manifest').split
14+
s.files = Dir.glob('**/*')
15+
.reject { |f| f.end_with?('.md', '.gemspec') }
16+
.select { |f| File.file?(f) } + ['LICENSE.txt'] # LICENSE.txt is copied and deleted around build
1717
s.metadata = { 'rubygems_mfa_required' => 'true',
1818
'homepage_uri' => 'https://github.com/ddnexus/pagy',
1919
'documentation_uri' => 'https://ddnexus.github.io/pagy',
2020
'bug_tracker_uri' => 'https://github.com/ddnexus/pagy/issues',
2121
'changelog_uri' => 'https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md',
2222
'support' => 'https://github.com/ddnexus/pagy/discussions/categories/q-a' }
23-
s.require_paths = ['gem/lib']
24-
s.bindir = 'gem/bin'
2523
s.executables << 'pagy'
2624
s.post_install_message = <<~PIM
2725
*********************** PAGY WARNING! ***********************

pagy.manifest

-90
This file was deleted.

tasks/check_coverage.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require 'json'
44

55
desc 'Display coverage summary. Fail if not 100%'
66
task :check_coverage do
7-
last_run = JSON.parse(File.read(File.expand_path('../coverage/.last_run.json', __dir__)))
7+
last_run = JSON.parse(File.read('coverage/.last_run.json'))
88
line = last_run['result']['line']
99
branch = last_run['result']['branch']
1010
message = "\n>>> Coverage -> line: #{line}% -> branch: #{branch}%\n"

tasks/rubygem_release.rake

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# frozen_string_literal: true
22

33
# Gem release cycle
4-
5-
require 'bundler/gem_tasks'
6-
require 'rake/manifest'
7-
8-
Rake::Manifest::Task.new do |t|
9-
t.patterns = FileList.new.include('gem/**/*', 'LICENSE.txt').exclude('**/*.md')
10-
t.manifest_file = 'pagy.manifest'
11-
end
4+
require 'bundler/gem_helper'
5+
Bundler::GemHelper.install_tasks(dir: 'gem', name: 'pagy')
126

137
module Bundler # :nodoc: all
148
class GemHelper
@@ -26,8 +20,10 @@ task :rubygem_release do
2620
branch = `git rev-parse --abbrev-ref HEAD`
2721
abort 'Wrong branch to release!' unless /^master/.match?(branch)
2822

29-
Rake::Task['manifest:check'].invoke
23+
FileUtils.cp('LICENSE.txt', 'gem/LICENSE.txt')
3024
Rake::Task['build'].invoke
25+
FileUtils.rm_f('gem/LICENSE.txt')
26+
3127
Rake::Task['release'].invoke
32-
FileUtils.rm_rf('pkg', secure: true)
28+
FileUtils.rm_rf('gem/pkg', secure: true)
3329
end

0 commit comments

Comments
 (0)