orange-more 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ require 'orange-more/administration/cartons/site'
2
+ require 'orange-more/administration/cartons/site_carton'
3
+ require 'orange-more/administration/cartons/user'
4
+ require 'orange-more/administration/resources/site_resource'
5
+ require 'orange-more/administration/resources/user_resource'
6
+ require 'orange-more/administration/resources/admin_resource'
7
+ require 'orange-more/administration/middleware/access_control'
8
+ require 'orange-more/administration/middleware/site_load'
@@ -77,6 +77,7 @@ module Orange::Middleware
77
77
  end
78
78
 
79
79
  def main_user?(packet)
80
+ return false if packet['user.id'].blank?
80
81
  id = packet['user.id'].gsub(/^https?:\/\//, '').gsub(/\/$/, '')
81
82
  users = orange.options['main_users'] || []
82
83
  users = users.dup.push(orange.options['main_user'])
@@ -1,7 +1,4 @@
1
- require (File.join(File.dirname(__FILE__), 'cartons', 'site.rb'))
2
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
3
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
4
- Dir.glob(File.join(File.dirname(__FILE__), 'middleware', '*.rb')).each {|f| require f }
1
+ require 'orange-more/administration/base'
5
2
 
6
3
  module Orange::Plugins
7
4
  class Administration < Base
@@ -0,0 +1,2 @@
1
+ require 'orange-more/analytics/resources/analytics_resource'
2
+ require 'orange-more/analytics/middleware/analytics'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'middleware', '*.rb')).each {|f| require f }
1
+ require 'orange-more/analytics/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class Analytics < Base
@@ -0,0 +1,2 @@
1
+ require 'orange-more/assets/cartons/asset_carton'
2
+ require 'orange-more/assets/resources/asset_resource'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/assets/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class Assets < Base
@@ -0,0 +1,4 @@
1
+ require 'orange-more/blog/cartons/blog'
2
+ require 'orange-more/blog/cartons/blog_post'
3
+ require 'orange-more/blog/resources/blog_resource'
4
+ require 'orange-more/blog/resources/blog_post_resource'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/blog/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class Blog < Base
@@ -0,0 +1 @@
1
+ require 'orange-more/cloud/resources/cloud_resource'
@@ -1,4 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/cloud/base'
2
2
 
3
3
  module Orange::Plugins
4
4
  class Cloud < Base
@@ -0,0 +1,2 @@
1
+ require 'orange-more/contactforms/cartons/contactform_carton'
2
+ require 'orange-more/contactforms/contactform_resource'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/contactforms/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class ContactForms < Base
@@ -0,0 +1 @@
1
+ require 'orange-more/debugger/middleware/debugger'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'middleware', '*.rb')).each {|f| require f }
2
-
1
+ require 'orange-more/debugger/base'
3
2
  module Orange::Plugins
4
3
  class Debugger < Base
5
4
  views_dir File.join(File.dirname(__FILE__), 'views')
@@ -0,0 +1 @@
1
+ require 'orange-more/disqus/resources/disqus_resource'
@@ -1,4 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/disqus/base'
2
2
 
3
3
  module Orange::Plugins
4
4
  class Disqus < Base
@@ -0,0 +1,2 @@
1
+ require 'orange-more/news/resources/news_resource'
2
+ require 'orange-more/news/cartson/news'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/news/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class News < Base
@@ -0,0 +1,4 @@
1
+ require 'orange-more/pages/cartons/page_carton'
2
+ require 'orange-more/pages/cartons/page_version_carton'
3
+ require 'orange-more/pages/middleware/dumb_quotes'
4
+ require 'orange-more/pages/resources/page_resource'
@@ -0,0 +1,53 @@
1
+ require 'orange-core/middleware/base'
2
+
3
+ module Orange::Middleware
4
+ class DumbQuotes < Base
5
+
6
+ # Passes packet then parses the return
7
+ def packet_call(packet)
8
+ no_smart_quotes! packet
9
+ pass packet
10
+ end
11
+
12
+ def no_smart_quotes!(packet)
13
+ deep_clean(packet.request.params) { |s| clean!(s) }
14
+ end
15
+
16
+ def deep_clean(hash, &block)
17
+ if hash.instance_of? String
18
+ yield(hash)
19
+ elsif hash.kind_of? Hash
20
+ hash.each_key { |h| deep_clean(hash[h]) { |s| block.call(s) } }
21
+ else
22
+ nil
23
+ end
24
+ end
25
+
26
+ def clean!(string)
27
+ string.gsub! "\342\200\230", "'"
28
+ string.gsub! "\342\200\231", "'"
29
+ string.gsub! "\342\200\234", '"'
30
+ string.gsub! "\342\200\235", '"'
31
+ string.gsub! "\342\200\230", "'"
32
+ string.gsub! "\342\200\231", "'"
33
+ string.gsub! "\xE2\x80\x93", '-'
34
+ string.gsub! "\xE2\x80\x94", '--'
35
+ string.gsub!(/\x82/,',')
36
+ string.gsub!(/\x84/,',,')
37
+ string.gsub!(/\x85/,'...')
38
+ string.gsub!(/\x88/,'^')
39
+ string.gsub!(/\x89/,'o/oo')
40
+ string.gsub!(/\x8b/,'<')
41
+ string.gsub!(/\x8c/,'OE')
42
+ string.gsub!(/\x91|\x92/,"'")
43
+ string.gsub!(/\x93|\x94/,'"')
44
+ string.gsub!(/\x95/,'*')
45
+ string.gsub!(/\x96/,'-')
46
+ string.gsub!(/\x97/,'--')
47
+ string.gsub!(/\x98/,'~')
48
+ string.gsub!(/\x99/,'TM')
49
+ string.gsub!(/\x9b/,'>')
50
+ string.gsub!(/\x9c/,'oe')
51
+ end
52
+ end
53
+ end
@@ -1,10 +1,9 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
1
+ require 'orange-more/pages/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class Pages < Base
6
5
  views_dir File.join(File.dirname(__FILE__), 'views')
7
-
6
+ prerouter Orange::Middleware::DumbQuotes
8
7
  resource Orange::PageResource.new
9
8
  end
10
9
  end
@@ -0,0 +1,3 @@
1
+ require 'orange-more/sitemap/cartons/route'
2
+ require 'orange-more/sitemap/middleware/flex_router'
3
+ require 'orange-more/sitemap/resources/sitemap_resource'
@@ -1,6 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'cartons', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
3
- Dir.glob(File.join(File.dirname(__FILE__), 'middleware', '*.rb')).each {|f| require f }
1
+ require 'orange-more/sitemap/base'
4
2
 
5
3
  module Orange::Plugins
6
4
  class Sitemap < Base
@@ -0,0 +1,3 @@
1
+ require 'orange-more/slices/middleware/radius_parser'
2
+ require 'orange-more/slices/resources/radius'
3
+ require 'orange-more/slices/resources/slices'
@@ -1,5 +1,4 @@
1
- Dir.glob(File.join(File.dirname(__FILE__), 'resources', '*.rb')).each {|f| require f }
2
- Dir.glob(File.join(File.dirname(__FILE__), 'middleware', '*.rb')).each {|f| require f }
1
+ require 'orange-more/slices/base'
3
2
 
4
3
  module Orange::Plugins
5
4
  class Slices < Base
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orange-more
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 6
9
- - 0
10
- version: 0.6.0
8
+ - 2
9
+ version: 0.6.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - David Haslem
@@ -15,18 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-08-23 00:00:00 -04:00
17
+ date: 2010-08-24 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: orange-core
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
- hash: 5
30
27
  segments:
31
28
  - 0
32
29
  - 5
@@ -38,11 +35,9 @@ dependencies:
38
35
  name: dm-is-awesome_set
39
36
  prerelease: false
40
37
  requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ">="
44
40
  - !ruby/object:Gem::Version
45
- hash: 51
46
41
  segments:
47
42
  - 0
48
43
  - 11
@@ -54,11 +49,9 @@ dependencies:
54
49
  name: dm-timestamps
55
50
  prerelease: false
56
51
  requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
52
  requirements:
59
53
  - - ">="
60
54
  - !ruby/object:Gem::Version
61
- hash: 23
62
55
  segments:
63
56
  - 1
64
57
  - 0
@@ -70,11 +63,9 @@ dependencies:
70
63
  name: rack-openid
71
64
  prerelease: false
72
65
  requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
66
  requirements:
75
67
  - - ">="
76
68
  - !ruby/object:Gem::Version
77
- hash: 3
78
69
  segments:
79
70
  - 0
80
71
  version: "0"
@@ -84,11 +75,9 @@ dependencies:
84
75
  name: openid_dm_store
85
76
  prerelease: false
86
77
  requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
78
  requirements:
89
79
  - - ">="
90
80
  - !ruby/object:Gem::Version
91
- hash: 3
92
81
  segments:
93
82
  - 0
94
83
  version: "0"
@@ -98,11 +87,9 @@ dependencies:
98
87
  name: radius
99
88
  prerelease: false
100
89
  requirement: &id006 !ruby/object:Gem::Requirement
101
- none: false
102
90
  requirements:
103
91
  - - ">="
104
92
  - !ruby/object:Gem::Version
105
- hash: 3
106
93
  segments:
107
94
  - 0
108
95
  version: "0"
@@ -112,11 +99,9 @@ dependencies:
112
99
  name: rest-client
113
100
  prerelease: false
114
101
  requirement: &id007 !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
103
  - - ">="
118
104
  - !ruby/object:Gem::Version
119
- hash: 3
120
105
  segments:
121
106
  - 0
122
107
  version: "0"
@@ -126,11 +111,9 @@ dependencies:
126
111
  name: mail
127
112
  prerelease: false
128
113
  requirement: &id008 !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ">="
132
116
  - !ruby/object:Gem::Version
133
- hash: 3
134
117
  segments:
135
118
  - 0
136
119
  version: "0"
@@ -140,11 +123,9 @@ dependencies:
140
123
  name: gattica
141
124
  prerelease: false
142
125
  requirement: &id009 !ruby/object:Gem::Requirement
143
- none: false
144
126
  requirements:
145
127
  - - ">="
146
128
  - !ruby/object:Gem::Version
147
- hash: 3
148
129
  segments:
149
130
  - 0
150
131
  version: "0"
@@ -154,11 +135,9 @@ dependencies:
154
135
  name: rspec
155
136
  prerelease: false
156
137
  requirement: &id010 !ruby/object:Gem::Requirement
157
- none: false
158
138
  requirements:
159
139
  - - ">="
160
140
  - !ruby/object:Gem::Version
161
- hash: 3
162
141
  segments:
163
142
  - 0
164
143
  version: "0"
@@ -168,11 +147,9 @@ dependencies:
168
147
  name: rack-test
169
148
  prerelease: false
170
149
  requirement: &id011 !ruby/object:Gem::Requirement
171
- none: false
172
150
  requirements:
173
151
  - - ">="
174
152
  - !ruby/object:Gem::Version
175
- hash: 3
176
153
  segments:
177
154
  - 0
178
155
  version: "0"
@@ -194,6 +171,7 @@ files:
194
171
  - lib/orange-more/administration/assets/css/blueprint-print.css
195
172
  - lib/orange-more/administration/assets/css/blueprint.css
196
173
  - lib/orange-more/administration/assets/js/jquery.js
174
+ - lib/orange-more/administration/base.rb
197
175
  - lib/orange-more/administration/cartons/site.rb
198
176
  - lib/orange-more/administration/cartons/site_carton.rb
199
177
  - lib/orange-more/administration/cartons/user.rb
@@ -208,10 +186,12 @@ files:
208
186
  - lib/orange-more/administration/views/users/create.haml
209
187
  - lib/orange-more/administration/views/users/edit.haml
210
188
  - lib/orange-more/analytics.rb
189
+ - lib/orange-more/analytics/base.rb
211
190
  - lib/orange-more/analytics/middleware/analytics.rb
212
191
  - lib/orange-more/analytics/plugin.rb
213
192
  - lib/orange-more/analytics/resources/analytics_resource.rb
214
193
  - lib/orange-more/assets.rb
194
+ - lib/orange-more/assets/base.rb
215
195
  - lib/orange-more/assets/cartons/asset_carton.rb
216
196
  - lib/orange-more/assets/plugin.rb
217
197
  - lib/orange-more/assets/resources/asset_resource.rb
@@ -219,6 +199,7 @@ files:
219
199
  - lib/orange-more/assets/views/assets/create.haml
220
200
  - lib/orange-more/assets/views/assets/insert.haml
221
201
  - lib/orange-more/blog.rb
202
+ - lib/orange-more/blog/base.rb
222
203
  - lib/orange-more/blog/cartons/blog.rb
223
204
  - lib/orange-more/blog/cartons/blog_post.rb
224
205
  - lib/orange-more/blog/plugin.rb
@@ -231,6 +212,7 @@ files:
231
212
  - lib/orange-more/blog/views/blog_posts/edit.haml
232
213
  - lib/orange-more/blog/views/blog_posts/show.haml
233
214
  - lib/orange-more/cloud.rb
215
+ - lib/orange-more/cloud/base.rb
234
216
  - lib/orange-more/cloud/plugin.rb
235
217
  - lib/orange-more/cloud/resources/cloud_resource.rb
236
218
  - lib/orange-more/contactforms.rb
@@ -239,20 +221,24 @@ files:
239
221
  - lib/orange-more/contactforms/assets/js/lib/jquery.form.js
240
222
  - lib/orange-more/contactforms/assets/js/lib/jquery.js
241
223
  - lib/orange-more/contactforms/assets/js/lib/jquery.metadata.js
224
+ - lib/orange-more/contactforms/base.rb
242
225
  - lib/orange-more/contactforms/cartons/contactform_carton.rb
243
226
  - lib/orange-more/contactforms/plugin.rb
244
227
  - lib/orange-more/contactforms/resources/contactforms_resource.rb
245
228
  - lib/orange-more/contactforms/views/contactforms/contactform.haml
246
229
  - lib/orange-more/debugger.rb
247
230
  - lib/orange-more/debugger/assets/css/debug_bar.css
231
+ - lib/orange-more/debugger/base.rb
248
232
  - lib/orange-more/debugger/middleware/debugger.rb
249
233
  - lib/orange-more/debugger/plugin.rb
250
234
  - lib/orange-more/debugger/views/debug_bar.haml
251
235
  - lib/orange-more/disqus.rb
236
+ - lib/orange-more/disqus/base.rb
252
237
  - lib/orange-more/disqus/plugin.rb
253
238
  - lib/orange-more/disqus/resources/disqus_resource.rb
254
239
  - lib/orange-more/disqus/views/disqus/comment_thread.haml
255
240
  - lib/orange-more/news.rb
241
+ - lib/orange-more/news/base.rb
256
242
  - lib/orange-more/news/cartons/news.rb
257
243
  - lib/orange-more/news/plugin.rb
258
244
  - lib/orange-more/news/resources/news_resource.rb
@@ -261,8 +247,10 @@ files:
261
247
  - lib/orange-more/news/views/news/latest.haml
262
248
  - lib/orange-more/news/views/news/sitemap_row.haml
263
249
  - lib/orange-more/pages.rb
250
+ - lib/orange-more/pages/base.rb
264
251
  - lib/orange-more/pages/cartons/page_carton.rb
265
252
  - lib/orange-more/pages/cartons/page_version_carton.rb
253
+ - lib/orange-more/pages/middleware/dumb_quotes.rb
266
254
  - lib/orange-more/pages/plugin.rb
267
255
  - lib/orange-more/pages/resources/page_resource.rb
268
256
  - lib/orange-more/pages/views/pages/edit.haml
@@ -277,6 +265,7 @@ files:
277
265
  - lib/orange-more/sitemap/assets/img/sitemap_up.png
278
266
  - lib/orange-more/sitemap/assets/img/sitemap_up_d.png
279
267
  - lib/orange-more/sitemap/assets/js/sitemap.js
268
+ - lib/orange-more/sitemap/base.rb
280
269
  - lib/orange-more/sitemap/cartons/route.rb
281
270
  - lib/orange-more/sitemap/middleware/flex_router.rb
282
271
  - lib/orange-more/sitemap/plugin.rb
@@ -290,43 +279,12 @@ files:
290
279
  - lib/orange-more/sitemap/views/sitemap/table_row.haml
291
280
  - lib/orange-more/sitemap/views/sitemap/two_level.haml
292
281
  - lib/orange-more/slices.rb
282
+ - lib/orange-more/slices/base.rb
293
283
  - lib/orange-more/slices/middleware/radius_parser.rb
294
284
  - lib/orange-more/slices/plugin.rb
295
285
  - lib/orange-more/slices/resources/radius.rb
296
286
  - lib/orange-more/slices/resources/slices.rb
297
287
  - README.markdown
298
- - spec/orange-core/application_spec.rb
299
- - spec/orange-core/carton_spec.rb
300
- - spec/orange-core/core_spec.rb
301
- - spec/orange-core/magick_spec.rb
302
- - spec/orange-core/middleware/base_spec.rb
303
- - spec/orange-core/middleware/globals_spec.rb
304
- - spec/orange-core/middleware/rerouter_spec.rb
305
- - spec/orange-core/middleware/restful_router_spec.rb
306
- - spec/orange-core/middleware/route_context_spec.rb
307
- - spec/orange-core/middleware/route_site_spec.rb
308
- - spec/orange-core/middleware/show_exceptions_spec.rb
309
- - spec/orange-core/middleware/static_file_spec.rb
310
- - spec/orange-core/middleware/static_spec.rb
311
- - spec/orange-core/mock/mock_app.rb
312
- - spec/orange-core/mock/mock_carton.rb
313
- - spec/orange-core/mock/mock_core.rb
314
- - spec/orange-core/mock/mock_middleware.rb
315
- - spec/orange-core/mock/mock_mixins.rb
316
- - spec/orange-core/mock/mock_model_resource.rb
317
- - spec/orange-core/mock/mock_pulp.rb
318
- - spec/orange-core/mock/mock_resource.rb
319
- - spec/orange-core/mock/mock_router.rb
320
- - spec/orange-core/orange_spec.rb
321
- - spec/orange-core/packet_spec.rb
322
- - spec/orange-core/resource_spec.rb
323
- - spec/orange-core/resources/mapper_spec.rb
324
- - spec/orange-core/resources/model_resource_spec.rb
325
- - spec/orange-core/resources/parser_spec.rb
326
- - spec/orange-core/resources/routable_resource_spec.rb
327
- - spec/orange-core/spec_helper.rb
328
- - spec/orange-core/stack_spec.rb
329
- - spec/stats.rb
330
288
  has_rdoc: true
331
289
  homepage: http://github.com/therabidbanana/orange
332
290
  licenses: []
@@ -337,27 +295,23 @@ rdoc_options:
337
295
  require_paths:
338
296
  - lib
339
297
  required_ruby_version: !ruby/object:Gem::Requirement
340
- none: false
341
298
  requirements:
342
299
  - - ">="
343
300
  - !ruby/object:Gem::Version
344
- hash: 3
345
301
  segments:
346
302
  - 0
347
303
  version: "0"
348
304
  required_rubygems_version: !ruby/object:Gem::Requirement
349
- none: false
350
305
  requirements:
351
306
  - - ">="
352
307
  - !ruby/object:Gem::Version
353
- hash: 3
354
308
  segments:
355
309
  - 0
356
310
  version: "0"
357
311
  requirements: []
358
312
 
359
313
  rubyforge_project:
360
- rubygems_version: 1.3.7
314
+ rubygems_version: 1.3.6
361
315
  signing_key:
362
316
  specification_version: 3
363
317
  summary: Plugins for Orange