simplec 0.8.1 → 0.9.0

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: 9dee3744e8854330cbcf79ae6c9f2495c342a02e
4
- data.tar.gz: ff0bceb7a5930bee2c635b0cc9d46076ee70bc99
3
+ metadata.gz: 6da431d0794fc83ae168fc4d1f2855c197d92c88
4
+ data.tar.gz: 9cd04030ce94fbd255a5a5e7405acfe408950821
5
5
  SHA512:
6
- metadata.gz: d93a2f80baa72c5db2973d063d4246c9eac0bf218be65576be8b9162733e6188cd74b85240418cc72acd40d7df426ea01f802d7e9e277c5087fd294175a59a66
7
- data.tar.gz: 0bd3858809d3d3587920e1989e879f37e5fcdca6fcc4bce2b556f0a5fc5041e8e0b5a67ce25e6b7f9c318b8e8654e0effef128b61be40834cb643970ad781744
6
+ metadata.gz: 402d2c6060119484e6cf59095622ca890487c6e31c5d7fd1484cde6e2dc98bd8bcf57db646f76f88ddf7a3c994676511be1d4e729f1cc7ec0c293833cfc208f1
7
+ data.tar.gz: 8a09931c608d7c9e30343808d587d0869be34b912a9e88c7fa98655735c9c90b9a02e391dcd066a217fcfd8049b5ccdfe8fd8458671d888b0a4f9c302b5d0819
@@ -0,0 +1,10 @@
1
+ require_dependency "simplec/application_controller"
2
+
3
+ module Simplec
4
+ class SitemapsController < ApplicationController
5
+
6
+ def show
7
+ @pages = Page.includes(:subdomain)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ xml.urlset('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9') do
2
+ @pages.find_each do |page|
3
+ xml.url {
4
+ xml.loc simplec_url_for(page)
5
+ xml.lastmod page.updated_at.strftime("%F")
6
+ xml.changefreq 'daily'
7
+ xml.priority 1.0
8
+ }
9
+ end
10
+ end
@@ -1,7 +1,12 @@
1
1
  Simplec::Engine.routes.draw do
2
2
 
3
3
  scope constraints: Simplec::Subdomains do
4
+ get '/sitemap', to: 'sitemaps#show',
5
+ format: :xml,
6
+ constraints: {subdomain: [nil, 'www']}
7
+
4
8
  resources :embedded_images, path: 'embedded-images', only: :create
9
+
5
10
  root 'pages#show'
6
11
  get '(*path)', to: 'pages#show', as: :page
7
12
  end
@@ -3,6 +3,7 @@ require "simplec/embedded_image_actions"
3
3
  require 'simplec/action_controller/extensions'
4
4
  require 'simplec/action_view/helper'
5
5
  require "simplec/page_action_helpers"
6
+ require "simplec/nokogiri_builder"
6
7
 
7
8
 
8
9
  # Configuration details will go here.
@@ -0,0 +1,14 @@
1
+ require 'nokogiri'
2
+
3
+ module Simplec
4
+ class NokogiriBuilder
5
+ class_attribute :default_format
6
+ self.default_format = Mime[:xml]
7
+
8
+ def self.call(template)
9
+ "xml = ::Nokogiri::XML::Builder.new(encoding: 'UTF-8') { |xml| #{template.source} }.to_xml;"
10
+ end
11
+ end
12
+ end
13
+
14
+ ActionView::Template.register_template_handler :nokogiri, Simplec::NokogiriBuilder
@@ -1,3 +1,3 @@
1
1
  module Simplec
2
- VERSION = '0.8.1'
2
+ VERSION = '0.9.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -131,6 +131,7 @@ files:
131
131
  - app/controllers/simplec/application_controller.rb
132
132
  - app/controllers/simplec/embedded_images_controller.rb
133
133
  - app/controllers/simplec/pages_controller.rb
134
+ - app/controllers/simplec/sitemaps_controller.rb
134
135
  - app/helpers/simplec/application_helper.rb
135
136
  - app/jobs/simplec/application_job.rb
136
137
  - app/mailers/simplec/application_mailer.rb
@@ -147,6 +148,7 @@ files:
147
148
  - app/views/simplec/fields/_string.html.erb
148
149
  - app/views/simplec/fields/_text.html.erb
149
150
  - app/views/simplec/pages/show.html.erb
151
+ - app/views/simplec/sitemaps/show.xml.nokogiri
150
152
  - config/routes.rb
151
153
  - db/migrate/20170809204353_create_simplec_pages.rb
152
154
  - db/migrate/20170809204511_create_simplec_subdomains.rb
@@ -159,6 +161,7 @@ files:
159
161
  - lib/simplec/action_view/helper.rb
160
162
  - lib/simplec/embedded_image_actions.rb
161
163
  - lib/simplec/engine.rb
164
+ - lib/simplec/nokogiri_builder.rb
162
165
  - lib/simplec/page_action_helpers.rb
163
166
  - lib/simplec/version.rb
164
167
  - lib/tasks/simplec_tasks.rake