simple-pages-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/simple_pages/application_controller.rb +4 -2
- data/app/models/simple_pages/page.rb +1 -3
- data/lib/generators/simple_pages/USAGE +2 -0
- data/lib/generators/simple_pages/install_generator.rb +16 -6
- data/lib/generators/simple_pages/templates/simple_pages.rb +3 -0
- data/lib/simple-pages-rails/version.rb +1 -1
- data/lib/simple_pages.rb +3 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/config/initializers/simple_pages.rb +3 -0
- metadata +4 -4
@@ -5,8 +5,10 @@ module SimplePages
|
|
5
5
|
helper ::RailsTheme::Engine.helpers
|
6
6
|
helper SimplePages.helper_modules
|
7
7
|
|
8
|
-
SimplePages.controller_modules.each
|
9
|
-
|
8
|
+
SimplePages.controller_modules.each { |module_name| include module_name }
|
9
|
+
|
10
|
+
if SimplePages.extra_page_layout.present?
|
11
|
+
has_page_layout_at SimplePages.extra_page_layout
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
@@ -14,6 +14,22 @@ module SimplePages
|
|
14
14
|
template 'simple_pages.rb', 'config/initializers/simple_pages.rb'
|
15
15
|
end
|
16
16
|
|
17
|
+
def mount_routes
|
18
|
+
insert_into_file 'config/routes.rb', after: "routes.draw do\n" do
|
19
|
+
" mount SimplePages::Engine, at: '/'\n"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def inject_application_controller
|
24
|
+
insert_into_file 'app/controllers/application_controller.rb', after: /class ApplicationController < ActionController::Base\n/ do
|
25
|
+
<<-CODE
|
26
|
+
include DeviseExt
|
27
|
+
include CanCanExt
|
28
|
+
include SimplePages::Controllers::PageLayoutAt
|
29
|
+
CODE
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
17
33
|
def append_user_mixin
|
18
34
|
user_model = "app/models/#{options[:user_model].downcase}.rb"
|
19
35
|
unless File.exist? user_model
|
@@ -29,12 +45,6 @@ module SimplePages
|
|
29
45
|
CODE
|
30
46
|
end
|
31
47
|
end
|
32
|
-
|
33
|
-
def mount_routes
|
34
|
-
insert_into_file 'config/routes.rb', after: "routes.draw do\n" do
|
35
|
-
" mount SimplePages::Engine, at: '/'\n"
|
36
|
-
end
|
37
|
-
end
|
38
48
|
end
|
39
49
|
end
|
40
50
|
end
|
@@ -5,6 +5,9 @@ SimplePages.configure do |config|
|
|
5
5
|
# mixin controller modules.
|
6
6
|
config.controller_modules += [DeviseExt, CanCanExt]
|
7
7
|
|
8
|
+
# add extra page layout location, default to %w{header footer}
|
9
|
+
# config.extra_page_layout += []
|
10
|
+
|
8
11
|
# mixin helper modules.
|
9
12
|
# config.helper_modules += []
|
10
13
|
|
data/lib/simple_pages.rb
CHANGED
@@ -5,6 +5,9 @@ SimplePages.configure do |config|
|
|
5
5
|
# mixin controller modules.
|
6
6
|
config.controller_modules += [DeviseExt, CanCanExt]
|
7
7
|
|
8
|
+
# add extra page layout location, default to %w{header footer}
|
9
|
+
# config.extra_page_layout += []
|
10
|
+
|
8
11
|
# mixin helper modules.
|
9
12
|
# config.helper_modules += []
|
10
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-pages-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -320,7 +320,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
320
320
|
version: '0'
|
321
321
|
segments:
|
322
322
|
- 0
|
323
|
-
hash: -
|
323
|
+
hash: -3697549356973948748
|
324
324
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
325
325
|
none: false
|
326
326
|
requirements:
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
version: '0'
|
330
330
|
segments:
|
331
331
|
- 0
|
332
|
-
hash: -
|
332
|
+
hash: -3697549356973948748
|
333
333
|
requirements: []
|
334
334
|
rubyforge_project:
|
335
335
|
rubygems_version: 1.8.24
|