rails-brochure 0.0.6 → 0.0.8
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 +1 -1
- data/lib/rails-brochure/home_content.rb +14 -8
- data/lib/rails-brochure/version.rb +1 -1
- metadata +33 -39
data/config/routes.rb
CHANGED
@@ -2,6 +2,6 @@ Rails.application.routes.draw do
|
|
2
2
|
Rails::Brochure::HomeContent.templates.each do |pg|
|
3
3
|
match "/#{pg}" => "home##{pg}", :as => pg.gsub(/(\/|-)/,'_').to_sym
|
4
4
|
end
|
5
|
-
match '*a', :to => 'home#four_zero_four' unless defined?(NONBROCHURE404)
|
5
|
+
match '*a', :to => 'home#four_zero_four' unless defined?(NONBROCHURE404) && ActionController::Base.consider_all_requests_local
|
6
6
|
end
|
7
7
|
|
@@ -1,28 +1,34 @@
|
|
1
1
|
module Rails
|
2
2
|
module Brochure
|
3
3
|
class HomeContent
|
4
|
-
# This feature needs more work.
|
4
|
+
# This feature needs more work.
|
5
5
|
# You can change the folder path and the routes are correct
|
6
6
|
# Rails::Brochure::HomeContent.home_folder_path = 'app/views/content/'
|
7
7
|
# but the home controller looks in the home folder anyway...
|
8
8
|
# So the home controller would need to use a different
|
9
9
|
# directory. If I wanted to make this configurable i'd probably
|
10
|
-
# ask for a controller name, define one (meta) and render the
|
10
|
+
# ask for a controller name, define one (meta) and render the
|
11
11
|
# routes accordingly.
|
12
12
|
@@home_folder_path = 'app/views/home/'
|
13
13
|
cattr_accessor :home_folder_path
|
14
14
|
|
15
15
|
def self.newest
|
16
|
-
HomeContent.
|
16
|
+
HomeContent.file_names.map { |f| File.new(f) }.sort { |a,b| a.ctime <=> b.ctime }.map { |f| f.ctime }.last
|
17
17
|
end
|
18
|
-
|
19
|
-
|
18
|
+
|
19
|
+
def self.file_names
|
20
|
+
files = Dir.glob("#{home_folder_path}**/*.{#{Mime::EXTENSION_LOOKUP.keys.join(",")}}.*")
|
21
|
+
#puts files.inspect
|
22
|
+
files.delete_if { |f| f.end_with?(".orig") }
|
23
|
+
files
|
20
24
|
end
|
25
|
+
|
21
26
|
def self.templates
|
22
|
-
HomeContent.
|
23
|
-
f.gsub(/(#{home_folder_path}|.
|
27
|
+
HomeContent.file_names.map do |f|
|
28
|
+
f.gsub(/(#{home_folder_path}|.(#{Mime::EXTENSION_LOOKUP.keys.join("|")})\.\w+)/,"")
|
24
29
|
end
|
25
30
|
end
|
31
|
+
|
26
32
|
end
|
27
33
|
end
|
28
|
-
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,42 +1,40 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-brochure
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Dan Hixon
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-04-19 00:00:00 -07:00
|
12
|
+
date: 2011-08-11 00:00:00.000000000 -07:00
|
14
13
|
default_executable:
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
17
16
|
name: rails
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &2153331640 !ruby/object:Gem::Requirement
|
20
18
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
24
22
|
version: 3.0.0
|
25
23
|
type: :runtime
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *2153331640
|
26
|
+
description: ! "Rails engine for brochure pages. Similar to High Voltage but with
|
27
|
+
named routes.\n Brochure pages are the semi-static pages like \"home\", \"about
|
28
|
+
us\", \"FAQ\", \"pricing\", \"contact us\", etc.\n Most of the designers I have
|
29
|
+
worked with really appreciate the power and convenience this plugin provides. They
|
30
|
+
are able to simply create erb files in folders like they are used to with static
|
31
|
+
html or php and it just works. No futzing with routes, controllers etc."
|
32
|
+
email:
|
32
33
|
- danhixon@gmail.com
|
33
34
|
executables: []
|
34
|
-
|
35
35
|
extensions: []
|
36
|
-
|
37
36
|
extra_rdoc_files: []
|
38
|
-
|
39
|
-
files:
|
37
|
+
files:
|
40
38
|
- .gitignore
|
41
39
|
- Gemfile
|
42
40
|
- MIT-LICENSE
|
@@ -58,30 +56,26 @@ files:
|
|
58
56
|
has_rdoc: true
|
59
57
|
homepage: http://github.com/danhixon/rails-brochure
|
60
58
|
licenses: []
|
61
|
-
|
62
59
|
post_install_message:
|
63
60
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
61
|
+
require_paths:
|
66
62
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
64
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
70
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
79
75
|
requirements: []
|
80
|
-
|
81
76
|
rubyforge_project: rails-brochure
|
82
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.6.2
|
83
78
|
signing_key:
|
84
79
|
specification_version: 3
|
85
80
|
summary: Rails engine for brochure pages. Similar to High Voltage but with named routes.
|
86
81
|
test_files: []
|
87
|
-
|