Hello community, here is the log from the commit of package rubygem-spring for openSUSE:Factory checked in at 2017-06-08 15:00:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-spring (Old) and /work/SRC/openSUSE:Factory/.rubygem-spring.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-spring" Thu Jun 8 15:00:19 2017 rev:17 rq:497678 version:2.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-spring/rubygem-spring.changes 2017-04-11 09:30:57.353496410 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-spring.new/rubygem-spring.changes 2017-06-08 15:00:19.725669366 +0200 @@ -1,0 +2,6 @@ +Tue May 23 10:23:08 UTC 2017 - co...@suse.com + +- updated to version 2.0.2 + no changelog found + +------------------------------------------------------------------- Old: ---- spring-2.0.1.gem New: ---- spring-2.0.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-spring.spec ++++++ --- /var/tmp/diff_new_pack.kiAkHs/_old 2017-06-08 15:00:20.821514707 +0200 +++ /var/tmp/diff_new_pack.kiAkHs/_new 2017-06-08 15:00:20.825514143 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-spring -Version: 2.0.1 +Version: 2.0.2 Release: 0 %define mod_name spring %define mod_full_name %{mod_name}-%{version} ++++++ spring-2.0.1.gem -> spring-2.0.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/LICENSE.txt new/LICENSE.txt --- old/LICENSE.txt 2017-01-21 15:35:15.000000000 +0100 +++ new/LICENSE.txt 2017-05-21 22:04:22.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2012-2016 Jon Leighton +Copyright (c) 2012-2017 Jon Leighton MIT License Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/application.rb new/lib/spring/application.rb --- old/lib/spring/application.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/application.rb 2017-05-21 22:04:22.000000000 +0200 @@ -66,7 +66,17 @@ def start_watcher @watcher = Spring.watcher - @watcher.on_stale { state! :watcher_stale } + + @watcher.on_stale do + state! :watcher_stale + end + + if @watcher.respond_to? :on_debug + @watcher.on_debug do |message| + spring_env.log "[watcher:#{app_env}] #{message}" + end + end + @watcher.start end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/test/application_generator.rb new/lib/spring/test/application_generator.rb --- old/lib/spring/test/application_generator.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/test/application_generator.rb 2017-05-21 22:04:22.000000000 +0200 @@ -92,6 +92,11 @@ build_and_install_gems + # TO prevent nokogiri install error in application.bundle. + if RUBY_VERSION < "2.1.0" + append_to_file(application.gemfile, "gem 'nokogiri', '~> 1.6.8'") + end + application.bundle FileUtils.rm_rf application.path("bin") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/test/watcher_test.rb new/lib/spring/test/watcher_test.rb --- old/lib/spring/test/watcher_test.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/test/watcher_test.rb 2017-05-21 22:04:22.000000000 +0200 @@ -162,6 +162,33 @@ watcher.add './foobar' assert watcher.files.empty? end + + test "add symlink" do + File.write("#{dir}/bar", "bar") + File.symlink("#{dir}/bar", "#{dir}/foo") + watcher.add './foo' + assert_equal ["#{dir}/bar"], watcher.files.to_a + end + + test "add dangling symlink" do + File.symlink("#{dir}/bar", "#{dir}/foo") + watcher.add './foo' + assert watcher.files.empty? + end + + test "add directory with dangling symlink" do + subdir = "#{@dir}/subdir" + FileUtils.mkdir(subdir) + File.symlink("dangling", "#{subdir}/foo") + + watcher.add subdir + assert_not_stale + + # Adding a new file should mark as stale despite the dangling symlink. + File.write("#{subdir}/new-file", "new") + watcher.check_stale + assert_stale + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/version.rb new/lib/spring/version.rb --- old/lib/spring/version.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/version.rb 2017-05-21 22:04:22.000000000 +0200 @@ -1,3 +1,3 @@ module Spring - VERSION = "2.0.1" + VERSION = "2.0.2" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/watcher/abstract.rb new/lib/spring/watcher/abstract.rb --- old/lib/spring/watcher/abstract.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/watcher/abstract.rb 2017-05-21 22:04:22.000000000 +0200 @@ -23,9 +23,21 @@ @directories = Set.new @stale = false @listeners = [] + + @on_debug = nil + end + + def on_debug(&block) + @on_debug = block + end + + def debug + @on_debug.call(yield) if @on_debug end def add(*items) + debug { "watcher: add: #{items.inspect}" } + items = items.flatten.map do |item| item = Pathname.new(item) @@ -36,14 +48,30 @@ end end - items = items.select(&:exist?) + items = items.select do |item| + if item.symlink? + item.readlink.exist?.tap do |exists| + if !exists + debug { "add: ignoring dangling symlink: #{item.inspect} -> #{item.readlink.inspect}" } + end + end + else + item.exist? + end + end synchronize { items.each do |item| if item.directory? directories << item.realpath.to_s else - files << item.realpath.to_s + begin + files << item.realpath.to_s + rescue Errno::ENOENT + # Race condition. Ignore symlinks whose target was removed + # since the check above, or are deeply chained. + debug { "add: ignoring now-dangling symlink: #{item.inspect} -> #{item.readlink.inspect}" } + end end end @@ -56,16 +84,19 @@ end def on_stale(&block) + debug { "added listener: #{block.inspect}" } @listeners << block end def mark_stale return if stale? @stale = true + debug { "marked stale, calling listeners: listeners=#{@listeners.inspect}" } @listeners.each(&:call) end def restart + debug { "restarting" } stop start end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/spring/watcher/polling.rb new/lib/spring/watcher/polling.rb --- old/lib/spring/watcher/polling.rb 2017-01-21 15:35:15.000000000 +0100 +++ new/lib/spring/watcher/polling.rb 2017-05-21 22:04:22.000000000 +0200 @@ -12,7 +12,13 @@ end def check_stale - synchronize { mark_stale if mtime < compute_mtime } + synchronize do + computed = compute_mtime + if mtime < computed + debug { "check_stale: mtime=#{mtime.inspect} < computed=#{computed.inspect}" } + mark_stale + end + end end def add(*) @@ -21,36 +27,67 @@ end def start + debug { "start: poller=#{@poller.inspect}" } unless @poller @poller = Thread.new { Thread.current.abort_on_exception = true - loop do - Kernel.sleep latency - check_stale + begin + until stale? + Kernel.sleep latency + check_stale + end + rescue Exception => e + debug do + "poller: aborted: #{e.class}: #{e}\n #{e.backtrace.join("\n ")}" + end + raise + ensure + @poller = nil end } end end def stop + debug { "stopping poller: #{@poller.inspect}" } if @poller @poller.kill @poller = nil end end + def running? + @poller && @poller.alive? + end + def subjects_changed - @mtime = compute_mtime + computed = compute_mtime + debug { "subjects_changed: mtime #{@mtime} -> #{computed}" } + @mtime = computed end private def compute_mtime - expanded_files.map { |f| File.mtime(f).to_f }.max || 0 - rescue Errno::ENOENT - # if a file does no longer exist, the watcher is always stale. - Float::MAX + expanded_files.map do |f| + # Get the mtime of symlink targets. Ignore dangling symlinks. + if File.symlink?(f) + begin + File.mtime(f) + rescue Errno::ENOENT + 0 + end + # If a file no longer exists, treat it as changed. + else + begin + File.mtime(f) + rescue Errno::ENOENT + debug { "compute_mtime: no longer exists: #{f}" } + Float::MAX + end + end.to_f + end.max || 0 end def expanded_files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-01-21 15:35:15.000000000 +0100 +++ new/metadata 2017-05-21 22:04:22.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: spring version: !ruby/object:Gem::Version - version: 2.0.1 + version: 2.0.2 platform: ruby authors: - Jon Leighton autorequire: bindir: bin cert_chain: [] -date: 2017-01-21 00:00:00.000000000 Z +date: 2017-05-21 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: activesupport @@ -121,7 +121,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.5.1 +rubygems_version: 2.6.8 signing_key: specification_version: 4 summary: Rails application preloader