draper 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/draper/base.rb CHANGED
@@ -21,7 +21,7 @@ module Draper
21
21
  end
22
22
 
23
23
  def self.decorates(input)
24
- self.model_class = input.to_s.classify.constantize
24
+ self.model_class = input.to_s.camelize.constantize
25
25
  model_class.send :include, Draper::ModelSupport
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module Draper
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
data/spec/base_spec.rb CHANGED
@@ -20,7 +20,17 @@ describe Draper::Base do
20
20
 
21
21
  context(".decorates") do
22
22
  it "sets the model class for the decorator" do
23
- ProductDecorator.new(source).model_class == Product
23
+ ProductDecorator.new(source).model_class.should == Product
24
+ end
25
+
26
+ it "should handle plural-like words properly'" do
27
+ class Business; end
28
+ expect do
29
+ class BusinessDecorator < Draper::Base
30
+ decorates:business
31
+ end
32
+ BusinessDecorator.model_class.should == Business
33
+ end.should_not raise_error
24
34
  end
25
35
  end
26
36
 
metadata CHANGED
@@ -1,180 +1,123 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: draper
3
- version: !ruby/object:Gem::Version
4
- hash: 1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jeff Casimir
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-08-28 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-28 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rake
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70298759756220 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- hash: 49
29
- segments:
30
- - 0
31
- - 8
32
- - 7
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
33
21
  version: 0.8.7
34
22
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rspec
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70298759756220
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ requirement: &70298759755700 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 13
45
- segments:
46
- - 2
47
- - 0
48
- - 1
31
+ - !ruby/object:Gem::Version
49
32
  version: 2.0.1
50
33
  type: :development
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: activesupport
54
34
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70298759755700
36
+ - !ruby/object:Gem::Dependency
37
+ name: activesupport
38
+ requirement: &70298759755200 !ruby/object:Gem::Requirement
56
39
  none: false
57
- requirements:
40
+ requirements:
58
41
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 21
61
- segments:
62
- - 3
63
- - 0
64
- - 9
42
+ - !ruby/object:Gem::Version
65
43
  version: 3.0.9
66
44
  type: :development
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: actionpack
70
45
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70298759755200
47
+ - !ruby/object:Gem::Dependency
48
+ name: actionpack
49
+ requirement: &70298759754680 !ruby/object:Gem::Requirement
72
50
  none: false
73
- requirements:
51
+ requirements:
74
52
  - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 21
77
- segments:
78
- - 3
79
- - 0
80
- - 9
53
+ - !ruby/object:Gem::Version
81
54
  version: 3.0.9
82
55
  type: :development
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: guard
86
56
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70298759754680
58
+ - !ruby/object:Gem::Dependency
59
+ name: guard
60
+ requirement: &70298759754180 !ruby/object:Gem::Requirement
88
61
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
96
66
  type: :development
97
- version_requirements: *id005
98
- - !ruby/object:Gem::Dependency
99
- name: guard-rspec
100
67
  prerelease: false
101
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70298759754180
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: &70298759739500 !ruby/object:Gem::Requirement
102
72
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- hash: 3
107
- segments:
108
- - 0
109
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
110
77
  type: :development
111
- version_requirements: *id006
112
- - !ruby/object:Gem::Dependency
113
- name: rb-fsevent
114
78
  prerelease: false
115
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70298759739500
80
+ - !ruby/object:Gem::Dependency
81
+ name: rb-fsevent
82
+ requirement: &70298759738820 !ruby/object:Gem::Requirement
116
83
  none: false
117
- requirements:
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- hash: 3
121
- segments:
122
- - 0
123
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
124
88
  type: :development
125
- version_requirements: *id007
126
- - !ruby/object:Gem::Dependency
127
- name: ruby-debug
128
89
  prerelease: false
129
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *70298759738820
91
+ - !ruby/object:Gem::Dependency
92
+ name: ruby-debug19
93
+ requirement: &70298759738380 !ruby/object:Gem::Requirement
130
94
  none: false
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- hash: 3
135
- segments:
136
- - 0
137
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
138
99
  type: :development
139
- version_requirements: *id008
140
- - !ruby/object:Gem::Dependency
141
- name: rcov
142
100
  prerelease: false
143
- requirement: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *70298759738380
102
+ - !ruby/object:Gem::Dependency
103
+ name: cover_me
104
+ requirement: &70298759737840 !ruby/object:Gem::Requirement
144
105
  none: false
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: 3
149
- segments:
150
- - 0
151
- version: "0"
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.0.rc6
152
110
  type: :development
153
- version_requirements: *id009
154
- - !ruby/object:Gem::Dependency
155
- name: launchy
156
111
  prerelease: false
157
- requirement: &id010 !ruby/object:Gem::Requirement
158
- none: false
159
- requirements:
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- hash: 3
163
- segments:
164
- - 0
165
- version: "0"
166
- type: :development
167
- version_requirements: *id010
168
- description: Draper reimagines the role of helpers in the view layer of a Rails application, allowing an object-oriented approach rather than procedural.
169
- email:
112
+ version_requirements: *70298759737840
113
+ description: Draper reimagines the role of helpers in the view layer of a Rails application,
114
+ allowing an object-oriented approach rather than procedural.
115
+ email:
170
116
  - jeff@casimircreative.com
171
117
  executables: []
172
-
173
118
  extensions: []
174
-
175
119
  extra_rdoc_files: []
176
-
177
- files:
120
+ files:
178
121
  - .gitignore
179
122
  - Gemfile
180
123
  - Guardfile
@@ -205,38 +148,29 @@ files:
205
148
  - spec/spec_helper.rb
206
149
  homepage: http://github.com/jcasimir/draper
207
150
  licenses: []
208
-
209
151
  post_install_message:
210
152
  rdoc_options: []
211
-
212
- require_paths:
153
+ require_paths:
213
154
  - lib
214
- required_ruby_version: !ruby/object:Gem::Requirement
155
+ required_ruby_version: !ruby/object:Gem::Requirement
215
156
  none: false
216
- requirements:
217
- - - ">="
218
- - !ruby/object:Gem::Version
219
- hash: 3
220
- segments:
221
- - 0
222
- version: "0"
223
- required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ! '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
162
  none: false
225
- requirements:
226
- - - ">="
227
- - !ruby/object:Gem::Version
228
- hash: 3
229
- segments:
230
- - 0
231
- version: "0"
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
232
167
  requirements: []
233
-
234
168
  rubyforge_project: draper
235
- rubygems_version: 1.8.6
169
+ rubygems_version: 1.8.10
236
170
  signing_key:
237
171
  specification_version: 3
238
172
  summary: Decorator pattern implmentation for Rails.
239
- test_files:
173
+ test_files:
240
174
  - spec/base_spec.rb
241
175
  - spec/draper/model_support_spec.rb
242
176
  - spec/samples/active_record.rb