parameterize 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ gemfile:
5
+ - gemfiles/Gemfile.activerecord-3.0.x
6
+ - gemfiles/Gemfile.activerecord-3.1.x
7
+
data/README.md CHANGED
@@ -6,17 +6,18 @@ It uses ActiveSupport's `String#parameterize` to create the slug. There are no v
6
6
 
7
7
  ## Getting Started
8
8
 
9
- ```ruby
9
+ ``` ruby
10
10
  # Gemfile
11
11
  gem 'parameterize'
12
12
  ```
13
13
 
14
- ```
15
- bundle install
16
- rails generate model User name:string param:string
14
+ ``` bash
15
+ $ bundle install
16
+ $ rails generate model User name:string param:string
17
+ # Parameterize requires a string column named 'param'
17
18
  ```
18
19
 
19
- ```ruby
20
+ ``` ruby
20
21
  # models/user.rb
21
22
  class User < ActiveRecord::Base
22
23
  parameterize :name
@@ -33,7 +34,7 @@ user.to_param = 'john-doe'
33
34
 
34
35
  Validations **are not** included. I prefer to be able to customize my validations directly in the model. The most common validations you would add are:
35
36
 
36
- ```ruby
37
+ ``` ruby
37
38
  class Post < ActiveRecord::Base
38
39
  parameterize
39
40
  validates_presence_of :param
@@ -43,7 +44,7 @@ end
43
44
 
44
45
  You could easily use [Babosa's](http://github.com/norman/babosa) #to_identifier or [Stringex's](http://github.com/rsl/stringex) #to_url instead of ActiveSupport's #parameterize by just aliasing the method you want to use:
45
46
 
46
- ```ruby
47
+ ``` ruby
47
48
  require 'babosa'
48
49
  class String
49
50
  alias :parameterize :to_identifier
@@ -52,7 +53,7 @@ end
52
53
 
53
54
  There is also a Shoulda-style RSpec matcher available for use in your specs:
54
55
 
55
- ```ruby
56
+ ``` ruby
56
57
  # spec_helper.rb
57
58
  require 'parameterize/matcher'
58
59
 
@@ -0,0 +1,10 @@
1
+ source :rubygems
2
+
3
+ gem 'activerecord', '~> 3.0.0'
4
+ gem 'activesupport', '~> 3.0.0'
5
+
6
+ group :development do
7
+ gem 'rake', '>= 0.8.7'
8
+ gem 'rspec', '~> 2.6.0'
9
+ gem 'sqlite3-ruby', '~> 1.3.3'
10
+ end
@@ -0,0 +1,10 @@
1
+ source :rubygems
2
+
3
+ gem 'activerecord', '~> 3.1.0.rc1'
4
+ gem 'activesupport', '~> 3.1.0.rc1'
5
+
6
+ group :development do
7
+ gem 'rake', '>= 0.8.7'
8
+ gem 'rspec', '~> 2.6.0'
9
+ gem 'sqlite3-ruby', '~> 1.3.3'
10
+ end
@@ -30,4 +30,8 @@ module Parameterize
30
30
  end
31
31
  end
32
32
 
33
- require 'parameterize/railtie' if defined?(Rails)
33
+ if defined?(ActiveRecord)
34
+ ActiveRecord::Base.extend Parameterize
35
+ elsif defined?(Rails)
36
+ require 'parameterize/railtie'
37
+ end
@@ -1,3 +1,3 @@
1
1
  module Parameterize
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
6
6
  s.name = 'parameterize'
7
7
  s.version = Parameterize::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.authors = %w(Pete Browne)
10
- s.email = %w(me@petebrowne.com)
9
+ s.authors = ['Pete Browne']
10
+ s.email = ['me@petebrowne.com']
11
11
  s.homepage = 'http://github.com/petebrowne/parameterize'
12
12
  s.summary = %{The simplest permalink/slug solution for ActiveRecord >= 3.0}
13
13
  s.description = %{It uses ActiveSupport's String#parameterize to create the slug. There are no validations. No slug history. No extra tables or models.}
@@ -16,8 +16,9 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency 'activerecord', '~> 3.0'
18
18
  s.add_dependency 'activesupport', '~> 3.0'
19
- s.add_development_dependency 'rspec', '~> 2.6.0'
20
- s.add_development_dependency 'sqlite3-ruby', '~> 1.3.3'
19
+ s.add_development_dependency 'rake', '>= 0.8.7'
20
+ s.add_development_dependency 'rspec', '~> 2.6'
21
+ s.add_development_dependency 'sqlite3-ruby', '~> 1.3'
21
22
 
22
23
  s.files = `git ls-files`.split("\n")
23
24
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,22 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parameterize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
- - Pete
14
- - Browne
13
+ - Pete Browne
15
14
  autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-07-19 00:00:00 Z
18
+ date: 2011-08-30 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: activerecord
@@ -49,37 +48,51 @@ dependencies:
49
48
  type: :runtime
50
49
  version_requirements: *id002
51
50
  - !ruby/object:Gem::Dependency
52
- name: rspec
51
+ name: rake
53
52
  prerelease: false
54
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 49
59
+ segments:
60
+ - 0
61
+ - 8
62
+ - 7
63
+ version: 0.8.7
64
+ type: :development
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: rspec
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
55
70
  none: false
56
71
  requirements:
57
72
  - - ~>
58
73
  - !ruby/object:Gem::Version
59
- hash: 23
74
+ hash: 15
60
75
  segments:
61
76
  - 2
62
77
  - 6
63
- - 0
64
- version: 2.6.0
78
+ version: "2.6"
65
79
  type: :development
66
- version_requirements: *id003
80
+ version_requirements: *id004
67
81
  - !ruby/object:Gem::Dependency
68
82
  name: sqlite3-ruby
69
83
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
84
+ requirement: &id005 !ruby/object:Gem::Requirement
71
85
  none: false
72
86
  requirements:
73
87
  - - ~>
74
88
  - !ruby/object:Gem::Version
75
- hash: 29
89
+ hash: 9
76
90
  segments:
77
91
  - 1
78
92
  - 3
79
- - 3
80
- version: 1.3.3
93
+ version: "1.3"
81
94
  type: :development
82
- version_requirements: *id004
95
+ version_requirements: *id005
83
96
  description: It uses ActiveSupport's String#parameterize to create the slug. There are no validations. No slug history. No extra tables or models.
84
97
  email:
85
98
  - me@petebrowne.com
@@ -91,10 +104,13 @@ extra_rdoc_files: []
91
104
 
92
105
  files:
93
106
  - .gitignore
107
+ - .travis.yml
94
108
  - Gemfile
95
109
  - LICENSE
96
110
  - README.md
97
111
  - Rakefile
112
+ - gemfiles/Gemfile.activerecord-3.0.x
113
+ - gemfiles/Gemfile.activerecord-3.1.x
98
114
  - lib/parameterize.rb
99
115
  - lib/parameterize/matcher.rb
100
116
  - lib/parameterize/railtie.rb