rails-brochure 0.1.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -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.1"
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,45 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-brochure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
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-11-19 00:00:00.000000000 Z
11
+ date: 2024-06-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
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
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 3.0.0
30
- description: ! "Rails engine for brochure pages. Similar to High Voltage but with
31
- named routes.\n Brochure pages are the semi-static pages like \"home\", \"about
32
- us\", \"FAQ\", \"pricing\", \"contact us\", etc.\n Most of the designers I have
33
- worked with really appreciate the power and convenience this plugin provides. They
34
- are able to simply create erb files in folders like they are used to with static
35
- html or php and it just works. No futzing with routes, controllers etc."
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.
36
31
  email:
37
32
  - danhixon@gmail.com
38
33
  executables: []
39
34
  extensions: []
40
35
  extra_rdoc_files: []
41
36
  files:
42
- - .gitignore
37
+ - ".gitignore"
43
38
  - Gemfile
44
39
  - MIT-LICENSE
45
40
  - README.md
@@ -59,26 +54,24 @@ files:
59
54
  - rails-brochure.gemspec
60
55
  homepage: http://github.com/danhixon/rails-brochure
61
56
  licenses: []
62
- post_install_message:
57
+ metadata: {}
58
+ post_install_message:
63
59
  rdoc_options: []
64
60
  require_paths:
65
61
  - lib
66
62
  required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
63
  requirements:
69
- - - ! '>='
64
+ - - ">="
70
65
  - !ruby/object:Gem::Version
71
66
  version: '0'
72
67
  required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
68
  requirements:
75
- - - ! '>='
69
+ - - ">="
76
70
  - !ruby/object:Gem::Version
77
71
  version: '0'
78
72
  requirements: []
79
- rubyforge_project: rails-brochure
80
- rubygems_version: 1.8.24
81
- signing_key:
82
- specification_version: 3
73
+ rubygems_version: 3.1.6
74
+ signing_key:
75
+ specification_version: 4
83
76
  summary: Rails engine for brochure pages. Similar to High Voltage but with named routes.
84
77
  test_files: []