orange-more 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  require 'orange-core/middleware/base'
2
-
2
+ require 'rack/openid'
3
+ require 'openid_dm_store'
3
4
 
4
5
 
5
6
  module Orange::Middleware
@@ -113,7 +114,7 @@ module Orange::Middleware
113
114
  packet['user.id'] = packet['user.id'].first if packet['user.id'].kind_of?(Array)
114
115
  end
115
116
 
116
- if packet['user.id'] =~ /^https?:\/\/(www.)?yahoo.com/
117
+ if packet['user.id'] =~ /^https?:\/\/(www.)?yahoo.com/ || packet['user.id'] =~ /^https?:\/\/(me.)?yahoo.com/
117
118
  packet['user.id'] = profile_data["http://axschema.org/contact/email"]
118
119
  packet['user.id'] = packet['user.id'].first if packet['user.id'].kind_of?(Array)
119
120
  end
@@ -1,7 +1,7 @@
1
1
  require 'orange-core/middleware/base'
2
2
  module Orange::Middleware
3
3
  # This will load information about the site to into the orange env
4
- # - packet['site'] will be an instance of the site object
4
+ # - packet['site'] will be an instance of the site object
5
5
  #
6
6
  class SiteLoad < Base
7
7
  def packet_call(packet)
@@ -70,17 +70,18 @@ module Orange
70
70
  end
71
71
 
72
72
  def blog_for_site(packet, site_id = false)
73
- site_id ||= (packet['subsite'].blank? ? packet['site'].id : packet['subsite'].id)
74
- blog = OrangeBlog.first(:orange_site_id => site_id)
73
+ site_id ||= (packet['subsite'].blank? ? packet['site'] : packet['subsite'])
74
+ site_id = OrangeSite.get(site_id) unless site_id.is_a? OrangeSite
75
+ blog = OrangeBlog.first(:orange_site => site_id)
75
76
  if !blog && packet.request.post? # Only create a new blog if this is a post
76
77
  blog = OrangeBlog.new
77
78
  blog.title = 'An Orange Hosted Blog'
78
79
  blog.orange_site = packet['site']
79
80
  blog.save
80
81
  end
81
- if packet.request.post? && !OrangeRoute.first(:resource => 'blog', :orange_site_id => packet['site'].id)
82
+ if packet.request.post? && !OrangeRoute.first(:resource => 'blog', :orange_site => packet['site'])
82
83
  orange[:sitemap, true].add_route_for(packet,
83
- :orange_site_id => site_id,
84
+ :orange_site => site_id,
84
85
  :resource => :blog,
85
86
  :resource_id => blog.id,
86
87
  :resource_action => :blog_view,
@@ -15,7 +15,6 @@ class OrangeRoute < Orange::SiteCarton
15
15
  string :resource_action
16
16
  boolean :accept_args, :default => true
17
17
  end
18
- include DataMapper::Transaction::Resource # Make sure Transactions are included (for awesome_set)
19
18
  is :awesome_set, :scope => [:orange_site]
20
19
 
21
20
  def full_path
@@ -35,7 +34,8 @@ class OrangeRoute < Orange::SiteCarton
35
34
 
36
35
 
37
36
  def self.create_home_for_site(site_id, opts = {})
38
- opts = opts.with_defaults({:orange_site_id => site_id, :slug => '_index_', :accept_args => false, :link_text => 'Home'})
37
+ site_id = OrangeSite.get(site_id) unless site_id.is_a? OrangeSite
38
+ opts = opts.with_defaults({:orange_site => site_id, :slug => '_index_', :accept_args => false, :link_text => 'Home'})
39
39
  home = self.new(opts)
40
40
  home.move(:root)
41
41
  home.save
data/lib/orange-more.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  libdir = File.dirname(__FILE__)
2
2
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
3
3
 
4
- require File.join(libdir, 'orange-core')
4
+ require 'orange-core'
5
5
 
6
6
  require File.join(libdir, 'orange-more', 'administration')
7
7
  require File.join(libdir, 'orange-more', 'assets')
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orange-more
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 27
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 5
8
- - 7
9
- version: 0.5.7
9
+ - 8
10
+ version: 0.5.8
10
11
  platform: ruby
11
12
  authors:
12
13
  - David Haslem
@@ -14,75 +15,169 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-07 00:00:00 -04:00
18
+ date: 2010-07-08 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: rack
22
+ name: orange-core
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 5
27
30
  segments:
28
- - 1
29
31
  - 0
30
- - 1
31
- version: 1.0.1
32
+ - 5
33
+ - 7
34
+ version: 0.5.7
32
35
  type: :runtime
33
36
  version_requirements: *id001
34
37
  - !ruby/object:Gem::Dependency
35
- name: haml
38
+ name: dm-is-awesome_set
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 51
41
46
  segments:
42
- - 2
43
- - 2
44
- - 13
45
- version: 2.2.13
47
+ - 0
48
+ - 11
49
+ - 0
50
+ version: 0.11.0
46
51
  type: :runtime
47
52
  version_requirements: *id002
48
53
  - !ruby/object:Gem::Dependency
49
- name: orange-core
54
+ name: dm-timestamps
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 23
55
62
  segments:
63
+ - 1
56
64
  - 0
57
- - 5
58
- - 7
59
- version: 0.5.7
65
+ - 0
66
+ version: 1.0.0
60
67
  type: :runtime
61
68
  version_requirements: *id003
62
69
  - !ruby/object:Gem::Dependency
63
- name: rspec
70
+ name: rack-openid
64
71
  prerelease: false
65
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
66
74
  requirements:
67
75
  - - ">="
68
76
  - !ruby/object:Gem::Version
77
+ hash: 3
69
78
  segments:
70
79
  - 0
71
80
  version: "0"
72
- type: :development
81
+ type: :runtime
73
82
  version_requirements: *id004
74
83
  - !ruby/object:Gem::Dependency
75
- name: rack-test
84
+ name: openid_dm_store
76
85
  prerelease: false
77
86
  requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
78
88
  requirements:
79
89
  - - ">="
80
90
  - !ruby/object:Gem::Version
91
+ hash: 3
81
92
  segments:
82
93
  - 0
83
94
  version: "0"
84
- type: :development
95
+ type: :runtime
85
96
  version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ name: radius
99
+ prerelease: false
100
+ requirement: &id006 !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
108
+ version: "0"
109
+ type: :runtime
110
+ version_requirements: *id006
111
+ - !ruby/object:Gem::Dependency
112
+ name: rest-client
113
+ prerelease: false
114
+ requirement: &id007 !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ hash: 3
120
+ segments:
121
+ - 0
122
+ version: "0"
123
+ type: :runtime
124
+ version_requirements: *id007
125
+ - !ruby/object:Gem::Dependency
126
+ name: mail
127
+ prerelease: false
128
+ requirement: &id008 !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ type: :runtime
138
+ version_requirements: *id008
139
+ - !ruby/object:Gem::Dependency
140
+ name: gattica
141
+ prerelease: false
142
+ requirement: &id009 !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ hash: 3
148
+ segments:
149
+ - 0
150
+ version: "0"
151
+ type: :runtime
152
+ version_requirements: *id009
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec
155
+ prerelease: false
156
+ requirement: &id010 !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ hash: 3
162
+ segments:
163
+ - 0
164
+ version: "0"
165
+ type: :development
166
+ version_requirements: *id010
167
+ - !ruby/object:Gem::Dependency
168
+ name: rack-test
169
+ prerelease: false
170
+ requirement: &id011 !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ hash: 3
176
+ segments:
177
+ - 0
178
+ version: "0"
179
+ type: :development
180
+ version_requirements: *id011
86
181
  description: Orange is a Ruby framework for building managed websites with code as simple as Sinatra
87
182
  email: therabidbanana@gmail.com
88
183
  executables: []
@@ -247,6 +342,38 @@ files:
247
342
  - lib/orange-more/testimonials/resources/testimonials_resource.rb
248
343
  - lib/orange-more/testimonials/views/testimonials/testimonials.haml
249
344
  - README.markdown
345
+ - spec/orange-core/application_spec.rb
346
+ - spec/orange-core/carton_spec.rb
347
+ - spec/orange-core/core_spec.rb
348
+ - spec/orange-core/magick_spec.rb
349
+ - spec/orange-core/middleware/base_spec.rb
350
+ - spec/orange-core/middleware/globals_spec.rb
351
+ - spec/orange-core/middleware/rerouter_spec.rb
352
+ - spec/orange-core/middleware/restful_router_spec.rb
353
+ - spec/orange-core/middleware/route_context_spec.rb
354
+ - spec/orange-core/middleware/route_site_spec.rb
355
+ - spec/orange-core/middleware/show_exceptions_spec.rb
356
+ - spec/orange-core/middleware/static_file_spec.rb
357
+ - spec/orange-core/middleware/static_spec.rb
358
+ - spec/orange-core/mock/mock_app.rb
359
+ - spec/orange-core/mock/mock_carton.rb
360
+ - spec/orange-core/mock/mock_core.rb
361
+ - spec/orange-core/mock/mock_middleware.rb
362
+ - spec/orange-core/mock/mock_mixins.rb
363
+ - spec/orange-core/mock/mock_model_resource.rb
364
+ - spec/orange-core/mock/mock_pulp.rb
365
+ - spec/orange-core/mock/mock_resource.rb
366
+ - spec/orange-core/mock/mock_router.rb
367
+ - spec/orange-core/orange_spec.rb
368
+ - spec/orange-core/packet_spec.rb
369
+ - spec/orange-core/resource_spec.rb
370
+ - spec/orange-core/resources/mapper_spec.rb
371
+ - spec/orange-core/resources/model_resource_spec.rb
372
+ - spec/orange-core/resources/parser_spec.rb
373
+ - spec/orange-core/resources/routable_resource_spec.rb
374
+ - spec/orange-core/spec_helper.rb
375
+ - spec/orange-core/stack_spec.rb
376
+ - spec/stats.rb
250
377
  has_rdoc: true
251
378
  homepage: http://github.com/therabidbanana/orange
252
379
  licenses: []
@@ -257,26 +384,30 @@ rdoc_options:
257
384
  require_paths:
258
385
  - lib
259
386
  required_ruby_version: !ruby/object:Gem::Requirement
387
+ none: false
260
388
  requirements:
261
389
  - - ">="
262
390
  - !ruby/object:Gem::Version
391
+ hash: 3
263
392
  segments:
264
393
  - 0
265
394
  version: "0"
266
395
  required_rubygems_version: !ruby/object:Gem::Requirement
396
+ none: false
267
397
  requirements:
268
398
  - - ">="
269
399
  - !ruby/object:Gem::Version
400
+ hash: 3
270
401
  segments:
271
402
  - 0
272
403
  version: "0"
273
404
  requirements: []
274
405
 
275
406
  rubyforge_project:
276
- rubygems_version: 1.3.6
407
+ rubygems_version: 1.3.7
277
408
  signing_key:
278
409
  specification_version: 3
279
- summary: Plugins for orange
410
+ summary: Plugins for Orange
280
411
  test_files:
281
412
  - spec/orange-core/application_spec.rb
282
413
  - spec/orange-core/carton_spec.rb