rails-brochure 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.files.map { |f| File.new(f) }.sort { |a,b| a.ctime <=> b.ctime }.map { |f| f.ctime }.last
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
- def self.files
19
- Dir.glob("#{home_folder_path}**/*.html.*")
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.files.map do |f|
23
- f.gsub(/(#{home_folder_path}|.html.\w+)/,"")
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
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Brochure
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  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
- prerelease: false
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
- version_requirements: *id001
27
- description: |-
28
- Rails engine for brochure pages. Similar to High Voltage but with named routes.
29
- Brochure pages are the semi-static pages like "home", "about us", "FAQ", "pricing", "contact us", etc.
30
- Most of the designers I have worked with really appreciate the power and convenience this plugin provides. They are able to simply create erb files in folders like they are used to with static html or php and it just works. No futzing with routes, controllers etc.
31
- email:
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: "0"
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: "0"
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.5.2
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
-