xhive 1.0.1.pre → 1.0.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/app/helpers/xhive/application_helper.rb +7 -4
- data/app/models/xhive/mapper.rb +1 -1
- data/app/models/xhive/page.rb +1 -1
- data/app/models/xhive/site.rb +1 -1
- data/app/models/xhive/stylesheet.rb +1 -1
- data/lib/xhive/engine.rb +3 -3
- data/lib/xhive/router/cells.rb +20 -7
- data/lib/xhive/version.rb +1 -1
- metadata +33 -33
@@ -5,12 +5,15 @@ module Xhive
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def include_custom_stylesheets
|
8
|
-
|
8
|
+
# TODO: merge engine routes with Rails application routes
|
9
|
+
"<link href='/stylesheets/custom.css' media='all' rel='stylesheet' type='text/css'/>".html_safe
|
9
10
|
end
|
10
11
|
|
11
|
-
def
|
12
|
-
page = current_site.mappers.page_for(
|
13
|
-
render :
|
12
|
+
def render_page_with(options={})
|
13
|
+
page = current_site.mappers.page_for(controller_name, action_name)
|
14
|
+
render :inline => page.presenter.render_content(options), :layout => true
|
15
|
+
rescue
|
16
|
+
render
|
14
17
|
end
|
15
18
|
|
16
19
|
def current_site
|
data/app/models/xhive/mapper.rb
CHANGED
data/app/models/xhive/page.rb
CHANGED
data/app/models/xhive/site.rb
CHANGED
data/lib/xhive/engine.rb
CHANGED
@@ -11,13 +11,13 @@ module Xhive
|
|
11
11
|
|
12
12
|
include Xhive::ApplicationHelper
|
13
13
|
|
14
|
-
helper_method :initialize_widgets_loader
|
14
|
+
helper_method :initialize_widgets_loader, :include_custom_stylesheets
|
15
15
|
end
|
16
16
|
end
|
17
|
-
initializer "xhive.load_all_controller_classes" do
|
17
|
+
initializer "xhive.load_all_controller_classes", :after=> :disable_dependency_loading do
|
18
18
|
ActiveSupport.on_load(:action_controller) do
|
19
|
-
Rails.application.reload_routes!
|
20
19
|
Dir[Rails.root.join("app/controllers/**/*.rb")].each {|f| require f}
|
20
|
+
Xhive::Router::Cells.process_routes
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/lib/xhive/router/cells.rb
CHANGED
@@ -10,7 +10,7 @@ module Xhive
|
|
10
10
|
# end
|
11
11
|
#
|
12
12
|
def self.draw
|
13
|
-
|
13
|
+
class_variable_set("@@routes", [])
|
14
14
|
yield self
|
15
15
|
end
|
16
16
|
|
@@ -21,15 +21,28 @@ module Xhive
|
|
21
21
|
#
|
22
22
|
# Example: mount 'my_widget', :to => 'my_cell#action'
|
23
23
|
#
|
24
|
+
# It stores the route in internal storage for later processing
|
25
|
+
#
|
24
26
|
def self.mount(route, options)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
@@routes << { :path => route, :options => options }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Public: process the previously stored routes
|
31
|
+
#
|
32
|
+
def self.process_routes
|
33
|
+
@@routes.each do |route|
|
34
|
+
path = route[:path]
|
35
|
+
options = route[:options]
|
36
|
+
|
37
|
+
cell, action = options[:to].split('#')
|
38
|
+
widgets_base_route = Base.route_for('widgets', 'show').gsub(/\/\*\w*$/, '')
|
39
|
+
widget_route = "#{widgets_base_route}/#{path}"
|
40
|
+
tag_class_name = "#{cell}_#{action}".camelize
|
29
41
|
|
30
|
-
|
42
|
+
Route.add(widget_route, cell.camelize, action)
|
31
43
|
|
32
|
-
|
44
|
+
Xhive::TagFactory.create_class(tag_class_name, widget_route)
|
45
|
+
end
|
33
46
|
end
|
34
47
|
end
|
35
48
|
end
|
data/lib/xhive/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xhive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3.pre
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,64 +9,64 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 3.
|
29
|
+
version: '3.2'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: jquery-rails
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: '0'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: '0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: cells
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 3.8.5
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.8.5
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: friendly_id
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 4.0.1
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,39 +74,39 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 4.0.1
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
79
|
+
name: liquid
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ! '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
86
|
-
type: :
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '0'
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
95
|
+
name: sass-rails
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
102
|
-
type: :
|
101
|
+
version: 3.2.3
|
102
|
+
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 3.2.3
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: sqlite3
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -223,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash: -
|
226
|
+
hash: -3877875978952443496
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
none: false
|
229
229
|
requirements:
|