rails-brochure 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/config/routes.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
four zero four
|
@@ -1,17 +1,26 @@
|
|
1
1
|
module Rails
|
2
2
|
module Brochure
|
3
3
|
class HomeContent
|
4
|
-
#
|
5
|
-
|
4
|
+
# This feature needs more work.
|
5
|
+
# You can change the folder path and the routes are correct
|
6
|
+
# Rails::Brochure::HomeContent.home_folder_path = 'app/views/content/'
|
7
|
+
# but the home controller looks in the home folder anyway...
|
8
|
+
# So the home controller would need to use a different
|
9
|
+
# directory. If I wanted to make this configurable i'd probably
|
10
|
+
# ask for a controller name, define one (meta) and render the
|
11
|
+
# routes accordingly.
|
12
|
+
@@home_folder_path = 'app/views/home/'
|
13
|
+
cattr_accessor :home_folder_path
|
14
|
+
|
6
15
|
def self.newest
|
7
16
|
HomeContent.files.map { |f| File.new(f) }.sort { |a,b| a.ctime <=> b.ctime }.map { |f| f.ctime }.last
|
8
17
|
end
|
9
18
|
def self.files
|
10
|
-
Dir.glob("#{
|
19
|
+
Dir.glob("#{home_folder_path}**/*.html.*")
|
11
20
|
end
|
12
21
|
def self.templates
|
13
22
|
HomeContent.files.map do |f|
|
14
|
-
f.gsub(/(#{
|
23
|
+
f.gsub(/(#{home_folder_path}|.html.\w+)/,"")
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rails-brochure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Dan Hixon
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-09 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/generators/USAGE
|
48
48
|
- lib/generators/brochure_generator.rb
|
49
49
|
- lib/generators/templates/app/views/home/about.html.erb
|
50
|
+
- lib/generators/templates/app/views/home/four_zero_four.html.erb
|
50
51
|
- lib/generators/templates/app/views/home/index.html.erb
|
51
52
|
- lib/rails-brochure.rb
|
52
53
|
- lib/rails-brochure/engine.rb
|