sitepress-rails 2.0.0.beta8 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,9 +4,18 @@ require "sitepress-rails"
4
4
  describe "Sitepress.configuration" do
5
5
  subject { Sitepress.configuration }
6
6
  let(:app) { Dummy::Application.new }
7
- let(:cache_classes) { false }
8
7
  before do
9
- app.config.eager_load = cache_classes # WTF?
8
+ # Why set to true? Because according to Rails:
9
+ #
10
+ # .config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
11
+ #
12
+ # * development - set it to false
13
+ # * test - set it to false (unless you use a tool that preloads your test environment)
14
+ # * production - set it to true
15
+ #
16
+ # The view initializer for haml runs in a `ActiveSupport.on_load(:action_view)`, which requires
17
+ # `eager_load = true` to test.
18
+ app.config.eager_load = true
10
19
  end
11
20
  it "has Rails.application as parent engine" do
12
21
  app.initialize!
@@ -16,4 +25,8 @@ describe "Sitepress.configuration" do
16
25
  app.initialize!
17
26
  expect(subject.routes).to be true
18
27
  end
28
+ it "sets Sitepress::Path.template_extensions" do
29
+ app.initialize!
30
+ expect(Sitepress::Path.handler_extensions).to eql([:raw, :erb, :html, :builder, :ruby])
31
+ end
19
32
  end
@@ -3,6 +3,7 @@ require "spec_helper"
3
3
  describe Sitepress::SiteController, type: :controller do
4
4
  # Rails 5 introduces a new format of calling the `get` rspec helper method.
5
5
  def get_resource(path)
6
+ request.env["PATH_INFO"] = path
6
7
  if Gem::Version.new(Rails.version) >= Gem::Version.new("5.0.0")
7
8
  get :show, params: { resource_path: path }
8
9
  else
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,8 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
3
3
  ENV['RAILS_ENV'] ||= 'test'
4
4
 
5
5
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
6
- require 'rspec/rails'
6
+ require "rspec/rails"
7
+ require "pry"
7
8
 
8
9
  Rails.backtrace_cleaner.remove_silencers!
9
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitepress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta8
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0.beta8
61
+ version: 2.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0.beta8
68
+ version: 2.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: railties
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -129,6 +129,7 @@ files:
129
129
  - lib/sitepress/rails_configuration.rb
130
130
  - lib/sitepress/renderers/controller.rb
131
131
  - lib/sitepress/renderers/server.rb
132
+ - lib/sitepress/rendition.rb
132
133
  - lib/sitepress/route_constraint.rb
133
134
  - lib/tasks/sitepress_tasks.rake
134
135
  - rails/app/controllers/concerns/sitepress/site_pages.rb
@@ -143,7 +144,7 @@ files:
143
144
  - spec/dummy/app/content/helpers/sample_helper.rb
144
145
  - spec/dummy/app/content/layouts/sitepress_test_layout.html.erb
145
146
  - spec/dummy/app/content/pages/_stupid.html.erb
146
- - spec/dummy/app/content/pages/all_pages.html.erb.html
147
+ - spec/dummy/app/content/pages/all_pages.html.erb
147
148
  - spec/dummy/app/content/pages/hi.html
148
149
  - spec/dummy/app/content/pages/partials/_really_stupid.html.erb
149
150
  - spec/dummy/app/content/pages/time.html.erb
@@ -208,7 +209,8 @@ files:
208
209
  - spec/sites/sample/pages/text.txt
209
210
  - spec/spec_helper.rb
210
211
  homepage: https://github.com/sitepress/sitepress
211
- licenses: []
212
+ licenses:
213
+ - MIT
212
214
  metadata: {}
213
215
  post_install_message:
214
216
  rdoc_options: []
@@ -221,84 +223,84 @@ required_ruby_version: !ruby/object:Gem::Requirement
221
223
  version: '0'
222
224
  required_rubygems_version: !ruby/object:Gem::Requirement
223
225
  requirements:
224
- - - ">"
226
+ - - ">="
225
227
  - !ruby/object:Gem::Version
226
- version: 1.3.1
228
+ version: '0'
227
229
  requirements: []
228
- rubygems_version: 3.1.4
230
+ rubygems_version: 3.2.3
229
231
  signing_key:
230
232
  specification_version: 4
231
233
  summary: Sitepress rails integration.
232
234
  test_files:
233
- - spec/spec_helper.rb
234
- - spec/sitepress-rails_spec.rb
235
- - spec/dummy/app/mailers/application_mailer.rb
235
+ - spec/dummy/Rakefile
236
+ - spec/dummy/app/assets/config/manifest.js
237
+ - spec/dummy/app/assets/javascripts/application.js
238
+ - spec/dummy/app/assets/javascripts/cable.js
239
+ - spec/dummy/app/assets/stylesheets/application.css
240
+ - spec/dummy/app/content/helpers/sample_helper.rb
236
241
  - spec/dummy/app/content/layouts/sitepress_test_layout.html.erb
237
- - spec/dummy/app/content/pages/all_pages.html.erb.html
238
- - spec/dummy/app/content/pages/time.html.erb
239
242
  - spec/dummy/app/content/pages/_stupid.html.erb
243
+ - spec/dummy/app/content/pages/all_pages.html.erb
240
244
  - spec/dummy/app/content/pages/hi.html
241
245
  - spec/dummy/app/content/pages/partials/_really_stupid.html.erb
242
- - spec/dummy/app/content/helpers/sample_helper.rb
243
- - spec/dummy/app/jobs/application_job.rb
246
+ - spec/dummy/app/content/pages/time.html.erb
244
247
  - spec/dummy/app/controllers/application_controller.rb
245
248
  - spec/dummy/app/controllers/baseline_controller.rb
249
+ - spec/dummy/app/helpers/application_helper.rb
250
+ - spec/dummy/app/jobs/application_job.rb
251
+ - spec/dummy/app/mailers/application_mailer.rb
246
252
  - spec/dummy/app/views/baseline/show.html.erb
247
253
  - spec/dummy/app/views/layouts/application.html.erb
248
254
  - spec/dummy/app/views/layouts/mailer.html.erb
249
255
  - spec/dummy/app/views/layouts/mailer.text.erb
250
- - spec/dummy/app/assets/config/manifest.js
251
- - spec/dummy/app/assets/javascripts/cable.js
252
- - spec/dummy/app/assets/javascripts/application.js
253
- - spec/dummy/app/assets/stylesheets/application.css
254
- - spec/dummy/app/helpers/application_helper.rb
255
- - spec/dummy/bin/update
256
- - spec/dummy/bin/rake
257
- - spec/dummy/bin/setup
258
256
  - spec/dummy/bin/bundle
259
257
  - spec/dummy/bin/rails
260
- - spec/dummy/config/secrets.yml
261
- - spec/dummy/config/routes.rb
262
- - spec/dummy/config/locales/en.yml
258
+ - spec/dummy/bin/rake
259
+ - spec/dummy/bin/setup
260
+ - spec/dummy/bin/update
261
+ - spec/dummy/config/application.rb
262
+ - spec/dummy/config/boot.rb
263
263
  - spec/dummy/config/cable.yml
264
- - spec/dummy/config/environments/production.rb
264
+ - spec/dummy/config/database.yml
265
+ - spec/dummy/config/environment.rb
265
266
  - spec/dummy/config/environments/development.rb
267
+ - spec/dummy/config/environments/production.rb
266
268
  - spec/dummy/config/environments/test.rb
267
- - spec/dummy/config/spring.rb
268
- - spec/dummy/config/environment.rb
269
- - spec/dummy/config/application.rb
270
- - spec/dummy/config/puma.rb
271
- - spec/dummy/config/database.yml
272
- - spec/dummy/config/boot.rb
273
269
  - spec/dummy/config/initializers/application_controller_renderer.rb
270
+ - spec/dummy/config/initializers/assets.rb
274
271
  - spec/dummy/config/initializers/backtrace_silencers.rb
275
- - spec/dummy/config/initializers/null_logger.rb
276
- - spec/dummy/config/initializers/mime_types.rb
272
+ - spec/dummy/config/initializers/cookies_serializer.rb
277
273
  - spec/dummy/config/initializers/filter_parameter_logging.rb
274
+ - spec/dummy/config/initializers/inflections.rb
275
+ - spec/dummy/config/initializers/mime_types.rb
276
+ - spec/dummy/config/initializers/null_logger.rb
278
277
  - spec/dummy/config/initializers/session_store.rb
279
278
  - spec/dummy/config/initializers/wrap_parameters.rb
280
- - spec/dummy/config/initializers/assets.rb
281
- - spec/dummy/config/initializers/cookies_serializer.rb
282
- - spec/dummy/config/initializers/inflections.rb
279
+ - spec/dummy/config/locales/en.yml
280
+ - spec/dummy/config/puma.rb
281
+ - spec/dummy/config/routes.rb
282
+ - spec/dummy/config/secrets.yml
283
+ - spec/dummy/config/spring.rb
283
284
  - spec/dummy/config.ru
284
- - spec/dummy/Rakefile
285
- - spec/dummy/public/favicon.ico
285
+ - spec/dummy/db/test.sqlite3
286
+ - spec/dummy/log/production.log
287
+ - spec/dummy/log/test.log
288
+ - spec/dummy/public/404.html
286
289
  - spec/dummy/public/422.html
287
- - spec/dummy/public/apple-touch-icon.png
288
290
  - spec/dummy/public/500.html
289
- - spec/dummy/public/404.html
290
291
  - spec/dummy/public/apple-touch-icon-precomposed.png
291
- - spec/dummy/db/test.sqlite3
292
- - spec/dummy/log/test.log
293
- - spec/dummy/log/production.log
292
+ - spec/dummy/public/apple-touch-icon.png
293
+ - spec/dummy/public/favicon.ico
294
+ - spec/sitepress/compiler_spec.rb
295
+ - spec/sitepress/rails_configuration_spec.rb
296
+ - spec/sitepress/route_constraint_spec.rb
297
+ - spec/sitepress/routes_spec.rb
298
+ - spec/sitepress/sitepress_site_controller_spec.rb
299
+ - spec/sitepress-rails_spec.rb
294
300
  - spec/sites/sample/pages/index.html.erb
295
- - spec/sites/sample/pages/test.html.haml
301
+ - spec/sites/sample/pages/nothing
296
302
  - spec/sites/sample/pages/sin_frontmatter.html.haml
297
303
  - spec/sites/sample/pages/super.duper/index.html
298
- - spec/sites/sample/pages/nothing
304
+ - spec/sites/sample/pages/test.html.haml
299
305
  - spec/sites/sample/pages/text.txt
300
- - spec/sitepress/sitepress_site_controller_spec.rb
301
- - spec/sitepress/rails_configuration_spec.rb
302
- - spec/sitepress/routes_spec.rb
303
- - spec/sitepress/route_constraint_spec.rb
304
- - spec/sitepress/compiler_spec.rb
306
+ - spec/spec_helper.rb