friendly_slug 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f688160f59ae274113999004a6473e04049016eb6a751983ba8ab2227ddf25e
4
- data.tar.gz: a796ab9833008f360b729047c7c79354d6bc1b376e1719e3190445a52afb09d0
3
+ metadata.gz: ebf392ed47eafd49b36ea1a3acb3e67d5c1da79b2829d41962b939a5ed058fd4
4
+ data.tar.gz: 0150d34818e1bd606e67ceaf5c1857006a561b783294f9fe6732f20bac3ea915
5
5
  SHA512:
6
- metadata.gz: 443c40412b330fa9c0828de2d10c1ec49712ef5dc7c9f7911b0255adde2ee224f89301b8de700b6998e0e4a893652a1a89a8a6a59bf2a979616a9bddc63358ef
7
- data.tar.gz: 5310821fe4dd6f3fbfb5436c4394d62427c1358bf3747bb54f1419b0cfafd35b358937ac36e36088361bbd915bc68c5947098a0b2428f053cc3410d7c438cf45
6
+ metadata.gz: eecbbbca7f5a3690d8112f532e4d3e9bbb4356a0ac3b060f80f0c05a8f8d9474a705e9ad3535b245d89ad99728e8d0cc231ed8272f52ebe1083b2112acdd46c4
7
+ data.tar.gz: e81abb4fcbad63ddff3324bce90587cf8c7a738a9bae936c57792092455104f8b98ab7b802d419e2fc75db9504a1f7f7e2fa734f045c409b08f5863d6f9c1bd3
@@ -0,0 +1 @@
1
+ 2.5.0
@@ -1,5 +1,10 @@
1
1
  sudo: false
2
+
2
3
  language: ruby
4
+
3
5
  rvm:
4
6
  - 2.5.0
5
- before_install: gem install bundler -v 1.16.1
7
+
8
+ before_script: "cd friendly_slug_gem_test && bundle exec rake db:create && bundle exec rake db:migrate"
9
+
10
+ script: "bundle exec rake test"
data/Gemfile CHANGED
@@ -4,3 +4,33 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in friendly_slug.gemspec
6
6
  gemspec
7
+
8
+ ruby '2.5.0'
9
+
10
+ gem 'rails', '~> 5.2.0'
11
+ gem 'sqlite3'
12
+ gem 'puma', '~> 3.11'
13
+ gem 'sass-rails', '~> 5.0'
14
+ gem 'uglifier', '>= 1.3.0'
15
+ gem 'coffee-rails', '~> 4.2'
16
+ gem 'turbolinks', '~> 5'
17
+ gem 'jbuilder', '~> 2.5'
18
+ gem 'bootsnap', '>= 1.1.0', require: false
19
+
20
+ group :development, :test do
21
+ gem 'pry'
22
+ end
23
+
24
+ group :development do
25
+ gem 'web-console', '>= 3.3.0'
26
+ gem 'listen', '>= 3.0.5', '< 3.2'
27
+ gem 'spring'
28
+ gem 'spring-watcher-listen', '~> 2.0.0'
29
+ end
30
+
31
+ group :test do
32
+ gem 'capybara', '>= 2.15', '< 4.0'
33
+ gem 'selenium-webdriver'
34
+ gem 'chromedriver-helper'
35
+ gem 'database_cleaner'
36
+ end
@@ -0,0 +1,229 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ friendly_slug (0.1.8)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.2.3)
10
+ actionpack (= 5.2.3)
11
+ nio4r (~> 2.0)
12
+ websocket-driver (>= 0.6.1)
13
+ actionmailer (5.2.3)
14
+ actionpack (= 5.2.3)
15
+ actionview (= 5.2.3)
16
+ activejob (= 5.2.3)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.2.3)
20
+ actionview (= 5.2.3)
21
+ activesupport (= 5.2.3)
22
+ rack (~> 2.0)
23
+ rack-test (>= 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.2.3)
27
+ activesupport (= 5.2.3)
28
+ builder (~> 3.1)
29
+ erubi (~> 1.4)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.2.3)
33
+ activesupport (= 5.2.3)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.2.3)
36
+ activesupport (= 5.2.3)
37
+ activerecord (5.2.3)
38
+ activemodel (= 5.2.3)
39
+ activesupport (= 5.2.3)
40
+ arel (>= 9.0)
41
+ activestorage (5.2.3)
42
+ actionpack (= 5.2.3)
43
+ activerecord (= 5.2.3)
44
+ marcel (~> 0.3.1)
45
+ activesupport (5.2.3)
46
+ concurrent-ruby (~> 1.0, >= 1.0.2)
47
+ i18n (>= 0.7, < 2)
48
+ minitest (~> 5.1)
49
+ tzinfo (~> 1.1)
50
+ addressable (2.7.0)
51
+ public_suffix (>= 2.0.2, < 5.0)
52
+ archive-zip (0.12.0)
53
+ io-like (~> 0.3.0)
54
+ arel (9.0.0)
55
+ bindex (0.8.1)
56
+ bootsnap (1.4.5)
57
+ msgpack (~> 1.0)
58
+ builder (3.2.3)
59
+ capybara (3.29.0)
60
+ addressable
61
+ mini_mime (>= 0.1.3)
62
+ nokogiri (~> 1.8)
63
+ rack (>= 1.6.0)
64
+ rack-test (>= 0.6.3)
65
+ regexp_parser (~> 1.5)
66
+ xpath (~> 3.2)
67
+ childprocess (3.0.0)
68
+ chromedriver-helper (2.1.1)
69
+ archive-zip (~> 0.10)
70
+ nokogiri (~> 1.8)
71
+ coderay (1.1.2)
72
+ coffee-rails (4.2.2)
73
+ coffee-script (>= 2.2.0)
74
+ railties (>= 4.0.0)
75
+ coffee-script (2.4.1)
76
+ coffee-script-source
77
+ execjs
78
+ coffee-script-source (1.12.2)
79
+ concurrent-ruby (1.1.5)
80
+ crass (1.0.4)
81
+ database_cleaner (1.7.0)
82
+ erubi (1.9.0)
83
+ execjs (2.7.0)
84
+ ffi (1.11.1)
85
+ globalid (0.4.2)
86
+ activesupport (>= 4.2.0)
87
+ i18n (1.6.0)
88
+ concurrent-ruby (~> 1.0)
89
+ io-like (0.3.0)
90
+ jbuilder (2.9.1)
91
+ activesupport (>= 4.2.0)
92
+ listen (3.1.5)
93
+ rb-fsevent (~> 0.9, >= 0.9.4)
94
+ rb-inotify (~> 0.9, >= 0.9.7)
95
+ ruby_dep (~> 1.2)
96
+ loofah (2.3.0)
97
+ crass (~> 1.0.2)
98
+ nokogiri (>= 1.5.9)
99
+ mail (2.7.1)
100
+ mini_mime (>= 0.1.1)
101
+ marcel (0.3.3)
102
+ mimemagic (~> 0.3.2)
103
+ method_source (0.9.2)
104
+ mimemagic (0.3.3)
105
+ mini_mime (1.0.2)
106
+ mini_portile2 (2.4.0)
107
+ minitest (5.12.2)
108
+ msgpack (1.3.1)
109
+ nio4r (2.5.2)
110
+ nokogiri (1.10.4)
111
+ mini_portile2 (~> 2.4.0)
112
+ pry (0.12.2)
113
+ coderay (~> 1.1.0)
114
+ method_source (~> 0.9.0)
115
+ public_suffix (4.0.1)
116
+ puma (3.12.1)
117
+ rack (2.0.7)
118
+ rack-test (1.1.0)
119
+ rack (>= 1.0, < 3)
120
+ rails (5.2.3)
121
+ actioncable (= 5.2.3)
122
+ actionmailer (= 5.2.3)
123
+ actionpack (= 5.2.3)
124
+ actionview (= 5.2.3)
125
+ activejob (= 5.2.3)
126
+ activemodel (= 5.2.3)
127
+ activerecord (= 5.2.3)
128
+ activestorage (= 5.2.3)
129
+ activesupport (= 5.2.3)
130
+ bundler (>= 1.3.0)
131
+ railties (= 5.2.3)
132
+ sprockets-rails (>= 2.0.0)
133
+ rails-dom-testing (2.0.3)
134
+ activesupport (>= 4.2.0)
135
+ nokogiri (>= 1.6)
136
+ rails-html-sanitizer (1.2.0)
137
+ loofah (~> 2.2, >= 2.2.2)
138
+ railties (5.2.3)
139
+ actionpack (= 5.2.3)
140
+ activesupport (= 5.2.3)
141
+ method_source
142
+ rake (>= 0.8.7)
143
+ thor (>= 0.19.0, < 2.0)
144
+ rake (13.0.0)
145
+ rb-fsevent (0.10.3)
146
+ rb-inotify (0.10.0)
147
+ ffi (~> 1.0)
148
+ regexp_parser (1.6.0)
149
+ ruby_dep (1.5.0)
150
+ rubyzip (2.0.0)
151
+ sass (3.7.4)
152
+ sass-listen (~> 4.0.0)
153
+ sass-listen (4.0.0)
154
+ rb-fsevent (~> 0.9, >= 0.9.4)
155
+ rb-inotify (~> 0.9, >= 0.9.7)
156
+ sass-rails (5.1.0)
157
+ railties (>= 5.2.0)
158
+ sass (~> 3.1)
159
+ sprockets (>= 2.8, < 4.0)
160
+ sprockets-rails (>= 2.0, < 4.0)
161
+ tilt (>= 1.1, < 3)
162
+ selenium-webdriver (3.142.6)
163
+ childprocess (>= 0.5, < 4.0)
164
+ rubyzip (>= 1.2.2)
165
+ spring (2.1.0)
166
+ spring-watcher-listen (2.0.1)
167
+ listen (>= 2.7, < 4.0)
168
+ spring (>= 1.2, < 3.0)
169
+ sprockets (3.7.2)
170
+ concurrent-ruby (~> 1.0)
171
+ rack (> 1, < 3)
172
+ sprockets-rails (3.2.1)
173
+ actionpack (>= 4.0)
174
+ activesupport (>= 4.0)
175
+ sprockets (>= 3.0.0)
176
+ sqlite3 (1.4.1)
177
+ thor (0.20.3)
178
+ thread_safe (0.3.6)
179
+ tilt (2.0.10)
180
+ turbolinks (5.2.1)
181
+ turbolinks-source (~> 5.2)
182
+ turbolinks-source (5.2.0)
183
+ tzinfo (1.2.5)
184
+ thread_safe (~> 0.1)
185
+ uglifier (4.2.0)
186
+ execjs (>= 0.3.0, < 3)
187
+ web-console (3.7.0)
188
+ actionview (>= 5.0)
189
+ activemodel (>= 5.0)
190
+ bindex (>= 0.4.0)
191
+ railties (>= 5.0)
192
+ websocket-driver (0.7.1)
193
+ websocket-extensions (>= 0.1.0)
194
+ websocket-extensions (0.1.4)
195
+ xpath (3.2.0)
196
+ nokogiri (~> 1.8)
197
+
198
+ PLATFORMS
199
+ ruby
200
+
201
+ DEPENDENCIES
202
+ activemodel (> 3.0)
203
+ bootsnap (>= 1.1.0)
204
+ bundler (> 1.16)
205
+ capybara (>= 2.15, < 4.0)
206
+ chromedriver-helper
207
+ coffee-rails (~> 4.2)
208
+ database_cleaner
209
+ friendly_slug!
210
+ jbuilder (~> 2.5)
211
+ listen (>= 3.0.5, < 3.2)
212
+ pry
213
+ puma (~> 3.11)
214
+ rails (~> 5.2.0)
215
+ rake (> 10.0)
216
+ sass-rails (~> 5.0)
217
+ selenium-webdriver
218
+ spring
219
+ spring-watcher-listen (~> 2.0.0)
220
+ sqlite3
221
+ turbolinks (~> 5)
222
+ uglifier (>= 1.3.0)
223
+ web-console (>= 3.3.0)
224
+
225
+ RUBY VERSION
226
+ ruby 2.5.0p0
227
+
228
+ BUNDLED WITH
229
+ 2.0.2
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/friendly_slug.svg)](https://badge.fury.io/rb/friendly_slug)
2
+ [![Build Status](https://travis-ci.org/samholst/friendly_slug.svg?branch=master)](https://travis-ci.org/samholst/friendly_slug)
3
+
1
4
  # FriendlySlug
2
5
 
3
6
  Friendly Slug is meant to dynamically create SEO friendly URL links. It is extremely lightweight and non resource intensive. Friendly Slug ties directly into the Rails URL Helpers so you dont
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
2
+ require 'rake/testtask'
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.pattern = 'friendly_slug_gem_test/test/**/*_test.rb'
6
+ t.verbose = false
7
+ end
5
8
 
6
- task :default => :spec
9
+ task default: :test
@@ -57,9 +57,15 @@ module FriendlySlug
57
57
  end
58
58
 
59
59
  def _create_slug
60
- self.class._friendly_attribute_list.map do |attribute|
60
+ fresh_slug = self.class._friendly_attribute_list.map do |attribute|
61
61
  _lookup_key(self.class.send("_friendly_#{attribute.to_s}_key")).to_s
62
- end.join("-").gsub(/<\/?[^>]*>|[^\.\w\s-]/, '').strip.downcase.gsub(/\s{1,}|\./, '-').gsub(/-{2,}/, "-")
62
+ end.
63
+ join("-").
64
+ gsub(/<\/?[^>]*>|[^\.\w\s-]/, '').
65
+ strip.downcase.gsub(/\s{1,}|\./, '-').
66
+ gsub(/-{2,}/, "-")
67
+
68
+ fresh_slug[-1] == "-" ? fresh_slug[0...-1] : fresh_slug
63
69
  end
64
70
 
65
71
  def _unique_attribute_changed?
@@ -1,3 +1,3 @@
1
1
  module FriendlySlug
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_slug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Holst
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-30 00:00:00.000000000 Z
11
+ date: 2019-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,9 +66,11 @@ extra_rdoc_files: []
66
66
  files:
67
67
  - ".gitignore"
68
68
  - ".rspec"
69
+ - ".ruby-version"
69
70
  - ".travis.yml"
70
71
  - CODE_OF_CONDUCT.md
71
72
  - Gemfile
73
+ - Gemfile.lock
72
74
  - LICENSE.txt
73
75
  - README.md
74
76
  - Rakefile
@@ -97,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
99
  - !ruby/object:Gem::Version
98
100
  version: '0'
99
101
  requirements: []
100
- rubyforge_project:
101
- rubygems_version: 2.7.3
102
+ rubygems_version: 3.0.6
102
103
  signing_key:
103
104
  specification_version: 4
104
105
  summary: Generate a model specific SEO URL friendly slug.