mongoid_permalink_extension 0.0.1 → 0.0.2

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: 98afc802b3412519f89bbbbd3c1f0ea16fcb470f
4
- data.tar.gz: c26b501ab8d2fcf8fb9fbae808f5fda225f0df85
3
+ metadata.gz: fc0ea8bbe92ca2029b1f68a4c3c79b069224c537
4
+ data.tar.gz: 5b10800406a9c8e46de37982af384dbb1ac205b3
5
5
  SHA512:
6
- metadata.gz: 058569701ff2b746af74119d686a188b4373d2955a0dfc4acb85fb4b387b561c432d6ef50f650003e8a736541bd59c5e248ab59365cedfd753e3339ef9c766a1
7
- data.tar.gz: 140277531935221ef8dbc2b4650626d4026bf4bfaa5b22131ce78662153e915f9242991b6db44b146324ebe05b34f5202abe58a710653da25e5893c0af65d209
6
+ metadata.gz: 2617f90afbc0ee4eb3ae4c16829c03f562d723a0c9bb08fb812065774f75c5e722503042e5712a5c1e56516c1170918d4a93a292f1c81e61cb051644d2aa3ab3
7
+ data.tar.gz: 0a506ac5f04d984107dc300e8b1c324acb310091c0a654c6faff2b03633b2001a34331d1351dedc85845eb79d2f543e8d9bc9cc5a46b4bcfeeaf78d9f8542330
@@ -0,0 +1,8 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :minitest do
5
+ watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
6
+ watch(%r{^test/.+_test\.rb$})
7
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
8
+ end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Mongoid Permalink Extension
2
2
 
3
- [![Build Status](https://travis-ci.org/tomasc/mongoid_permalink_extension.svg)](https://travis-ci.org/tomasc/mongoid_permalink_extension) [![Coverage Status](https://img.shields.io/coveralls/tomasc/mongoid_permalink_extension.svg)](https://coveralls.io/r/tomasc/mongoid_permalink_extension)
3
+ [![Build Status](https://travis-ci.org/tomasc/mongoid_permalink_extension.svg)](https://travis-ci.org/tomasc/mongoid_permalink_extension) [![Gem Version](https://badge.fury.io/rb/mongoid_permalink_extension.svg)](http://badge.fury.io/rb/mongoid_permalink_extension) [![Coverage Status](https://img.shields.io/coveralls/tomasc/mongoid_permalink_extension.svg)](https://coveralls.io/r/tomasc/mongoid_permalink_extension)
4
4
 
5
5
  A [Mongoid](https://github.com/mongoid/mongoid) field extension that stores any String as a permalink slug.
6
6
 
@@ -28,12 +28,16 @@ Or install it yourself as:
28
28
 
29
29
  Add to Mongoid models as:
30
30
 
31
- field :permalink, type: MongoidPermalinkExtension::Permalink
31
+ ```ruby
32
+ field :permalink, type: MongoidPermalinkExtension::Permalink
33
+ ```
32
34
 
33
35
  Produces slugs in the form of:
34
36
 
35
37
  A-Hard-Days-Night
36
38
 
39
+ See tests for more examples.
40
+
37
41
  ## Contributing
38
42
 
39
43
  1. Fork it
@@ -15,8 +15,8 @@ module MongoidPermalinkExtension
15
15
  return if value.nil?
16
16
  value.to_s.
17
17
  gsub(/[–—]/, '-').
18
- gsub(/\s+/, '-').
19
18
  gsub(/[^\p{Alnum} -]/, '').
19
+ gsub(/\s+/, '-').
20
20
  gsub(/\b\w/){ $&.upcase }.
21
21
  to_ascii
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidPermalinkExtension
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -23,6 +23,8 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "coveralls"
26
+ spec.add_development_dependency "guard"
27
+ spec.add_development_dependency "guard-minitest"
26
28
  spec.add_development_dependency "minitest"
27
29
  spec.add_development_dependency "rake"
28
30
  end
@@ -55,6 +55,7 @@ module MongoidPermalinkExtension
55
55
  it 'produces nice slugs' do
56
56
  MongoidPermalinkExtension::Permalink.mongoize('Future Vocabularies?').must_equal 'Future-Vocabularies'
57
57
  MongoidPermalinkExtension::Permalink.mongoize('2011 space odyssey').must_equal '2011-Space-Odyssey'
58
+ MongoidPermalinkExtension::Permalink.mongoize('A permalink with & in it').must_equal 'A-Permalink-With-In-It'
58
59
  end
59
60
  end
60
61
 
@@ -4,6 +4,8 @@ require 'mongoid_permalink_extension'
4
4
  require 'minitest'
5
5
  require 'minitest/autorun'
6
6
  require 'minitest/spec'
7
- require 'coveralls'
8
7
 
9
- Coveralls.wear!
8
+ if ENV["CI"]
9
+ require "coveralls"
10
+ Coveralls.wear!
11
+ end
metadata CHANGED
@@ -1,97 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_permalink_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-14 00:00:00.000000000 Z
11
+ date: 2015-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: stringex
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
67
95
  - !ruby/object:Gem::Version
68
96
  version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: minitest
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - '>='
101
+ - - ">="
74
102
  - !ruby/object:Gem::Version
75
103
  version: '0'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - '>='
108
+ - - ">="
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rake
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - '>='
115
+ - - ">="
88
116
  - !ruby/object:Gem::Version
89
117
  version: '0'
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
- - - '>='
122
+ - - ">="
95
123
  - !ruby/object:Gem::Version
96
124
  version: '0'
97
125
  description: Custom field type for Mongoid that automatically converts strings to
@@ -102,10 +130,11 @@ executables: []
102
130
  extensions: []
103
131
  extra_rdoc_files: []
104
132
  files:
105
- - .coveralls.yml
106
- - .gitignore
107
- - .travis.yml
133
+ - ".coveralls.yml"
134
+ - ".gitignore"
135
+ - ".travis.yml"
108
136
  - Gemfile
137
+ - Guardfile
109
138
  - LICENSE
110
139
  - LICENSE.txt
111
140
  - README.md
@@ -126,17 +155,17 @@ require_paths:
126
155
  - lib
127
156
  required_ruby_version: !ruby/object:Gem::Requirement
128
157
  requirements:
129
- - - '>='
158
+ - - ">="
130
159
  - !ruby/object:Gem::Version
131
160
  version: '0'
132
161
  required_rubygems_version: !ruby/object:Gem::Requirement
133
162
  requirements:
134
- - - '>='
163
+ - - ">="
135
164
  - !ruby/object:Gem::Version
136
165
  version: '0'
137
166
  requirements: []
138
167
  rubyforge_project:
139
- rubygems_version: 2.1.10
168
+ rubygems_version: 2.2.2
140
169
  signing_key:
141
170
  specification_version: 4
142
171
  summary: Custom field type for Mongoid that automatically converts strings to URL
@@ -144,4 +173,3 @@ summary: Custom field type for Mongoid that automatically converts strings to UR
144
173
  test_files:
145
174
  - test/mongoid_permalink_extension/permalink_test.rb
146
175
  - test/test_helper.rb
147
- has_rdoc: