codelation_pages 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e332d98b13a451bd9b25927ba637431a7842f9e
4
- data.tar.gz: beab49bea9de66f93582e643fa7b6ed7787851ef
3
+ metadata.gz: 40daeec35ee06a74876f3ecc888d6298b0bcaf15
4
+ data.tar.gz: 057b78d2ab08426a0eb42ba510eb51489f8a2fd3
5
5
  SHA512:
6
- metadata.gz: ba4846af69fbdcd812fc491ae226ff0adc8f1603fe42d889936fed6dca86181f2b4fa19039b431172af6eaec7a5780a7d1f36e90cdb3f3a6e5872f15e0601350
7
- data.tar.gz: 3ff9bda4b5bd0964e945fabcee96179d21389bc3314d3f42bf3714a70d95f80a034685d86e6596378ac6f13391404bdf73800c175381f5802fc219d5acb9692b
6
+ metadata.gz: e57bd565bf89e43a0c57f880570958d07fdf095f7eca8b70c95c572025b3529f22bf21cabe9a71e79e36af36d861b13b00bcb2e654844aba2d61abceacacb32e
7
+ data.tar.gz: 3ae3a38d45ee05cd2fb548a7c979e89870f8fc0b78059801af92f29275e8a56bde7ec249468106474df93b483d5fea0d9daf1fa035be83dc3124a8e3a55e2912
data/README.md CHANGED
@@ -58,7 +58,25 @@ end
58
58
 
59
59
  ## IMPORTANT
60
60
 
61
- **You will need to restart your Rails server after adding new page files.***
61
+ **You will need to restart your Rails server after adding new page files.**
62
+
63
+ ## Page Titles
64
+
65
+ I recommend using the [Title](https://github.com/calebthompson/title) gem for storing page titles. Using `codelation_pages`, your `en.yml` file will look something like this:
66
+
67
+ ```yml
68
+ en:
69
+ titles:
70
+ application: This is the default title
71
+ pages:
72
+ about_us: About Us
73
+ features:
74
+ index: Features
75
+ overview: Features > Overview
76
+ index: Home Page
77
+ posts:
78
+ index: Codelation Blog
79
+ ```
62
80
 
63
81
  ## Contributing
64
82
 
@@ -1,3 +1,3 @@
1
1
  module CodelationPages
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
@@ -32,7 +32,7 @@ module ActionDispatch
32
32
  # Returns whether or not a custom controller file exists.
33
33
  # @param directory_name [String]
34
34
  def custom_controller_exists(directory_name)
35
- File.exist?(Rails.root.join("app", "controllers", "pages", "#{directory_name}_controller.rb"))
35
+ return true if File.exist?(Rails.root.join("app", "controllers", "pages", "#{directory_name}_controller.rb"))
36
36
  end
37
37
 
38
38
  # Draws the routes for static pages within sub folders.
@@ -97,12 +97,14 @@ module ActionDispatch
97
97
 
98
98
  # Returns whether or not the PagesController file exists.
99
99
  def pages_controller_exists
100
- File.exist?(Rails.root.join("app", "controllers", "pages_controller.rb"))
100
+ return true if File.exist?(Rails.root.join("app", "controllers", "pages_controller.rb"))
101
+ Object.const_defined?("PagesControllers")
101
102
  end
102
103
 
103
104
  # Returns whether or not the pages module directory exists
104
105
  def pages_module_exists
105
- File.exist?(Rails.root.join("app", "controllers", "pages"))
106
+ return true if File.exist?(Rails.root.join("app", "controllers", "pages"))
107
+ Object.const_defined?("Pages")
106
108
  end
107
109
  end
108
110
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codelation_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison