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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/dependabot.yml +6 -0
  4. data/.github/workflows/test.yml +34 -25
  5. data/Changelog.md +6 -0
  6. data/Gemfile +9 -13
  7. data/README.md +21 -0
  8. data/Rakefile +24 -27
  9. data/bench.rb +30 -27
  10. data/certs/parndt.pem +25 -23
  11. data/friendly_id.gemspec +26 -29
  12. data/gemfiles/Gemfile.rails-5.2.rb +11 -16
  13. data/gemfiles/Gemfile.rails-6.0.rb +11 -16
  14. data/gemfiles/Gemfile.rails-6.1.rb +22 -0
  15. data/gemfiles/Gemfile.rails-7.0.rb +22 -0
  16. data/guide.rb +5 -5
  17. data/lib/friendly_id/base.rb +57 -60
  18. data/lib/friendly_id/candidates.rb +9 -11
  19. data/lib/friendly_id/configuration.rb +6 -7
  20. data/lib/friendly_id/finder_methods.rb +26 -11
  21. data/lib/friendly_id/finders.rb +63 -66
  22. data/lib/friendly_id/history.rb +59 -63
  23. data/lib/friendly_id/initializer.rb +4 -4
  24. data/lib/friendly_id/migration.rb +6 -6
  25. data/lib/friendly_id/object_utils.rb +2 -2
  26. data/lib/friendly_id/reserved.rb +28 -32
  27. data/lib/friendly_id/scoped.rb +97 -102
  28. data/lib/friendly_id/sequentially_slugged/calculator.rb +69 -0
  29. data/lib/friendly_id/sequentially_slugged.rb +17 -64
  30. data/lib/friendly_id/simple_i18n.rb +75 -69
  31. data/lib/friendly_id/slug.rb +1 -2
  32. data/lib/friendly_id/slug_generator.rb +1 -3
  33. data/lib/friendly_id/slugged.rb +234 -238
  34. data/lib/friendly_id/version.rb +1 -1
  35. data/lib/friendly_id.rb +41 -45
  36. data/lib/generators/friendly_id_generator.rb +9 -9
  37. data/test/base_test.rb +10 -13
  38. data/test/benchmarks/finders.rb +28 -26
  39. data/test/benchmarks/object_utils.rb +13 -13
  40. data/test/candidates_test.rb +17 -18
  41. data/test/configuration_test.rb +7 -11
  42. data/test/core_test.rb +1 -2
  43. data/test/databases.yml +4 -3
  44. data/test/finders_test.rb +52 -5
  45. data/test/generator_test.rb +16 -26
  46. data/test/helper.rb +29 -22
  47. data/test/history_test.rb +70 -74
  48. data/test/numeric_slug_test.rb +4 -4
  49. data/test/object_utils_test.rb +0 -2
  50. data/test/reserved_test.rb +9 -11
  51. data/test/schema.rb +5 -4
  52. data/test/scoped_test.rb +18 -20
  53. data/test/sequentially_slugged_test.rb +65 -50
  54. data/test/shared.rb +15 -16
  55. data/test/simple_i18n_test.rb +22 -12
  56. data/test/slugged_test.rb +102 -121
  57. data/test/sti_test.rb +19 -21
  58. data.tar.gz.sig +0 -0
  59. metadata +35 -30
  60. metadata.gz.sig +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21ddfb374efbecb41ddb5164a5f0fbb4df5838edfcb13a8e7d8d6caa1b378f34
4
- data.tar.gz: 363955e55e33b9b15d59099f1b6ac00d88f32e0b3835f1dfd6fcf718aad7ac7f
3
+ metadata.gz: 0b1293d744a87c9988c0ff2dfba773f351cdf62bc24e3b3c73e386310b44d4bb
4
+ data.tar.gz: 1e02363f0abe107ce5165942024ff4cdabfc8b8c18083e0615846c58f5e41252
5
5
  SHA512:
6
- metadata.gz: d966763a10e683b815681576ef71c720caeafee88c49f866f912cae1a2aae12a33fd00bfc93f2d0eb7204ae2b91c514613edf34996119519613452b0ce0cdfb1
7
- data.tar.gz: f8e8522f7f4b1c8a32bc8fd58c719d8376beb3325f2adfbca0554f7ec63a2742d5ab5b7128bbf2fa3f106075f5f89af590843c36bf3924d975674bada3673ca9
6
+ metadata.gz: f7f27736b4ae2218c95c42cde457472a919c81f89d0b899453c351e4b16c2e557c6f44a9dc32ef947123e2228e5588f8bcd1157c60d3ecb4f4195cc4687609b9
7
+ data.tar.gz: bf6b4a73627faa1363a78d70d6a82e3e1ebf2fa1b7979504d0914646325fffc980f9b78508a3a9ad8ab17c93034bc45c2b50cf3d058f33857b4e83a064c605fc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -10,20 +10,13 @@ jobs:
10
10
  strategy:
11
11
  matrix:
12
12
  database: [ mysql, postgresql ]
13
- gemfile: [ '6.0', '5.2' ]
14
- ruby: [ '2.7', '2.6', '2.5' ]
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
- PGPORT: 5432
36
- PGUSER: postgres
28
+ PGPASSWORD: runner
29
+ PGUSER: runner
37
30
  RAILS_ENV: test
38
31
 
39
- services:
40
- postgres:
41
- image: postgres:11.5
42
- ports: ["5432:5432"]
43
- options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
44
- mysql:
45
- image: mysql:5.7
46
- ports: ["3306:3306"]
47
- options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
48
- env:
49
- MYSQL_ROOT_PASSWORD: root
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 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake'
5
+ gem "standard"
6
+ gem "rake"
6
7
 
7
8
  group :development, :test do
8
9
  platforms :ruby do
9
- gem 'byebug'
10
- gem 'pry'
10
+ gem "byebug"
11
+ gem "pry"
11
12
  end
12
13
 
13
14
  platforms :jruby do
14
- gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0.beta2'
15
- gem 'kramdown'
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 'sqlite3'
20
- gem 'redcarpet'
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 :default => :test
4
+ task default: :test
5
5
 
6
6
  task :load_path do
7
- %w(lib test).each do |path|
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['test/*_test.rb']
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
- %x{rm -rf *.gem doc pkg coverage}
21
- %x{rm -f `find . -name '*.rbc'`}
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
- %x{gem build friendly_id.gemspec}
26
+ `gem build friendly_id.gemspec`
27
27
  end
28
28
 
29
29
  desc "Build YARD documentation"
30
30
  task :yard do
31
- puts %x{bundle exec yard}
31
+ puts `bundle exec yard`
32
32
  end
33
33
 
34
34
  desc "Run benchmarks"
35
- task :bench => :load_path do
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 :bench_finders => :load_path do
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 :bench_object_utils => :load_path do
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('../guide.rb', __FILE__)
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 %x{ruby -Ilib -Itest #{test}}
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 :create => :load_path do
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" => "mysql -h #{config['host']} -P #{config['port']} -u #{config['username']} --password=#{config['password']} -e 'create database #{config["database"]};' >/dev/null",
75
- "postgres" => "psql -c 'create database #{config['database']};' -U #{config['username']} >/dev/null"
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
- %x{#{commands[driver] || true}}
75
+ `#{commands[driver] || true}`
78
76
  end
79
77
 
80
78
  desc "Drop the database"
81
- task :drop => :load_path do
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" => "mysql -h #{config['host']} -P #{config['port']} -u #{config['username']} --password=#{config['password']} -e 'drop database #{config["database"]};' >/dev/null",
87
- "postgres" => "psql -c 'drop database #{config['database']};' -U #{config['username']} >/dev/null"
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
- %x{#{commands[driver] || true}}
87
+ `#{commands[driver] || true}`
90
88
  end
91
89
 
92
90
  desc "Set up the database schema"
93
- task :up => :load_path do
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 :reset => [:drop, :create]
100
-
97
+ task reset: [:drop, :create]
101
98
  end
102
99
 
103
- task :doc => :yard
100
+ task doc: :yard
104
101
 
105
102
  task :docs do
106
- sh %{git checkout gh-pages && rake doc && git checkout @{-1}}
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 { yield ; raise ActiveRecord::Rollback }
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, :use => :slugged
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, :use => :history
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, :use => :finders
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 << (Book.create! :name => name).id
42
- JOURNALISTS << (Journalist.create! :name => name).friendly_id
43
- MANUALS << (Manual.create! :name => name).friendly_id
44
- RESTAURANTS << (Restaurant.create! :name => name).friendly_id
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 'find (without FriendlyId)' do
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 'find (in-table slug)' do
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 'find (in-table slug; using finders module)' do
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 'find (external slug)' do
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 'insert (without FriendlyId)' do
67
- N.times {transaction {Book.create :name => FFaker::Name.name}}
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 'insert (in-table-slug)' do
71
- N.times {transaction {Journalist.create :name => FFaker::Name.name}}
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 'insert (in-table-slug; using finders module)' do
75
- N.times {transaction {Restaurant.create :name => FFaker::Name.name}}
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 'insert (external slug)' do
79
- N.times {transaction {Manual.create :name => FFaker::Name.name}}
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
- MIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z
3
- L0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjAwNTEwMjIxOTQ2WhcNMjEwNTEwMjIx
4
- OTQ2WjAjMSEwHwYDVQQDDBhnZW1zL0RDPXAvRE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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 = "friendly_id"
6
- s.version = FriendlyId::VERSION
7
- s.authors = ["Norman Clarke", "Philip Arndt"]
8
- s.email = ["norman@njclarke.com", "p@arndt.io"]
9
- s.homepage = "https://github.com/norman/friendly_id"
10
- s.summary = "A comprehensive slugging and pretty-URL plugin."
11
- s.files = `git ls-files`.split("\n")
12
- s.test_files = `git ls-files -- {test}/*`.split("\n")
13
- s.require_paths = ["lib"]
14
- s.license = 'MIT'
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 = '>= 2.1.0'
15
+ s.required_ruby_version = ">= 2.1.0"
17
16
 
18
- s.add_dependency 'activerecord', '>= 4.0.0'
17
+ s.add_dependency "activerecord", ">= 4.0.0"
19
18
 
20
- s.add_development_dependency 'coveralls'
21
- s.add_development_dependency 'railties', '>= 4.0'
22
- s.add_development_dependency 'minitest', '~> 5.3'
23
- s.add_development_dependency 'mocha', '~> 1.1'
24
- s.add_development_dependency 'yard'
25
- s.add_development_dependency 'i18n'
26
- s.add_development_dependency 'ffaker'
27
- s.add_development_dependency 'simplecov'
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 = <<-EOM
30
- FriendlyId is the "Swiss Army bulldozer" of slugging and permalink plugins for
31
- Active Record. It lets you create pretty URLs and work with human-friendly
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('certs/parndt.pem', __dir__)]
36
- if $PROGRAM_NAME =~ /gem\z/ && ARGV.include?('build') && ARGV.include?(__FILE__)
37
- s.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
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 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gemspec path: '../'
3
+ gemspec path: "../"
4
4
 
5
- gem 'activerecord', '~> 5.2.0'
6
- gem 'railties', '~> 5.2.0'
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 'activerecord-jdbcmysql-adapter', '~> 51.1'
12
- gem 'activerecord-jdbcpostgresql-adapter', '~> 51.1'
13
- gem 'kramdown'
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 'sqlite3'
18
- gem 'mysql2'
19
- gem 'pg'
20
- gem 'redcarpet'
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 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gemspec path: '../'
3
+ gemspec path: "../"
4
4
 
5
- gem 'activerecord', '~> 6.0.0'
6
- gem 'railties', '~> 6.0.0'
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 'activerecord-jdbcmysql-adapter', '~> 51.1'
12
- gem 'activerecord-jdbcpostgresql-adapter', '~> 51.1'
13
- gem 'kramdown'
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 'sqlite3'
18
- gem 'mysql2'
19
- gem 'pg'
20
- gem 'redcarpet'
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