orange-core 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,6 +29,7 @@ module Orange
29
29
  opts[:resource] && opts[:resource].respond_to?(:orange_name)
30
30
  resource = (opts[:resource_name] || '').downcase
31
31
 
32
+ opts.merge :orange => orange
32
33
  if packet_binding.is_a? Orange::Packet
33
34
  context = packet_binding['route.context'].to_s
34
35
  unless temp
@@ -37,12 +38,11 @@ module Orange
37
38
  end
38
39
  end
39
40
  unless haml_engine
40
- opts.merge :orange => orange
41
41
 
42
42
  string = false
43
43
  if temp
44
44
  string ||= read_if_exists('templates', file)
45
- @template_dirs.each do |templates_dir|
45
+ @template_dirs.reverse_each do |templates_dir|
46
46
  string ||= read_if_exists(templates_dir, file)
47
47
  end unless string
48
48
  end
@@ -50,24 +50,24 @@ module Orange
50
50
  if context
51
51
  #Check for context specific overrides
52
52
  string ||= read_if_exists('views', resource, context+"."+file) if resource
53
- string ||= read_if_exists('views', context+"."+file)
54
- @view_dirs.each do |views_dir|
53
+ string ||= read_if_exists('views', context+"."+file) unless resource
54
+ @view_dirs.reverse_each do |views_dir|
55
55
  string ||= read_if_exists(views_dir, resource, context+"."+file) if resource
56
- string ||= read_if_exists(views_dir, context+"."+file)
56
+ string ||= read_if_exists(views_dir, context+"."+file) unless resource
57
57
  end unless string
58
58
  end
59
59
 
60
60
  # Check for standard views
61
61
  string ||= read_if_exists('views', resource, file) if resource
62
- string ||= read_if_exists('views', file)
63
- @view_dirs.each do |views_dir|
62
+ string ||= read_if_exists('views', file) unless resource
63
+ @view_dirs.reverse_each do |views_dir|
64
64
  string ||= read_if_exists(views_dir, resource, file) if resource
65
- string ||= read_if_exists(views_dir, file)
65
+ string ||= read_if_exists(views_dir, file) unless resource
66
66
  end unless string
67
67
 
68
68
  # Check for default resource views
69
69
  string ||= read_if_exists('views', 'default_resource', file)
70
- @view_dirs.each do |views_dir|
70
+ @view_dirs.reverse_each do |views_dir|
71
71
  string ||= read_if_exists(views_dir, 'default_resource', file) if resource
72
72
  end unless string
73
73
  raise LoadError, "Couldn't find haml file '#{file}'" unless string
@@ -1,5 +1,7 @@
1
1
  require 'orange-core/core'
2
2
  require 'rack/builder'
3
+ require 'rack/abstract_format'
4
+
3
5
  module Orange
4
6
  # Builds an orange stack of middleware
5
7
  # Use in the rackup file as follows:
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
- require 'rack/abstract_format'
3
1
 
4
2
  class MockApplication < Orange::Application
5
3
 
@@ -169,6 +169,7 @@ describe Orange::ModelResource do
169
169
 
170
170
  it "should call carton's destroy! on DELETE delete and reroute" do
171
171
  a= MockModelResourceTwo.new
172
+ a.set_orange(Orange::Core.new, :mock_resource)
172
173
  m= mock("carton", :null_object => true)
173
174
  m.should_receive(:destroy)
174
175
  a.stub!(:model_class).and_return(m)
@@ -1,8 +1,8 @@
1
1
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
 
4
- require 'orange-core'
5
4
  require 'rubygems'
5
+ require 'orange-core'
6
6
 
7
7
  require 'mock/mock_app'
8
8
  require 'mock/mock_pulp'
@@ -127,7 +127,7 @@ describe Orange::Stack do
127
127
  x.app
128
128
  x.app
129
129
  c2.should_receive(:fire).with(:stack_loaded, anything()).exactly(3).times
130
- c2.should_receive(:fire).with(:stack_reloading, anything()).twice
130
+ c2.should_receive(:fire).with(:stack_reloading, anything()).exactly(3).times
131
131
  x2.app
132
132
  x2.app
133
133
  x2.app
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orange-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 8
10
- version: 0.5.8
9
+ - 9
10
+ version: 0.5.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Haslem
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-07 00:00:00 -04:00
18
+ date: 2010-07-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -97,7 +97,7 @@ dependencies:
97
97
  type: :runtime
98
98
  version_requirements: *id005
99
99
  - !ruby/object:Gem::Dependency
100
- name: rspec
100
+ name: rack-abstract-format
101
101
  prerelease: false
102
102
  requirement: &id006 !ruby/object:Gem::Requirement
103
103
  none: false
@@ -108,10 +108,10 @@ dependencies:
108
108
  segments:
109
109
  - 0
110
110
  version: "0"
111
- type: :development
111
+ type: :runtime
112
112
  version_requirements: *id006
113
113
  - !ruby/object:Gem::Dependency
114
- name: rack-test
114
+ name: rspec
115
115
  prerelease: false
116
116
  requirement: &id007 !ruby/object:Gem::Requirement
117
117
  none: false
@@ -124,6 +124,20 @@ dependencies:
124
124
  version: "0"
125
125
  type: :development
126
126
  version_requirements: *id007
127
+ - !ruby/object:Gem::Dependency
128
+ name: rack-test
129
+ prerelease: false
130
+ requirement: &id008 !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ hash: 3
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ type: :development
140
+ version_requirements: *id008
127
141
  description: Orange is a Ruby framework for building managed websites with code as simple as Sinatra
128
142
  email: therabidbanana@gmail.com
129
143
  executables: []
@@ -208,7 +222,22 @@ has_rdoc: true
208
222
  homepage: http://github.com/therabidbanana/orange-core
209
223
  licenses: []
210
224
 
211
- post_install_message:
225
+ post_install_message: |
226
+ ===========================================
227
+ Note:
228
+ orange-core requires DataMapper to function. dm-core has been installed,
229
+ but please make sure you also have installed the
230
+ the appropriate DataMapper adapter for your system:
231
+
232
+ $ gem install [dm-adapter]
233
+
234
+ Mysql: dm-mysql-adapter
235
+ Sqlite: dm-sqlite-adapter
236
+ Postgres: dm-postgres-adapter
237
+
238
+ orange-core install complete.
239
+ ===========================================
240
+
212
241
  rdoc_options:
213
242
  - --charset=UTF-8
214
243
  require_paths: