mongoid-cn-permalink 0.0.1 → 0.0.2

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDJmMzExZDIxYTlhMGMzZjNlYTYzYzlhNGU4YjdiMTE2ODViN2Q3MQ==
5
+ data.tar.gz: !binary |-
6
+ OGIzNGNiMDhjMTQ4YTM0NTU4Yzg1MWUyYTVkOGJlMzE3MGQ4MTJiNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NzY3OGFhYTllMTQ5OTY2YTc1Y2VkZmE0NzlmMGVlNmQ1MTRjODk1Mjg1MTE5
10
+ ZTUwZmMzZmRjNTU2MjBmZDc2MDhjY2M5MmI5MDFmM2EzM2ZkNzg3YjViMWYz
11
+ YjFiYWZkNDg0ODM0ZGVkZmEwZDJlZDI1MjE5NjNhYTc4ZTZiMGU=
12
+ data.tar.gz: !binary |-
13
+ OWYyMjU4ZjE4NDkzZTE2ZjhkMzhmMmU1MzRhNjVhYmZjM2Q2NDliNGZlYjFl
14
+ ZGJlZDViYWY5OGQyNDQzMGM2YjNjNmU4NDJlYjdkMTk5OWJjY2FiZWY4MDg5
15
+ YmJmOGVkMjNiMTBkMjM1OWVlZjQ4YjIyMDkzOWEyNDk1MDg3NTk=
@@ -54,7 +54,7 @@ module MongoidCnPermalink
54
54
  def create_unique_permalink
55
55
  permalink_old = permalink
56
56
  suffix = 1
57
- while !exist_permalink?(permalink_old) do
57
+ while exist_permalink?(permalink_old) do
58
58
  permalink_old = permalink + suffix.to_s
59
59
  suffix = suffix +1
60
60
  end
@@ -66,11 +66,8 @@ module MongoidCnPermalink
66
66
  end
67
67
 
68
68
  def exist_permalink?(current_permalink)
69
- self.class.find_by_permalink(current_permalink) == self || !self.class.find_by_permalink(current_permalink)
69
+ self.class.find_by_permalink(current_permalink) == self || !self.class.superclass.find_by_permalink(current_permalink).nil?
70
70
  end
71
-
72
-
73
-
74
71
  end
75
72
 
76
73
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidCnPermalink
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-cn-permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Richie Min
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-16 00:00:00.000000000 Z
11
+ date: 2013-08-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
- requirement: &70200345975640 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.12
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70200345975640
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.12
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: chinese_pinyin
27
- requirement: &70200345975000 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70200345975000
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  description: Generate Permalink on Mongoid. Specially on stored chinese words.
37
42
  email:
38
43
  - minruiqi@gmail.com
@@ -78,27 +83,26 @@ files:
78
83
  - test/test_helper.rb
79
84
  homepage: http://rubygems.org/gems/mongoid-cn-permalink
80
85
  licenses: []
86
+ metadata: {}
81
87
  post_install_message:
82
88
  rdoc_options: []
83
89
  require_paths:
84
90
  - lib
85
91
  required_ruby_version: !ruby/object:Gem::Requirement
86
- none: false
87
92
  requirements:
88
93
  - - ! '>='
89
94
  - !ruby/object:Gem::Version
90
95
  version: '0'
91
96
  required_rubygems_version: !ruby/object:Gem::Requirement
92
- none: false
93
97
  requirements:
94
98
  - - ! '>='
95
99
  - !ruby/object:Gem::Version
96
100
  version: '0'
97
101
  requirements: []
98
102
  rubyforge_project:
99
- rubygems_version: 1.8.10
103
+ rubygems_version: 2.0.5
100
104
  signing_key:
101
- specification_version: 3
105
+ specification_version: 4
102
106
  summary: Generate Permalink on Mongoid.
103
107
  test_files:
104
108
  - test/dummy/app/assets/javascripts/application.js
@@ -131,3 +135,4 @@ test_files:
131
135
  - test/dummy/script/rails
132
136
  - test/mongoid-cn-permalink_test.rb
133
137
  - test/test_helper.rb
138
+ has_rdoc: