friendly_id 5.4.2 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +34 -25
- data/Changelog.md +6 -0
- data/Gemfile +9 -13
- data/README.md +21 -0
- data/Rakefile +24 -27
- data/bench.rb +30 -27
- data/certs/parndt.pem +25 -23
- data/friendly_id.gemspec +26 -29
- data/gemfiles/Gemfile.rails-5.2.rb +11 -16
- data/gemfiles/Gemfile.rails-6.0.rb +11 -16
- data/gemfiles/Gemfile.rails-6.1.rb +22 -0
- data/gemfiles/Gemfile.rails-7.0.rb +22 -0
- data/guide.rb +5 -5
- data/lib/friendly_id/base.rb +57 -60
- data/lib/friendly_id/candidates.rb +9 -11
- data/lib/friendly_id/configuration.rb +6 -7
- data/lib/friendly_id/finder_methods.rb +26 -11
- data/lib/friendly_id/finders.rb +63 -66
- data/lib/friendly_id/history.rb +59 -63
- data/lib/friendly_id/initializer.rb +4 -4
- data/lib/friendly_id/migration.rb +6 -6
- data/lib/friendly_id/object_utils.rb +2 -2
- data/lib/friendly_id/reserved.rb +28 -32
- data/lib/friendly_id/scoped.rb +97 -102
- data/lib/friendly_id/sequentially_slugged/calculator.rb +69 -0
- data/lib/friendly_id/sequentially_slugged.rb +17 -64
- data/lib/friendly_id/simple_i18n.rb +75 -69
- data/lib/friendly_id/slug.rb +1 -2
- data/lib/friendly_id/slug_generator.rb +1 -3
- data/lib/friendly_id/slugged.rb +234 -238
- data/lib/friendly_id/version.rb +1 -1
- data/lib/friendly_id.rb +41 -45
- data/lib/generators/friendly_id_generator.rb +9 -9
- data/test/base_test.rb +10 -13
- data/test/benchmarks/finders.rb +28 -26
- data/test/benchmarks/object_utils.rb +13 -13
- data/test/candidates_test.rb +17 -18
- data/test/configuration_test.rb +7 -11
- data/test/core_test.rb +1 -2
- data/test/databases.yml +4 -3
- data/test/finders_test.rb +52 -5
- data/test/generator_test.rb +16 -26
- data/test/helper.rb +29 -22
- data/test/history_test.rb +70 -74
- data/test/numeric_slug_test.rb +4 -4
- data/test/object_utils_test.rb +0 -2
- data/test/reserved_test.rb +9 -11
- data/test/schema.rb +5 -4
- data/test/scoped_test.rb +18 -20
- data/test/sequentially_slugged_test.rb +65 -50
- data/test/shared.rb +15 -16
- data/test/simple_i18n_test.rb +22 -12
- data/test/slugged_test.rb +102 -121
- data/test/sti_test.rb +19 -21
- data.tar.gz.sig +0 -0
- metadata +35 -30
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b1293d744a87c9988c0ff2dfba773f351cdf62bc24e3b3c73e386310b44d4bb
|
4
|
+
data.tar.gz: 1e02363f0abe107ce5165942024ff4cdabfc8b8c18083e0615846c58f5e41252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7f27736b4ae2218c95c42cde457472a919c81f89d0b899453c351e4b16c2e557c6f44a9dc32ef947123e2228e5588f8bcd1157c60d3ecb4f4195cc4687609b9
|
7
|
+
data.tar.gz: bf6b4a73627faa1363a78d70d6a82e3e1ebf2fa1b7979504d0914646325fffc980f9b78508a3a9ad8ab17c93034bc45c2b50cf3d058f33857b4e83a064c605fc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.github/workflows/test.yml
CHANGED
@@ -10,20 +10,13 @@ jobs:
|
|
10
10
|
strategy:
|
11
11
|
matrix:
|
12
12
|
database: [ mysql, postgresql ]
|
13
|
-
gemfile: [ '
|
14
|
-
ruby: [ '2.
|
13
|
+
gemfile: [ '7.0', '6.1', '6.0' ]
|
14
|
+
ruby: [ '2.6', '2.7', '3.0', '3.1' ]
|
15
|
+
exclude:
|
16
|
+
- ruby: '2.6'
|
17
|
+
gemfile: '7.0'
|
15
18
|
fail-fast: false
|
16
19
|
runs-on: ubuntu-latest
|
17
|
-
name: ${{ matrix.ruby }} ${{ matrix.database }} rails-${{ matrix.gemfile }}
|
18
|
-
steps:
|
19
|
-
- uses: actions/checkout@v2
|
20
|
-
- run: sudo apt-get update && sudo apt-get install libpq-dev postgresql-client libmysqlclient-dev mysql-client libsqlite3-dev -y
|
21
|
-
- uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
bundler-cache: true
|
24
|
-
ruby-version: ${{ matrix.ruby }}
|
25
|
-
- run: bundle exec rake db:create db:up
|
26
|
-
- run: bundle exec rake test
|
27
20
|
|
28
21
|
env:
|
29
22
|
BUNDLE_GEMFILE: gemfiles/Gemfile.rails-${{ matrix.gemfile }}.rb
|
@@ -32,18 +25,34 @@ jobs:
|
|
32
25
|
DB: ${{ matrix.database }}
|
33
26
|
MYSQL_PASSWORD: root
|
34
27
|
PGHOST: localhost
|
35
|
-
|
36
|
-
PGUSER:
|
28
|
+
PGPASSWORD: runner
|
29
|
+
PGUSER: runner
|
37
30
|
RAILS_ENV: test
|
38
31
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
32
|
+
name: ${{ matrix.ruby }} ${{ matrix.database }} rails-${{ matrix.gemfile }}
|
33
|
+
steps:
|
34
|
+
- uses: actions/checkout@v3
|
35
|
+
|
36
|
+
- run: sudo apt-get update && sudo apt-get install libsqlite3-dev -y
|
37
|
+
|
38
|
+
- name: "Set up MySQL using VM's server"
|
39
|
+
if: ${{ env.DB == 'mysql' }}
|
40
|
+
run: |
|
41
|
+
sudo apt-get install libmysqlclient-dev -y
|
42
|
+
sudo systemctl start mysql.service
|
43
|
+
|
44
|
+
- name: "Set up PostgreSQL using VM's server"
|
45
|
+
if: ${{ env.DB == 'postgresql' }}
|
46
|
+
run: |
|
47
|
+
sudo apt-get install libpq-dev -y
|
48
|
+
sudo systemctl start postgresql.service
|
49
|
+
sudo -u postgres psql -c "CREATE USER runner WITH SUPERUSER PASSWORD 'runner'"
|
50
|
+
sudo -u postgres createdb runner
|
51
|
+
|
52
|
+
- uses: ruby/setup-ruby@v1
|
53
|
+
with:
|
54
|
+
bundler-cache: true
|
55
|
+
ruby-version: ${{ matrix.ruby }}
|
56
|
+
|
57
|
+
- run: bundle exec rake db:{create,up}
|
58
|
+
- run: bundle exec rake test
|
data/Changelog.md
CHANGED
@@ -5,6 +5,12 @@ suggestions, ideas and improvements to FriendlyId.
|
|
5
5
|
|
6
6
|
## Unreleased
|
7
7
|
|
8
|
+
## 5.5.0 (2022-11-16)
|
9
|
+
|
10
|
+
* SimpleI18n: Handle regional locales ([#965](https://github.com/norman/friendly_id/pull/965))
|
11
|
+
* Fix: "unknown column" exception ([#943](https://github.com/norman/friendly_id/pull/943))
|
12
|
+
* Add: `allow_nil: true` to the Finder ([#995](https://github.com/norman/friendly_id/pull/995) and [#997](https://github.com/norman/friendly_id/pull/997))
|
13
|
+
|
8
14
|
## 5.4.2 (2021-01-07)
|
9
15
|
|
10
16
|
* Fix: Set slug before save if needed ([#948](https://github.com/norman/friendly_id/pull/948))
|
data/Gemfile
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem
|
5
|
+
gem "standard"
|
6
|
+
gem "rake"
|
6
7
|
|
7
8
|
group :development, :test do
|
8
9
|
platforms :ruby do
|
9
|
-
gem
|
10
|
-
gem
|
10
|
+
gem "byebug"
|
11
|
+
gem "pry"
|
11
12
|
end
|
12
13
|
|
13
14
|
platforms :jruby do
|
14
|
-
gem
|
15
|
-
gem
|
15
|
+
gem "activerecord-jdbcsqlite3-adapter", ">= 1.3.0.beta2"
|
16
|
+
gem "kramdown"
|
16
17
|
end
|
17
18
|
|
18
19
|
platforms :ruby, :rbx do
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
end
|
22
|
-
|
23
|
-
platforms :rbx do
|
24
|
-
gem 'rubysl', '~> 2.0'
|
25
|
-
gem 'rubinius-developer_tools'
|
20
|
+
gem "sqlite3"
|
21
|
+
gem "redcarpet"
|
26
22
|
end
|
27
23
|
end
|
data/README.md
CHANGED
@@ -104,6 +104,27 @@ existing users, do this from the console, runner, or add a Rake task:
|
|
104
104
|
User.find_each(&:save)
|
105
105
|
```
|
106
106
|
|
107
|
+
## Options
|
108
|
+
|
109
|
+
### `:allow_nil`
|
110
|
+
|
111
|
+
You can pass `allow_nil: true` to the `friendly.find()` method if you're want to
|
112
|
+
avoid raising `ActiveRecord::RecordNotFound` and accept a `nil`.
|
113
|
+
|
114
|
+
#### Example
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
MyModel.friendly.find("bad-slug") # where bad-slug is not a valid slug
|
118
|
+
MyModel.friendly.find(123) # where 123 is not a valid primary key ID
|
119
|
+
MyModel.friendly.find(nil) # maybe you have a variable/param that's potentially nil
|
120
|
+
#=> raise ActiveRecord::RecordNotFound
|
121
|
+
|
122
|
+
MyModel.friendly.find("bad-slug", allow_nil: true)
|
123
|
+
MyModel.friendly.find(123, allow_nil: true)
|
124
|
+
MyModel.friendly.find(nil, allow_nil: true)
|
125
|
+
#=> nil
|
126
|
+
```
|
127
|
+
|
107
128
|
## Bugs
|
108
129
|
|
109
130
|
Please report them on the [Github issue
|
data/Rakefile
CHANGED
@@ -1,107 +1,104 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "rake/testtask"
|
3
3
|
|
4
|
-
task :
|
4
|
+
task default: :test
|
5
5
|
|
6
6
|
task :load_path do
|
7
|
-
%w
|
7
|
+
%w[lib test].each do |path|
|
8
8
|
$LOAD_PATH.unshift(File.expand_path("../#{path}", __FILE__))
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
Rake::TestTask.new do |t|
|
13
13
|
t.libs << "test"
|
14
|
-
t.test_files = FileList[
|
14
|
+
t.test_files = FileList["test/*_test.rb"]
|
15
15
|
t.verbose = true
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "Remove temporary files"
|
19
19
|
task :clean do
|
20
|
-
|
21
|
-
%x
|
20
|
+
`rm -rf *.gem doc pkg coverage`
|
21
|
+
%x(rm -f `find . -name '*.rbc'`)
|
22
22
|
end
|
23
23
|
|
24
24
|
desc "Build the gem"
|
25
25
|
task :gem do
|
26
|
-
|
26
|
+
`gem build friendly_id.gemspec`
|
27
27
|
end
|
28
28
|
|
29
29
|
desc "Build YARD documentation"
|
30
30
|
task :yard do
|
31
|
-
puts
|
31
|
+
puts `bundle exec yard`
|
32
32
|
end
|
33
33
|
|
34
34
|
desc "Run benchmarks"
|
35
|
-
task :
|
35
|
+
task bench: :load_path do
|
36
36
|
require File.expand_path("../bench", __FILE__)
|
37
37
|
end
|
38
38
|
|
39
39
|
desc "Run benchmarks on finders"
|
40
|
-
task :
|
40
|
+
task bench_finders: :load_path do
|
41
41
|
require File.expand_path("../test/benchmarks/finders", __FILE__)
|
42
42
|
end
|
43
43
|
|
44
44
|
desc "Run benchmarks on ObjectUtils"
|
45
|
-
task :
|
45
|
+
task bench_object_utils: :load_path do
|
46
46
|
require File.expand_path("../test/benchmarks/object_utils", __FILE__)
|
47
47
|
end
|
48
48
|
|
49
49
|
desc "Generate Guide.md"
|
50
50
|
task :guide do
|
51
|
-
load File.expand_path(
|
51
|
+
load File.expand_path("../guide.rb", __FILE__)
|
52
52
|
end
|
53
53
|
|
54
54
|
namespace :test do
|
55
|
-
|
56
55
|
desc "Run each test class in a separate process"
|
57
56
|
task :isolated do
|
58
57
|
dir = File.expand_path("../test", __FILE__)
|
59
58
|
Dir["#{dir}/*_test.rb"].each do |test|
|
60
59
|
puts "Running #{test}:"
|
61
|
-
puts
|
60
|
+
puts `ruby -Ilib -Itest #{test}`
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
65
|
namespace :db do
|
67
|
-
|
68
66
|
desc "Create the database"
|
69
|
-
task :
|
67
|
+
task create: :load_path do
|
70
68
|
require "helper"
|
71
69
|
driver = FriendlyId::Test::Database.driver
|
72
70
|
config = FriendlyId::Test::Database.config[driver]
|
73
71
|
commands = {
|
74
|
-
"mysql"
|
75
|
-
"postgres" => "psql -c 'create database #{config[
|
72
|
+
"mysql" => "mysql -h #{config["host"]} -P #{config["port"]} -u #{config["username"]} --password=#{config["password"]} -e 'create database #{config["database"]};' >/dev/null",
|
73
|
+
"postgres" => "psql -c 'create database #{config["database"]};' -U #{config["username"]} >/dev/null"
|
76
74
|
}
|
77
|
-
|
75
|
+
`#{commands[driver] || true}`
|
78
76
|
end
|
79
77
|
|
80
78
|
desc "Drop the database"
|
81
|
-
task :
|
79
|
+
task drop: :load_path do
|
82
80
|
require "helper"
|
83
81
|
driver = FriendlyId::Test::Database.driver
|
84
82
|
config = FriendlyId::Test::Database.config[driver]
|
85
83
|
commands = {
|
86
|
-
"mysql"
|
87
|
-
"postgres" => "psql -c 'drop database #{config[
|
84
|
+
"mysql" => "mysql -h #{config["host"]} -P #{config["port"]} -u #{config["username"]} --password=#{config["password"]} -e 'drop database #{config["database"]};' >/dev/null",
|
85
|
+
"postgres" => "psql -c 'drop database #{config["database"]};' -U #{config["username"]} >/dev/null"
|
88
86
|
}
|
89
|
-
|
87
|
+
`#{commands[driver] || true}`
|
90
88
|
end
|
91
89
|
|
92
90
|
desc "Set up the database schema"
|
93
|
-
task :
|
91
|
+
task up: :load_path do
|
94
92
|
require "helper"
|
95
93
|
FriendlyId::Test::Schema.up
|
96
94
|
end
|
97
95
|
|
98
96
|
desc "Drop and recreate the database schema"
|
99
|
-
task :
|
100
|
-
|
97
|
+
task reset: [:drop, :create]
|
101
98
|
end
|
102
99
|
|
103
|
-
task :
|
100
|
+
task doc: :yard
|
104
101
|
|
105
102
|
task :docs do
|
106
|
-
sh %
|
103
|
+
sh %(git checkout gh-pages && rake doc && git checkout @{-1})
|
107
104
|
end
|
data/bench.rb
CHANGED
@@ -4,7 +4,11 @@ require "ffaker"
|
|
4
4
|
N = 10000
|
5
5
|
|
6
6
|
def transaction
|
7
|
-
ActiveRecord::Base.transaction
|
7
|
+
ActiveRecord::Base.transaction do
|
8
|
+
yield
|
9
|
+
|
10
|
+
raise ActiveRecord::Rollback
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
class Array
|
@@ -17,65 +21,64 @@ Book = Class.new ActiveRecord::Base
|
|
17
21
|
|
18
22
|
class Journalist < ActiveRecord::Base
|
19
23
|
extend FriendlyId
|
20
|
-
friendly_id :name, :
|
24
|
+
friendly_id :name, use: :slugged
|
21
25
|
end
|
22
26
|
|
23
27
|
class Manual < ActiveRecord::Base
|
24
28
|
extend FriendlyId
|
25
|
-
friendly_id :name, :
|
29
|
+
friendly_id :name, use: :history
|
26
30
|
end
|
27
31
|
|
28
32
|
class Restaurant < ActiveRecord::Base
|
29
33
|
extend FriendlyId
|
30
|
-
friendly_id :name, :
|
34
|
+
friendly_id :name, use: :finders
|
31
35
|
end
|
32
36
|
|
33
|
-
|
34
|
-
BOOKS = []
|
37
|
+
BOOKS = []
|
35
38
|
JOURNALISTS = []
|
36
|
-
MANUALS
|
39
|
+
MANUALS = []
|
37
40
|
RESTAURANTS = []
|
38
41
|
|
39
42
|
100.times do
|
40
43
|
name = FFaker::Name.name
|
41
|
-
BOOKS
|
42
|
-
JOURNALISTS << (Journalist.create! :
|
43
|
-
MANUALS
|
44
|
-
RESTAURANTS << (Restaurant.create! :
|
44
|
+
BOOKS << (Book.create! name: name).id
|
45
|
+
JOURNALISTS << (Journalist.create! name: name).friendly_id
|
46
|
+
MANUALS << (Manual.create! name: name).friendly_id
|
47
|
+
RESTAURANTS << (Restaurant.create! name: name).friendly_id
|
45
48
|
end
|
46
49
|
|
47
50
|
ActiveRecord::Base.connection.execute "UPDATE manuals SET slug = NULL"
|
48
51
|
|
49
52
|
Benchmark.bmbm do |x|
|
50
|
-
x.report
|
51
|
-
N.times {Book.find BOOKS.rand}
|
53
|
+
x.report "find (without FriendlyId)" do
|
54
|
+
N.times { Book.find BOOKS.rand }
|
52
55
|
end
|
53
56
|
|
54
|
-
x.report
|
55
|
-
N.times {Journalist.friendly.find JOURNALISTS.rand}
|
57
|
+
x.report "find (in-table slug)" do
|
58
|
+
N.times { Journalist.friendly.find JOURNALISTS.rand }
|
56
59
|
end
|
57
60
|
|
58
|
-
x.report
|
59
|
-
N.times {Restaurant.find RESTAURANTS.rand}
|
61
|
+
x.report "find (in-table slug; using finders module)" do
|
62
|
+
N.times { Restaurant.find RESTAURANTS.rand }
|
60
63
|
end
|
61
64
|
|
62
|
-
x.report
|
63
|
-
N.times {Manual.friendly.find MANUALS.rand}
|
65
|
+
x.report "find (external slug)" do
|
66
|
+
N.times { Manual.friendly.find MANUALS.rand }
|
64
67
|
end
|
65
68
|
|
66
|
-
x.report
|
67
|
-
N.times {transaction {Book.create :
|
69
|
+
x.report "insert (without FriendlyId)" do
|
70
|
+
N.times { transaction { Book.create name: FFaker::Name.name } }
|
68
71
|
end
|
69
72
|
|
70
|
-
x.report
|
71
|
-
N.times {transaction {Journalist.create :
|
73
|
+
x.report "insert (in-table-slug)" do
|
74
|
+
N.times { transaction { Journalist.create name: FFaker::Name.name } }
|
72
75
|
end
|
73
76
|
|
74
|
-
x.report
|
75
|
-
N.times {transaction {Restaurant.create :
|
77
|
+
x.report "insert (in-table-slug; using finders module)" do
|
78
|
+
N.times { transaction { Restaurant.create name: FFaker::Name.name } }
|
76
79
|
end
|
77
80
|
|
78
|
-
x.report
|
79
|
-
N.times {transaction {Manual.create :
|
81
|
+
x.report "insert (external slug)" do
|
82
|
+
N.times { transaction { Manual.create name: FFaker::Name.name } }
|
80
83
|
end
|
81
84
|
end
|
data/certs/parndt.pem
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
2
|
+
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBRMREwDwYDVQQDDAhydWJ5
|
3
|
+
Z2VtczERMA8GCgmSJomT8ixkARkWAXAxFTATBgoJkiaJk/IsZAEZFgVhcm5kdDES
|
4
|
+
MBAGCgmSJomT8ixkARkWAmlvMB4XDTIyMTExNTIyMjQzMFoXDTIzMTExNTIyMjQz
|
5
|
+
MFowUTERMA8GA1UEAwwIcnVieWdlbXMxETAPBgoJkiaJk/IsZAEZFgFwMRUwEwYK
|
6
|
+
CZImiZPyLGQBGRYFYXJuZHQxEjAQBgoJkiaJk/IsZAEZFgJpbzCCAaIwDQYJKoZI
|
7
|
+
hvcNAQEBBQADggGPADCCAYoCggGBAMPq2bIEO+BmmBeuidSySK7xlL/LWBHzyDxw
|
8
|
+
EMgWsHqJMDZYCZI4WoWbSTSSLrp5zPXLWN0hB23u3dxFp4RVygTTZkc8k05mteab
|
9
|
+
fdREGgdcP+mY8/ASQSvb1VW6IM51Srgjy1SK0S5Qf3HAiQafFvRsxRkY0SWyth24
|
10
|
+
ne/7HG667vHQ1+t0VFl8twupJE9S8p2zgX3eZBl2yRNm/kE5reUsOLvmS58Iri/X
|
11
|
+
9tnz0SGkzrKkim9OIByq7XkFLL3oaIyfbBVgOWilM5pvxj/xNuRH7EIM6aE3q0UZ
|
12
|
+
xo7o9u9Iz2zApDEjejByPjxWAhLuP3v3bJyinRFE1rO47lEM/s6KM/6YooxvgYIN
|
13
|
+
miYYFRtTj9nmKEMv6+h1mZ1/ZwqStTTRh/T90T65dcgsoqRd0JNvpNRjFrYH5cuj
|
14
|
+
QZWMl/FE6AADm0GXa34ZiTQx3Wx2ctqJLFak8+imPwes90nCpiYmgaZpwBI+shjU
|
15
|
+
AddbPDNq+EoxPMWTh0Er3w76fywOWQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1Ud
|
16
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUxRJaTQZmtkN8FKUWVHKc2riND18wHgYDVR0RBBcw
|
17
|
+
FYETcnVieWdlbXNAcC5hcm5kdC5pbzAeBgNVHRIEFzAVgRNydWJ5Z2Vtc0BwLmFy
|
18
|
+
bmR0LmlvMA0GCSqGSIb3DQEBCwUAA4IBgQBSRGMkZ2dvJ0LSjFz+rIt3G3AZMbKD
|
19
|
+
tjaaQRuC9rOkrl3Rml6h9j7cHYiM0wkTjXneFNySc8jWmM/jKnxiiUfUK9r1XL4n
|
20
|
+
71tz39+MD2lIpLVVEQ69MIoUseppNUTCg0mNghSDYNwISMD/hoWwbJudBi56DbhE
|
21
|
+
xkulLbw8qtcEE+iilIKibe+eJF4platKScsOA7d1AuilR1/S245UzeqwwyI52/xK
|
22
|
+
dfoP928X9Tb/48+83lWUgAgCQOd6WdfCpgQ5H6R90lc8L7OfuDR/vgcmSOTsNVgG
|
23
|
+
1TC3b2FISS0p0qfZsiS7BXh+ARoBKLXsV1a7WR36X0dUpajvk+zzBGrFCdbW43Gx
|
24
|
+
wmJzIksYnf9Ktg8Ux+FLcRBGw4qEIyWvqmS0obB1Hke68rTg0uNTFcKXsNw33XF5
|
25
|
+
fw1cbj95g7OPe0feGK8+afXh/L38vx/hIIOGlUEZ+HaWL2Dki/7vRGvda8dfOpG5
|
26
|
+
bJfaoyKbVsrK+gGKFJv860zsO8lg6BGLsUw=
|
25
27
|
-----END CERTIFICATE-----
|
data/friendly_id.gemspec
CHANGED
@@ -1,39 +1,36 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require File.expand_path("../lib/friendly_id/version", __FILE__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |s|
|
5
|
-
s.name
|
6
|
-
s.version
|
7
|
-
s.authors
|
8
|
-
s.email
|
9
|
-
s.homepage
|
10
|
-
s.summary
|
11
|
-
s.files
|
12
|
-
s.test_files
|
13
|
-
s.require_paths
|
14
|
-
s.license
|
4
|
+
s.name = "friendly_id"
|
5
|
+
s.version = FriendlyId::VERSION
|
6
|
+
s.authors = ["Norman Clarke", "Philip Arndt"]
|
7
|
+
s.email = ["norman@njclarke.com", "p@arndt.io"]
|
8
|
+
s.homepage = "https://github.com/norman/friendly_id"
|
9
|
+
s.summary = "A comprehensive slugging and pretty-URL plugin."
|
10
|
+
s.files = `git ls-files`.split("\n")
|
11
|
+
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.license = "MIT"
|
15
14
|
|
16
|
-
s.required_ruby_version =
|
15
|
+
s.required_ruby_version = ">= 2.1.0"
|
17
16
|
|
18
|
-
s.add_dependency
|
17
|
+
s.add_dependency "activerecord", ">= 4.0.0"
|
19
18
|
|
20
|
-
s.add_development_dependency
|
21
|
-
s.add_development_dependency
|
22
|
-
s.add_development_dependency
|
23
|
-
s.add_development_dependency
|
24
|
-
s.add_development_dependency
|
25
|
-
s.add_development_dependency
|
26
|
-
s.add_development_dependency
|
27
|
-
s.add_development_dependency
|
19
|
+
s.add_development_dependency "coveralls"
|
20
|
+
s.add_development_dependency "railties", ">= 4.0"
|
21
|
+
s.add_development_dependency "minitest", "~> 5.3"
|
22
|
+
s.add_development_dependency "mocha", "~> 1.1"
|
23
|
+
s.add_development_dependency "yard"
|
24
|
+
s.add_development_dependency "i18n"
|
25
|
+
s.add_development_dependency "ffaker"
|
26
|
+
s.add_development_dependency "simplecov"
|
28
27
|
|
29
|
-
s.description =
|
30
|
-
|
31
|
-
|
32
|
-
strings as if they were numeric ids.
|
33
|
-
EOM
|
28
|
+
s.description = "FriendlyId is the \"Swiss Army bulldozer\" of slugging " \
|
29
|
+
"and permalink plugins for Active Record. It lets you create pretty URLs " \
|
30
|
+
"and work with human-friendly strings as if they were numeric ids."
|
34
31
|
|
35
|
-
s.cert_chain = [File.expand_path(
|
36
|
-
if $PROGRAM_NAME
|
37
|
-
s.signing_key = File.expand_path(
|
32
|
+
s.cert_chain = [File.expand_path("certs/parndt.pem", __dir__)]
|
33
|
+
if $PROGRAM_NAME.end_with?("gem") && ARGV.include?("build") && ARGV.include?(__FILE__)
|
34
|
+
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem")
|
38
35
|
end
|
39
36
|
end
|
@@ -1,27 +1,22 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gemspec path:
|
3
|
+
gemspec path: "../"
|
4
4
|
|
5
|
-
gem
|
6
|
-
gem
|
5
|
+
gem "activerecord", "~> 5.2.0"
|
6
|
+
gem "railties", "~> 5.2.0"
|
7
7
|
|
8
8
|
# Database Configuration
|
9
9
|
group :development, :test do
|
10
10
|
platforms :jruby do
|
11
|
-
gem
|
12
|
-
gem
|
13
|
-
gem
|
11
|
+
gem "activerecord-jdbcmysql-adapter", "~> 51.1"
|
12
|
+
gem "activerecord-jdbcpostgresql-adapter", "~> 51.1"
|
13
|
+
gem "kramdown"
|
14
14
|
end
|
15
15
|
|
16
16
|
platforms :ruby, :rbx do
|
17
|
-
gem
|
18
|
-
gem
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
end
|
22
|
-
|
23
|
-
platforms :rbx do
|
24
|
-
gem 'rubysl', '~> 2.0'
|
25
|
-
gem 'rubinius-developer_tools'
|
17
|
+
gem "sqlite3"
|
18
|
+
gem "mysql2"
|
19
|
+
gem "pg"
|
20
|
+
gem "redcarpet"
|
26
21
|
end
|
27
22
|
end
|
@@ -1,27 +1,22 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gemspec path:
|
3
|
+
gemspec path: "../"
|
4
4
|
|
5
|
-
gem
|
6
|
-
gem
|
5
|
+
gem "activerecord", "~> 6.0.0"
|
6
|
+
gem "railties", "~> 6.0.0"
|
7
7
|
|
8
8
|
# Database Configuration
|
9
9
|
group :development, :test do
|
10
10
|
platforms :jruby do
|
11
|
-
gem
|
12
|
-
gem
|
13
|
-
gem
|
11
|
+
gem "activerecord-jdbcmysql-adapter", "~> 51.1"
|
12
|
+
gem "activerecord-jdbcpostgresql-adapter", "~> 51.1"
|
13
|
+
gem "kramdown"
|
14
14
|
end
|
15
15
|
|
16
16
|
platforms :ruby, :rbx do
|
17
|
-
gem
|
18
|
-
gem
|
19
|
-
gem
|
20
|
-
gem
|
21
|
-
end
|
22
|
-
|
23
|
-
platforms :rbx do
|
24
|
-
gem 'rubysl', '~> 2.0'
|
25
|
-
gem 'rubinius-developer_tools'
|
17
|
+
gem "sqlite3"
|
18
|
+
gem "mysql2"
|
19
|
+
gem "pg"
|
20
|
+
gem "redcarpet"
|
26
21
|
end
|
27
22
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec path: "../"
|
4
|
+
|
5
|
+
gem "activerecord", "~> 6.1.4"
|
6
|
+
gem "railties", "~> 6.1.4"
|
7
|
+
|
8
|
+
# Database Configuration
|
9
|
+
group :development, :test do
|
10
|
+
platforms :jruby do
|
11
|
+
gem "activerecord-jdbcmysql-adapter", "~> 61.0"
|
12
|
+
gem "activerecord-jdbcpostgresql-adapter", "~> 61.0"
|
13
|
+
gem "kramdown"
|
14
|
+
end
|
15
|
+
|
16
|
+
platforms :ruby, :rbx do
|
17
|
+
gem "sqlite3"
|
18
|
+
gem "mysql2"
|
19
|
+
gem "pg"
|
20
|
+
gem "redcarpet"
|
21
|
+
end
|
22
|
+
end
|