mascot-rails 0.1.10 → 0.1.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caeb4e9d3358795caca308e4bcde64aedcfc3c53
4
- data.tar.gz: 3bd5459e233d6aaf63cd0688cbe49b8e03607bf4
3
+ metadata.gz: 29781381e53ccaa59c4ad31f6d72f7d3758ce577
4
+ data.tar.gz: a7fc2422181f3cdc8a92ddb2656f08dc16197f27
5
5
  SHA512:
6
- metadata.gz: 949e6a663e31606e5108ce3001a7f90b760908f98e69090bad9833f1724312bb1c00210e771a7944ae985931a871b2fed85083d56b215e95d5777c79a6a4f44b
7
- data.tar.gz: d93dbfcfd1db87a8d9a7d5793e02f64cc2ca1b01870f4b40dea99c8db3d9e93b8ed5c1838d93d073f2e181a0b22bee93ac46e9007d5b0d56b03d2896c0b6434c
6
+ metadata.gz: 40015fba5b9569f3fe55000e73b497abfc3d3d1d90a44bb2171a2ce00b0f853319d008a0595235fbebe1e86c280152596a16d8cfa1a286289058b9d453753fce
7
+ data.tar.gz: e1672053721e6092c34966dddae73f24170db1b1bf2fdd523965ec3552fd33d7cc65e9a8be67bb66ccd677cd79b4c5d57c9d2dbf1986d8007eb131db64a58a3b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Mascot
2
2
 
3
- Mascot is a file-backed website content manager that can be embedded in popular web frameworks like Rails. Inspired by [Middleman](https://middlemanapp.com), Mascot is stripped down with less dependencies to work better within Rails. That mean it ships with Frontmatter, the Sitemap API, and a few templating features. [Learn more about Mascot](https://github.com/bradgessler/mascot).
3
+ Mascot is a file-backed website content manager that can be embedded in popular web frameworks like Rails. Inspired by [Middleman](https://middlemanapp.com), Mascot is stripped down with less dependencies to work better within Rails. That mean it ships with Frontmatter, the Site API, and a few templating features. [Learn more about Mascot](https://github.com/bradgessler/mascot).
4
4
 
5
5
  ## Installation
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Mascot
2
- class SitemapController < ::ApplicationController
2
+ class SiteController < ::ApplicationController
3
3
  rescue_from Mascot::PageNotFoundError, with: :page_not_found
4
4
 
5
5
  def show
data/config/routes.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  Mascot.configuration.parent_engine.routes.draw do
2
2
  if Mascot.configuration.routes
3
3
  constraints Mascot::RouteConstraint.new do
4
- get "*resource_path", controller: "mascot/sitemap", action: "show", as: :page, format: false
4
+ get "*resource_path", controller: "mascot/site", action: "show", as: :page, format: false
5
5
  end
6
6
  end
7
7
  end
@@ -26,7 +26,7 @@ module Mascot
26
26
  content_type: resource.mime_type.to_s
27
27
  end
28
28
 
29
- # Mascot::PageNotFoundError is handled in the default Mascot::SitemapController
29
+ # Mascot::PageNotFoundError is handled in the default Mascot::SiteController
30
30
  # with an execption that Rails can use to display a 404 error.
31
31
  def get(path)
32
32
  resource = resources.get(path)
data/lib/mascot/rails.rb CHANGED
@@ -2,7 +2,7 @@ require "mascot"
2
2
 
3
3
  module Mascot
4
4
  # Contains singletons for rails and some configuration data.
5
- Configuration = Struct.new(:sitemap, :routes, :parent_engine)
5
+ Configuration = Struct.new(:site, :routes, :parent_engine)
6
6
 
7
7
  # Rescued by ActionController to display page not found error.
8
8
  PageNotFoundError = Class.new(StandardError)
@@ -14,7 +14,6 @@ module Mascot
14
14
  autoload :RailsRequestPaths, "mascot/extensions/rails_request_paths"
15
15
  autoload :PartialsRemover, "mascot/extensions/partials_remover"
16
16
  autoload :IndexRequestPath, "mascot/extensions/index_request_path"
17
- autoload :Layouts, "mascot/extensions/layouts"
18
17
  end
19
18
 
20
19
  # Default configuration object for Mascot Rails integration.
@@ -2,9 +2,9 @@ module Mascot
2
2
  # Configuration object for rails application.
3
3
  class RailsConfiguration
4
4
  # Store in ./app/pages by default.
5
- DEFAULT_SITEMAP_ROOT = "app/pages".freeze
5
+ DEFAULT_SITE_ROOT = "app/pages".freeze
6
6
 
7
- attr_accessor :sitemap, :resources, :parent_engine, :routes, :cache_resources, :partials
7
+ attr_accessor :site, :resources, :parent_engine, :routes, :cache_resources, :partials
8
8
 
9
9
  # Set defaults.
10
10
  def initialize
@@ -14,10 +14,10 @@ module Mascot
14
14
  @partials = false
15
15
  end
16
16
 
17
- def sitemap
18
- @sitemap ||= Sitemap.new(root: default_root).tap do |sitemap|
19
- sitemap.extensions << Extensions::PartialsRemover.new unless partials
20
- sitemap.extensions << Extensions::RailsRequestPaths.new
17
+ def site
18
+ @site ||= Site.new(root: default_root).tap do |site|
19
+ site.resources_pipeline << Extensions::PartialsRemover.new unless partials
20
+ site.resources_pipeline << Extensions::RailsRequestPaths.new
21
21
  end
22
22
  end
23
23
 
@@ -25,7 +25,7 @@ module Mascot
25
25
  # Production will cache resources globally. This drastically speeds up
26
26
  # the speed at which resources are served, but if they change it won't be updated.
27
27
  @resources = nil unless cache_resources?
28
- @resources ||= sitemap.resources
28
+ @resources ||= site.resources
29
29
  end
30
30
 
31
31
  def cache_resources?
@@ -34,7 +34,7 @@ module Mascot
34
34
 
35
35
  private
36
36
  def default_root
37
- Rails.root.join(DEFAULT_SITEMAP_ROOT)
37
+ Rails.root.join(DEFAULT_SITE_ROOT)
38
38
  end
39
39
  end
40
40
  end
@@ -18,7 +18,7 @@ Rails.application.configure do
18
18
  config.assets.js_compressor = :uglifier
19
19
  # config.assets.css_compressor = :sass
20
20
 
21
- # Do not fallback to assets pipeline if a precompiled asset is missed.
21
+ # Do not fallback to assets resources_pipeline if a precompiled asset is missed.
22
22
  config.assets.compile = false
23
23
 
24
24
  # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb