maglev 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ module Maglev
8
8
  def view
9
9
  @slug = params[:slug]
10
10
  @template = @slug ? @slug.gsub('-','_') : 'index'
11
- @layout = 'application'
11
+ @layout = params[:layout] || Maglev.default_layout
12
12
  render template: "/site/#{@template}", layout: "/layouts/#{@layout}"
13
13
  end
14
14
 
@@ -0,0 +1,10 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title
5
+ = yield :title || Maglev.title
6
+ = stylesheet_link_tag :site, media: 'all'
7
+ = javascript_include_tag :site
8
+ = csrf_meta_tags
9
+ %body
10
+ = yield
@@ -1,3 +1,3 @@
1
1
  module Maglev
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/maglev.rb CHANGED
@@ -1,4 +1,24 @@
1
1
  require "maglev/engine"
2
2
 
3
+ MAGLEV_PATH = File.dirname(__FILE__) + '/maglev/'
4
+
5
+ %W{ }.each do |req|
6
+ require MAGLEV_PATH + '/' + req
7
+ end
8
+
3
9
  module Maglev
10
+
11
+ # Default layout used when rendering Pages
12
+ mattr_accessor :default_layout
13
+ @@default_layout = 'maglev/site'
14
+
15
+ # Default Title
16
+ mattr_accessor :title
17
+ @@title = 'Maglev'
18
+
19
+ # Default way to configure Maglev
20
+ def self.setup
21
+ yield self
22
+ end
23
+
4
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-18 00:00:00.000000000 Z
12
+ date: 2012-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &15087120 !ruby/object:Gem::Requirement
16
+ requirement: &19210940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.8
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15087120
24
+ version_requirements: *19210940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml
27
- requirement: &15086200 !ruby/object:Gem::Requirement
27
+ requirement: &19234020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,98 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15086200
36
- - !ruby/object:Gem::Dependency
37
- name: cancan
38
- requirement: &15084600 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: *15084600
47
- - !ruby/object:Gem::Dependency
48
- name: paperclip
49
- requirement: &15083620 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *15083620
58
- - !ruby/object:Gem::Dependency
59
- name: bootstrap-sass
60
- requirement: &15098140 !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: *15098140
69
- - !ruby/object:Gem::Dependency
70
- name: compass-rails
71
- requirement: &15096720 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: *15096720
80
- - !ruby/object:Gem::Dependency
81
- name: redis
82
- requirement: &15095980 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :runtime
89
- prerelease: false
90
- version_requirements: *15095980
91
- - !ruby/object:Gem::Dependency
92
- name: paper_trail
93
- requirement: &15107260 !ruby/object:Gem::Requirement
94
- none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- type: :runtime
100
- prerelease: false
101
- version_requirements: *15107260
102
- - !ruby/object:Gem::Dependency
103
- name: fog
104
- requirement: &15106660 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :runtime
111
- prerelease: false
112
- version_requirements: *15106660
113
- - !ruby/object:Gem::Dependency
114
- name: friendly_id
115
- requirement: &15106060 !ruby/object:Gem::Requirement
116
- none: false
117
- requirements:
118
- - - ! '>='
119
- - !ruby/object:Gem::Version
120
- version: '0'
121
- type: :runtime
122
- prerelease: false
123
- version_requirements: *15106060
35
+ version_requirements: *19234020
124
36
  - !ruby/object:Gem::Dependency
125
37
  name: jquery-rails
126
- requirement: &15105480 !ruby/object:Gem::Requirement
38
+ requirement: &19270420 !ruby/object:Gem::Requirement
127
39
  none: false
128
40
  requirements:
129
41
  - - ! '>='
@@ -131,10 +43,10 @@ dependencies:
131
43
  version: '0'
132
44
  type: :runtime
133
45
  prerelease: false
134
- version_requirements: *15105480
46
+ version_requirements: *19270420
135
47
  - !ruby/object:Gem::Dependency
136
48
  name: sass-rails
137
- requirement: &15103960 !ruby/object:Gem::Requirement
49
+ requirement: &19267740 !ruby/object:Gem::Requirement
138
50
  none: false
139
51
  requirements:
140
52
  - - ! '>='
@@ -142,10 +54,10 @@ dependencies:
142
54
  version: '0'
143
55
  type: :runtime
144
56
  prerelease: false
145
- version_requirements: *15103960
57
+ version_requirements: *19267740
146
58
  - !ruby/object:Gem::Dependency
147
59
  name: coffee-rails
148
- requirement: &15102640 !ruby/object:Gem::Requirement
60
+ requirement: &19265160 !ruby/object:Gem::Requirement
149
61
  none: false
150
62
  requirements:
151
63
  - - ! '>='
@@ -153,10 +65,10 @@ dependencies:
153
65
  version: '0'
154
66
  type: :runtime
155
67
  prerelease: false
156
- version_requirements: *15102640
68
+ version_requirements: *19265160
157
69
  - !ruby/object:Gem::Dependency
158
70
  name: rspec-rails
159
- requirement: &15101580 !ruby/object:Gem::Requirement
71
+ requirement: &19279780 !ruby/object:Gem::Requirement
160
72
  none: false
161
73
  requirements:
162
74
  - - ! '>='
@@ -164,10 +76,10 @@ dependencies:
164
76
  version: '0'
165
77
  type: :development
166
78
  prerelease: false
167
- version_requirements: *15101580
79
+ version_requirements: *19279780
168
80
  - !ruby/object:Gem::Dependency
169
81
  name: guard-rails
170
- requirement: &15114320 !ruby/object:Gem::Requirement
82
+ requirement: &19277420 !ruby/object:Gem::Requirement
171
83
  none: false
172
84
  requirements:
173
85
  - - ! '>='
@@ -175,10 +87,10 @@ dependencies:
175
87
  version: '0'
176
88
  type: :development
177
89
  prerelease: false
178
- version_requirements: *15114320
90
+ version_requirements: *19277420
179
91
  - !ruby/object:Gem::Dependency
180
92
  name: guard-rspec
181
- requirement: &15109400 !ruby/object:Gem::Requirement
93
+ requirement: &19273540 !ruby/object:Gem::Requirement
182
94
  none: false
183
95
  requirements:
184
96
  - - ! '>='
@@ -186,10 +98,10 @@ dependencies:
186
98
  version: '0'
187
99
  type: :development
188
100
  prerelease: false
189
- version_requirements: *15109400
101
+ version_requirements: *19273540
190
102
  - !ruby/object:Gem::Dependency
191
103
  name: factory_girl_rails
192
- requirement: &15955260 !ruby/object:Gem::Requirement
104
+ requirement: &19289300 !ruby/object:Gem::Requirement
193
105
  none: false
194
106
  requirements:
195
107
  - - ! '>='
@@ -197,10 +109,10 @@ dependencies:
197
109
  version: '0'
198
110
  type: :development
199
111
  prerelease: false
200
- version_requirements: *15955260
112
+ version_requirements: *19289300
201
113
  - !ruby/object:Gem::Dependency
202
114
  name: capybara
203
- requirement: &15954760 !ruby/object:Gem::Requirement
115
+ requirement: &19319260 !ruby/object:Gem::Requirement
204
116
  none: false
205
117
  requirements:
206
118
  - - ! '>='
@@ -208,10 +120,10 @@ dependencies:
208
120
  version: '0'
209
121
  type: :development
210
122
  prerelease: false
211
- version_requirements: *15954760
123
+ version_requirements: *19319260
212
124
  - !ruby/object:Gem::Dependency
213
125
  name: pg
214
- requirement: &15954120 !ruby/object:Gem::Requirement
126
+ requirement: &19314680 !ruby/object:Gem::Requirement
215
127
  none: false
216
128
  requirements:
217
129
  - - ! '>='
@@ -219,10 +131,10 @@ dependencies:
219
131
  version: '0'
220
132
  type: :development
221
133
  prerelease: false
222
- version_requirements: *15954120
134
+ version_requirements: *19314680
223
135
  - !ruby/object:Gem::Dependency
224
136
  name: puma
225
- requirement: &15953340 !ruby/object:Gem::Requirement
137
+ requirement: &19353960 !ruby/object:Gem::Requirement
226
138
  none: false
227
139
  requirements:
228
140
  - - ! '>='
@@ -230,7 +142,7 @@ dependencies:
230
142
  version: '0'
231
143
  type: :development
232
144
  prerelease: false
233
- version_requirements: *15953340
145
+ version_requirements: *19353960
234
146
  description: Maglev is a simple CMS mountable engine to quickly add intelligent pages
235
147
  to your site
236
148
  email:
@@ -246,11 +158,11 @@ files:
246
158
  - app/helpers/maglev/pages_helper.rb
247
159
  - app/helpers/maglev/application_helper.rb
248
160
  - app/views/layouts/maglev/application.html.erb
161
+ - app/views/layouts/maglev/site.html.haml
249
162
  - app/controllers/maglev/pages_controller.rb
250
163
  - app/controllers/maglev/application_controller.rb
251
164
  - config/routes.rb
252
165
  - config/locales/devise.en.yml
253
- - db/migrate/20120814002939_create_versions.rb
254
166
  - lib/maglev.rb
255
167
  - lib/maglev/engine.rb
256
168
  - lib/maglev/version.rb
@@ -272,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
272
184
  version: '0'
273
185
  segments:
274
186
  - 0
275
- hash: 1000667122038659149
187
+ hash: 3873960498074750544
276
188
  required_rubygems_version: !ruby/object:Gem::Requirement
277
189
  none: false
278
190
  requirements:
@@ -281,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
193
  version: '0'
282
194
  segments:
283
195
  - 0
284
- hash: 1000667122038659149
196
+ hash: 3873960498074750544
285
197
  requirements: []
286
198
  rubyforge_project:
287
199
  rubygems_version: 1.8.11
@@ -1,18 +0,0 @@
1
- class CreateVersions < ActiveRecord::Migration
2
- def self.up
3
- create_table :versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
7
- t.string :whodunnit
8
- t.text :object
9
- t.datetime :created_at
10
- end
11
- add_index :versions, [:item_type, :item_id]
12
- end
13
-
14
- def self.down
15
- remove_index :versions, [:item_type, :item_id]
16
- drop_table :versions
17
- end
18
- end