mongoid_permalink_extension 0.1.0 → 0.1.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afa92956e8ef6a3711242da5394ab3038cc67018
|
4
|
+
data.tar.gz: febc6cd2b8d1e6ac4c6af461dde98803d747bf17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835869deffcb225a7c79497637521612f9a6f04fdf183d56ad9bfc34555759f05f4c7aaee5bf18dfa401a3b5a99a41594e7d0f42d83a8f35c4356084ba90ea24
|
7
|
+
data.tar.gz: b628f68a4374240bd153783b52dba029974adcb53aa5e2ceab5a663a5e865d7c753c817d6bf064fd002daabea1c635ff6bb699c2d996ec4778f9481632992ab6
|
data/.gitignore
CHANGED
@@ -34,11 +34,11 @@ describe MongoidPermalinkExtension::Permalink do
|
|
34
34
|
MongoidPermalinkExtension::Permalink.mongoize(nil).must_be_nil
|
35
35
|
end
|
36
36
|
it 'converts spaces to hyphens' do
|
37
|
-
MongoidPermalinkExtension::Permalink.mongoize(" ").must_equal '-'
|
38
|
-
MongoidPermalinkExtension::Permalink.mongoize(" ").must_equal '-'
|
37
|
+
MongoidPermalinkExtension::Permalink.mongoize("A B").must_equal 'A-B'
|
38
|
+
MongoidPermalinkExtension::Permalink.mongoize("A B").must_equal 'A-B'
|
39
39
|
end
|
40
40
|
it 'converts slashes to hyphens' do
|
41
|
-
MongoidPermalinkExtension::Permalink.mongoize("/").must_equal '-'
|
41
|
+
MongoidPermalinkExtension::Permalink.mongoize("A/B").must_equal 'A-B'
|
42
42
|
end
|
43
43
|
it 'converts to camel case' do
|
44
44
|
MongoidPermalinkExtension::Permalink.mongoize("hello hello").wont_include 'h'
|
@@ -56,16 +56,20 @@ describe MongoidPermalinkExtension::Permalink do
|
|
56
56
|
MongoidPermalinkExtension::Permalink.mongoize("Camel--Case").must_equal 'Camel-Case'
|
57
57
|
end
|
58
58
|
it 'converts all dashes to hyphens' do
|
59
|
-
MongoidPermalinkExtension::Permalink.mongoize("–").must_equal '-'
|
60
|
-
MongoidPermalinkExtension::Permalink.mongoize("----–").must_equal '-'
|
61
|
-
MongoidPermalinkExtension::Permalink.mongoize("—").must_equal '-'
|
62
|
-
MongoidPermalinkExtension::Permalink.mongoize("—––––––").must_equal '-'
|
59
|
+
MongoidPermalinkExtension::Permalink.mongoize("A–Z").must_equal 'A-Z'
|
60
|
+
MongoidPermalinkExtension::Permalink.mongoize("A----–Z").must_equal 'A-Z'
|
61
|
+
MongoidPermalinkExtension::Permalink.mongoize("A—Z").must_equal 'A-Z'
|
62
|
+
MongoidPermalinkExtension::Permalink.mongoize("A—––––––Z").must_equal 'A-Z'
|
63
63
|
end
|
64
64
|
it 'remove non-alphanumeric characters' do
|
65
|
-
%w(?!@#$%^&*()+=.,;<>[]).shuffle.each do |i|
|
65
|
+
%w(?!@#$%^&*()+=.,;<>[]“”).shuffle.each do |i|
|
66
66
|
MongoidPermalinkExtension::Permalink.mongoize(i).wont_include i
|
67
67
|
end
|
68
68
|
end
|
69
|
+
it 'does not start with a hyphen' do
|
70
|
+
MongoidPermalinkExtension::Permalink.mongoize("“Yes” to a Historic Moment").must_equal "Yes-To-A-Historic-Moment"
|
71
|
+
MongoidPermalinkExtension::Permalink.mongoize("¿Yes?").must_equal "Yes"
|
72
|
+
end
|
69
73
|
it 'preserves accented characters' do
|
70
74
|
MongoidPermalinkExtension::Permalink.mongoize('Bienále Brno Česká republika').must_equal 'Bienale-Brno-Ceska-Republika'
|
71
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_permalink_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|