rails-brochure 0.1.0 → 0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1403121def49913f128ee8d5ca2c18d737a056c642865be87045013ea0b136d2
4
+ data.tar.gz: 1e2d7679dfbb73626dbb83d7617c807246c59c34ac2c6385424d3714084b2c26
5
+ SHA512:
6
+ metadata.gz: 0d163ae8dfe5eef70abf544ddf8b0d2aee569f30898a729141f642d2ef82acf22481f98203f18a61e5c323cf1585b5ecf7ba5d22b9766c52e83f048ac8bc244b
7
+ data.tar.gz: 050dd73d9684d553e38683526c830cafbfd88653b37ba52a853a12b54ec2e28c8c16b67d74f47c7065af680aaf4c4e945cb81e1e8d1773a02aeaba1ed9463790
data/README.md CHANGED
@@ -10,7 +10,7 @@ Most of the designers I have worked with really appreciate the power and conveni
10
10
  Installation
11
11
  ------------
12
12
 
13
- Rails 3 required.
13
+ Rails 5+ required.
14
14
 
15
15
  Include in your Gemfile:
16
16
 
@@ -20,9 +20,8 @@ Don't forget to install:
20
20
 
21
21
  $ bundle install
22
22
 
23
- You can install from the command line as well:
23
+ $ rails generate brochure home
24
24
 
25
- $ sudo gem install rails-brochure
26
25
 
27
26
  Usage
28
27
  -----
@@ -56,7 +55,7 @@ Name Routes?
56
55
 
57
56
  Named routes are good because if you change a page name (about.html.erb to about_us.html.erb) without updating the links you'll get failing tests:
58
57
 
59
- ActionView::TemplateError: undefined local variable or method `about_path'
58
+ ActionView::TemplateError: undefined local variable or method `about_path'
60
59
 
61
60
 
62
61
  Override
@@ -97,4 +96,4 @@ Enjoy!
97
96
  License
98
97
  -------
99
98
 
100
- Rails Brochure is Copyright © 2010-2011 Dan Hixon. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
99
+ Rails Brochure is Copyright © 2010-2024 Dan Hixon. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
data/config/routes.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
  Rails::Brochure::HomeContent.templates.each do |pg|
3
- match "/#{pg}" => "home##{pg}", :as => pg.gsub(/(\/|-)/,'_').to_sym
3
+ get "/#{pg}" => "home##{pg}", :as => pg.gsub(/(\/|-)/,'_').to_sym
4
4
  end
5
- match '*a', :to => 'home#four_zero_four' unless defined?(NONBROCHURE404) && Rails.application.config.consider_all_requests_local
5
+ get '*a', :to => 'home#four_zero_four' unless defined?(NONBROCHURE404) && Rails.application.config.consider_all_requests_local
6
6
  end
7
7
 
data/lib/generators/USAGE CHANGED
@@ -1,8 +1,5 @@
1
- Description:
2
- Explain the generator
3
-
4
1
  Example:
5
- rails generate brochure
2
+ rails generate brochure home
6
3
 
7
4
  This will create:
8
5
  app/views/home
@@ -1,3 +1,9 @@
1
1
  class BrochureGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
+
4
+ def home
5
+ copy_file "index.html.erb", "#{Rails.root}/app/views/home/index.html.erb"
6
+ copy_file "four_zero_four.html.erb", "#{Rails.root}/app/views/home/four_zero_four.html.erb"
7
+ copy_file "about.html.erb", "#{Rails.root}/app/views/home/about.html.erb"
8
+ end
3
9
  end
@@ -4,7 +4,7 @@ module Rails
4
4
  module Brochure
5
5
  class Engine < Rails::Engine
6
6
  initializer "brochure routes" do |app|
7
- app.middleware.use "Rails::Brochure::RouteReloader"
7
+ app.middleware.use Rails::Brochure::RouteReloader
8
8
  end if Rails.env.development?
9
9
  end
10
10
  end
@@ -25,7 +25,7 @@ module Rails
25
25
 
26
26
  def self.templates
27
27
  HomeContent.file_names.map do |f|
28
- f.gsub(/(#{home_folder_path}|.(#{Mime::EXTENSION_LOOKUP.keys.join("|")})\.\w+)/,"")
28
+ f.gsub(/(#{home_folder_path}|\.(#{Mime::EXTENSION_LOOKUP.keys.join("|")})\.\w+)/,"")
29
29
  end
30
30
  end
31
31
 
@@ -15,6 +15,7 @@ module Rails
15
15
  Rails.logger.info "ROUTES RELOADED by rails-brochure"
16
16
  end
17
17
  def new_content?
18
+ return true if HomeContent.newest.nil? || last_route_change.nil?
18
19
  HomeContent.newest > last_route_change
19
20
  end
20
21
  def last_route_change
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Brochure
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2"
4
4
  end
5
5
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  Brochure pages are the semi-static pages like "home", "about us", "FAQ", "pricing", "contact us", etc.
15
15
  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.}
16
16
 
17
- s.add_dependency('rails', '>= 3.0.0')
17
+ s.add_dependency('rails', '>= 5.0.0')
18
18
 
19
19
  s.rubyforge_project = "rails-brochure"
20
20
 
metadata CHANGED
@@ -1,40 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-brochure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: '0.2'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dan Hixon
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-02-01 00:00:00.000000000Z
11
+ date: 2024-06-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
- requirement: &70201258059080 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
- version: 3.0.0
19
+ version: 5.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70201258059080
25
- description: ! "Rails engine for brochure pages. Similar to High Voltage but with
26
- named routes.\n Brochure pages are the semi-static pages like \"home\", \"about
27
- us\", \"FAQ\", \"pricing\", \"contact us\", etc.\n Most of the designers I have
28
- worked with really appreciate the power and convenience this plugin provides. They
29
- are able to simply create erb files in folders like they are used to with static
30
- html or php and it just works. No futzing with routes, controllers etc."
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 5.0.0
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
31
  email:
32
32
  - danhixon@gmail.com
33
33
  executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - .gitignore
37
+ - ".gitignore"
38
38
  - Gemfile
39
39
  - MIT-LICENSE
40
40
  - README.md
@@ -54,26 +54,24 @@ files:
54
54
  - rails-brochure.gemspec
55
55
  homepage: http://github.com/danhixon/rails-brochure
56
56
  licenses: []
57
- post_install_message:
57
+ metadata: {}
58
+ post_install_message:
58
59
  rdoc_options: []
59
60
  require_paths:
60
61
  - lib
61
62
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
63
  requirements:
64
- - - ! '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
- none: false
69
68
  requirements:
70
- - - ! '>='
69
+ - - ">="
71
70
  - !ruby/object:Gem::Version
72
71
  version: '0'
73
72
  requirements: []
74
- rubyforge_project: rails-brochure
75
- rubygems_version: 1.8.10
76
- signing_key:
77
- specification_version: 3
73
+ rubygems_version: 3.1.6
74
+ signing_key:
75
+ specification_version: 4
78
76
  summary: Rails engine for brochure pages. Similar to High Voltage but with named routes.
79
77
  test_files: []