Hello community, here is the log from the commit of package rubygem-js-routes for openSUSE:Factory checked in at 2016-08-09 22:15:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-js-routes (Old) and /work/SRC/openSUSE:Factory/.rubygem-js-routes.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-js-routes" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-js-routes/rubygem-js-routes.changes 2016-07-20 09:24:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-js-routes.new/rubygem-js-routes.changes 2016-08-09 22:15:05.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Aug 6 04:37:31 UTC 2016 - [email protected] + +- updated to version 1.2.8 + see installed CHANGELOG.md + + ## v1.2.8 + + * Bugfix warning on Sprockets 4.0 #202 + +------------------------------------------------------------------- Old: ---- js-routes-1.2.7.gem New: ---- js-routes-1.2.8.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-js-routes.spec ++++++ --- /var/tmp/diff_new_pack.D9TnAg/_old 2016-08-09 22:15:06.000000000 +0200 +++ /var/tmp/diff_new_pack.D9TnAg/_new 2016-08-09 22:15:06.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-js-routes -Version: 1.2.7 +Version: 1.2.8 Release: 0 %define mod_name js-routes %define mod_full_name %{mod_name}-%{version} ++++++ js-routes-1.2.7.gem -> js-routes-1.2.8.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-07-14 12:23:49.000000000 +0200 +++ new/CHANGELOG.md 2016-08-05 12:52:33.000000000 +0200 @@ -1,5 +1,9 @@ ## master +## v1.2.8 + +* Bugfix warning on Sprockets 4.0 #202 + ## v1.2.7 * Drop support 1.9.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2016-07-14 12:23:49.000000000 +0200 +++ new/Rakefile 2016-08-05 12:52:33.000000000 +0200 @@ -12,9 +12,22 @@ require 'rspec/core' require 'rspec/core/rake_task' require 'appraisal' +load "rails/tasks/routes.rake" RSpec::Core::RakeTask.new(:spec) task :test_all => :appraisal # test all rails -task :default => :spec \ No newline at end of file +task :default => :spec + + +namespace :spec do + task :routes do + require './spec/spec_helper' + require 'action_dispatch/routing/inspector' + draw_routes + all_routes = Rails.application.routes.routes + inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes) + puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER']) + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Readme.md new/Readme.md --- old/Readme.md 2016-07-14 12:23:49.000000000 +0200 +++ new/Readme.md 2016-08-05 12:52:33.000000000 +0200 @@ -16,9 +16,7 @@ Require js routes file in `application.js` or other bundle ``` js -/* -= require js-routes -*/ +//= require js-routes ``` Also in order to flush asset pipeline cache sometimes you might need to run: Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/js_routes/engine.rb new/lib/js_routes/engine.rb --- old/lib/js_routes/engine.rb 2016-07-14 12:23:49.000000000 +0200 +++ new/lib/js_routes/engine.rb 2016-08-05 12:52:33.000000000 +0200 @@ -1,30 +1,69 @@ -require 'sprockets/version' +class JsRoutesSprocketsExtension + def initialize(filename, &block) + @filename = filename + @source = block.call + end -class JsRoutes - SPROCKETS3 = Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new('3.0.0') - class Engine < ::Rails::Engine + def render(context, empty_hash_wtf) + self.class.run(@filename, @source, context) + end - if SPROCKETS3 - initializer 'js-routes.dependent_on_routes', after: :engines_blank_point, before: :finisher_hook do - Rails.application.config.assets.configure do |config| + def self.run(filename, source, context) + if context.logical_path == 'js-routes' + routes = Rails.root.join('config', 'routes.rb').to_s + context.depend_on(routes) + end + source + end + + def self.call(input) + filename = input[:filename] + source = input[:data] + context = input[:environment].context_class.new(input) + + result = run(filename, source, context) + context.metadata.merge(data: result) + end +end + + +class Engine < ::Rails::Engine + require 'sprockets/version' + v2 = Gem::Dependency.new('', ' ~> 2') + v3 = Gem::Dependency.new('', ' ~> 3') + v4 = Gem::Dependency.new('', ' >= 4') + sprockets_version = Gem::Version.new(Sprockets::VERSION).release + initializer_args = case sprockets_version + when -> (v) { v2.match?('', v) } + { after: "sprockets.environment" } + when -> (v) { v3.match?('', v) || v4.match?('', v) } + { after: :engines_blank_point, before: :finisher_hook } + else + raise StandardError, "Sprockets version #{sprockets_version} is not supported" + end + + initializer 'js-routes.dependent_on_routes', initializer_args do + case sprockets_version + when -> (v) { v2.match?('', v) } + if Rails.application.assets.respond_to?(:register_preprocessor) routes = Rails.root.join('config', 'routes.rb').to_s - config.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx,data| + Rails.application.assets.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx, data| ctx.depend_on(routes) if ctx.logical_path == 'js-routes' data end end - end - else - initializer 'js-routes.dependent_on_routes', after: "sprockets.environment" do - - if Rails.application.assets.respond_to?(:register_preprocessor) + when -> (v) { v3.match?('', v) } + Rails.application.config.assets.configure do |config| routes = Rails.root.join('config', 'routes.rb').to_s - Rails.application.assets.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx,data| + config.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx, data| ctx.depend_on(routes) if ctx.logical_path == 'js-routes' data end end - end + when -> (v) { v4.match?('', v) } + Sprockets.register_preprocessor 'application/javascript', JsRoutesSprocketsExtension + else + raise StandardError, "Sprockets version #{sprockets_version} is not supported" end end -end +end \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/js_routes/version.rb new/lib/js_routes/version.rb --- old/lib/js_routes/version.rb 2016-07-14 12:23:49.000000000 +0200 +++ new/lib/js_routes/version.rb 2016-08-05 12:52:33.000000000 +0200 @@ -1,3 +1,3 @@ class JsRoutes - VERSION = "1.2.7" + VERSION = "1.2.8" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-07-14 12:23:49.000000000 +0200 +++ new/metadata 2016-08-05 12:52:33.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: js-routes version: !ruby/object:Gem::Version - version: 1.2.7 + version: 1.2.8 platform: ruby authors: - Bogdan Gusiev autorequire: bindir: bin cert_chain: [] -date: 2016-07-14 00:00:00.000000000 Z +date: 2016-08-05 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: railties @@ -167,6 +167,7 @@ - spec/js_routes/rails_routes_compatibility_spec.rb - spec/js_routes/zzz_last_post_rails_init_spec.rb - spec/spec_helper.rb +- spec/support/routes.rb homepage: http://github.com/railsware/js-routes licenses: - MIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb --- old/spec/spec_helper.rb 2016-07-14 12:23:49.000000000 +0200 +++ new/spec/spec_helper.rb 2016-08-05 12:52:33.000000000 +0200 @@ -70,77 +70,6 @@ config.root = File.expand_path('../dummy', __FILE__) end -def draw_routes - - BlogEngine::Engine.routes.draw do - root to: "application#index" - resources :posts - end - App.routes.draw do - - get 'support(/page/:page)', to: BlogEngine::Engine, as: 'support' - - resources :inboxes do - resources :messages do - resources :attachments - end - end - - root :to => "inboxes#index" - - namespace :admin do - resources :users - end - - scope "/returns/:return" do - resources :objects - end - resources :returns - - scope "(/optional/:optional_id)" do - resources :things - end - - get "/:controller(/:action(/:id))" => "classic#classic", :as => :classic - - get "/other_optional/(:optional_id)" => "foo#foo", :as => :foo - get '/other_optional(/*optional_id)' => 'foo#foo', :as => :foo_all - - get 'books/*section/:title' => 'books#show', :as => :book - get 'books/:title/*section' => 'books#show', :as => :book_title - - mount BlogEngine::Engine => "/blog", :as => :blog_app - - get '/no_format' => "foo#foo", :format => false, :as => :no_format - - get '/json_only' => "foo#foo", :format => true, :constraints => {:format => /json/}, :as => :json_only - - get '/привет' => "foo#foo", :as => :hello - get '(/o/:organization)/search/:q' => "foo#foo", as: :search - - resources :sessions, :only => [:new, :create, :destroy], :protocol => 'https' - - get '/' => 'sso#login', host: 'sso.example.com', as: :sso - - resources :portals, :port => 8080 - - get '/with_defaults' => 'foo#foo', defaults: { bar: 'tested', format: :json }, format: :true - - namespace :api, format: true, defaults: {format: 'json'} do - get "/purchases" => "purchases#index" - end - - resources :budgies do - get "descendents" - end - - namespace :backend, path: '', constraints: {subdomain: 'backend'} do - root to: 'backend#index' - end - - end - -end # prevent warning Rails.configuration.active_support.deprecation = :log diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/support/routes.rb new/spec/support/routes.rb --- old/spec/support/routes.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/support/routes.rb 2016-08-05 12:52:33.000000000 +0200 @@ -0,0 +1,71 @@ +def draw_routes + + BlogEngine::Engine.routes.draw do + root to: "application#index" + resources :posts + end + App.routes.draw do + + get 'support(/page/:page)', to: BlogEngine::Engine, as: 'support' + + resources :inboxes do + resources :messages do + resources :attachments + end + end + + root :to => "inboxes#index" + + namespace :admin do + resources :users + end + + scope "/returns/:return" do + resources :objects + end + resources :returns + + scope "(/optional/:optional_id)" do + resources :things + end + + get "/:controller(/:action(/:id))" => "classic#classic", :as => :classic + + get "/other_optional/(:optional_id)" => "foo#foo", :as => :foo + get '/other_optional(/*optional_id)' => 'foo#foo', :as => :foo_all + + get 'books/*section/:title' => 'books#show', :as => :book + get 'books/:title/*section' => 'books#show', :as => :book_title + + mount BlogEngine::Engine => "/blog", :as => :blog_app + + get '/no_format' => "foo#foo", :format => false, :as => :no_format + + get '/json_only' => "foo#foo", :format => true, :constraints => {:format => /json/}, :as => :json_only + + get '/привет' => "foo#foo", :as => :hello + get '(/o/:organization)/search/:q' => "foo#foo", as: :search + + resources :sessions, :only => [:new, :create, :destroy], :protocol => 'https' + + get '/' => 'sso#login', host: 'sso.example.com', as: :sso + + resources :portals, :port => 8080 + + get '/with_defaults' => 'foo#foo', defaults: { bar: 'tested', format: :json }, format: :true + + namespace :api, format: true, defaults: {format: 'json'} do + get "/purchases" => "purchases#index" + end + + resources :budgies do + get "descendents" + end + + namespace :backend, path: '', constraints: {subdomain: 'backend'} do + root to: 'backend#index' + end + + end + +end
