diff options
author | Hans de Graaff <graaff@gentoo.org> | 2011-08-14 07:23:25 +0000 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2011-08-14 07:23:25 +0000 |
commit | c23bc798d6655d79f5df074f2bf2695b43e1c978 (patch) | |
tree | 8addaf2d7e68dbf7f4c2cfb882b093462a45c78a /dev-ruby/fssm | |
parent | jruby has a native ffi implementation so don't require dev-ruby/ffi in the ge... (diff) | |
download | gentoo-2-c23bc798d6655d79f5df074f2bf2695b43e1c978.tar.gz gentoo-2-c23bc798d6655d79f5df074f2bf2695b43e1c978.tar.bz2 gentoo-2-c23bc798d6655d79f5df074f2bf2695b43e1c978.zip |
Add dependency on rb-inotify as encouraged by upstream, so that inotify events can be used instead of polling. Dropped keywords, bug 379131.
(Portage version: 2.1.10.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/fssm')
-rw-r--r-- | dev-ruby/fssm/ChangeLog | 9 | ||||
-rw-r--r-- | dev-ruby/fssm/files/fssm-0.2.7-test.patch | 237 | ||||
-rw-r--r-- | dev-ruby/fssm/fssm-0.2.7-r1.ebuild | 43 |
3 files changed, 288 insertions, 1 deletions
diff --git a/dev-ruby/fssm/ChangeLog b/dev-ruby/fssm/ChangeLog index 1e2be2a0416c..7bd734f9c69c 100644 --- a/dev-ruby/fssm/ChangeLog +++ b/dev-ruby/fssm/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-ruby/fssm # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/fssm/ChangeLog,v 1.9 2011/08/07 14:13:32 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/fssm/ChangeLog,v 1.10 2011/08/14 07:23:25 graaff Exp $ + +*fssm-0.2.7-r1 (14 Aug 2011) + + 14 Aug 2011; Hans de Graaff <graaff@gentoo.org> +fssm-0.2.7-r1.ebuild, + +files/fssm-0.2.7-test.patch: + Add dependency on rb-inotify as encouraged by upstream, so that inotify + events can be used instead of polling. Dropped keywords, bug 379131. 07 Aug 2011; Raúl Porcel <armin76@gentoo.org> fssm-0.2.5.ebuild, fssm-0.2.7.ebuild: diff --git a/dev-ruby/fssm/files/fssm-0.2.7-test.patch b/dev-ruby/fssm/files/fssm-0.2.7-test.patch new file mode 100644 index 000000000000..775a016f8d95 --- /dev/null +++ b/dev-ruby/fssm/files/fssm-0.2.7-test.patch @@ -0,0 +1,237 @@ +commit e997e7411d5ffd041331b03b298b0919a3250ff7 +Author: Travis Tilley <ttilley@gmail.com> +Date: Sat Jul 30 02:19:10 2011 -0400 + + more brutal honesty, document important FIXME items, and comment out specs for functionality that has never worked outside the polling backend ever + +diff --git a/spec/monitor_spec.rb b/spec/monitor_spec.rb +index 08d465f..2ebba9a 100644 +--- a/spec/monitor_spec.rb ++++ b/spec/monitor_spec.rb +@@ -1,3 +1,8 @@ ++# FIXME: burn this shit with fire for chrissake. this is not an acceptable ++# test suite. given variance between ruby versions and backends ++# regarding threads this is quite likely one of the most brittle ++# test suites EVAR. ++ + require 'spec_helper' + + require 'count_down_latch' +@@ -43,6 +48,12 @@ module FSSM::MonitorSpecHelpers + end + end + ++RSpec::Matchers.define :intersect_with do |test_enum| ++ match do |result_enum| ++ (result_enum & test_enum).length == test_enum.length ++ end ++end ++ + describe "The File System State Monitor" do + describe "monitor" do + include FSSM::MonitorSpecHelpers +@@ -62,29 +73,29 @@ describe "The File System State Monitor" do + File.exists?(file).should be_false + FileUtils.touch file + end +- @handler_results[:create].should == [[@tmp_dir, 'newfile.rb']] ++ @handler_results[:create].should include([@tmp_dir, 'newfile.rb']) + end + + it "should call update callback upon file modification" do + run_monitor(1) do + FileUtils.touch @tmp_dir + '/root/file.rb' + end +- @handler_results[:update].should == [[@tmp_dir, 'root/file.rb']] ++ @handler_results[:update].should include([@tmp_dir, 'root/file.rb']) + end + + it "should call delete callback upon file deletion" do + run_monitor(1) do + FileUtils.rm @tmp_dir + "/root/file.rb" + end +- @handler_results[:delete].should == [[@tmp_dir, 'root/file.rb']] ++ @handler_results[:delete].should include([@tmp_dir, 'root/file.rb']) + end + + it "should call create and delete callbacks upon file renaming in the same directory" do + run_monitor(2) do + FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/root/old_file.rb" + end +- @handler_results[:create].should == [[@tmp_dir, 'root/old_file.rb']] +- @handler_results[:delete].should == [[@tmp_dir, 'root/file.rb']] ++ @handler_results[:create].should include([@tmp_dir, 'root/old_file.rb']) ++ @handler_results[:delete].should include([@tmp_dir, 'root/file.rb']) + @handler_results[:update].should == [] + end + +@@ -92,8 +103,8 @@ describe "The File System State Monitor" do + run_monitor(2) do + FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/old_file.rb" + end +- @handler_results[:create].should == [[@tmp_dir, 'old_file.rb']] +- @handler_results[:delete].should == [[@tmp_dir, 'root/file.rb']] ++ @handler_results[:create].should include([@tmp_dir, 'old_file.rb']) ++ @handler_results[:delete].should include([@tmp_dir, 'root/file.rb']) + @handler_results[:update].should == [] + end + +@@ -122,81 +133,83 @@ describe "The File System State Monitor" do + @handler_results[:delete].should include([@tmp_dir, 'root/yawn', :directory]) + end + +- it "should call create, update, and delete callbacks upon directory renaming in the same directory" do +- run_monitor(3, :directories => true) do +- FileUtils.mv @tmp_dir + "/root/yawn", @tmp_dir + "/root/old_yawn" +- end +- @handler_results[:create].should include([@tmp_dir, 'root/old_yawn', :directory]) +- @handler_results[:delete].should include([@tmp_dir, 'root/yawn', :directory]) +- @handler_results[:update].should include([@tmp_dir, 'root', :directory]) +- end +- +- it "should call create, update, and delete callbacks upon directory moving to another directory" do +- run_monitor(3, :directories => true) do +- FileUtils.mv @tmp_dir + "/root/yawn", @tmp_dir + "/old_yawn" +- end +- @handler_results[:create].should include([@tmp_dir, 'old_yawn', :directory]) +- @handler_results[:delete].should include([@tmp_dir, 'root/yawn', :directory]) +- @handler_results[:update].should include([@tmp_dir, 'root', :directory]) +- end +- +- it "should call create, update, and delete callbacks upon file renaming in the same directory" do +- run_monitor(3, :directories => true) do +- FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/root/old_file.rb" +- end +- @handler_results[:create].should include([@tmp_dir, 'root/old_file.rb', :file]) +- @handler_results[:delete].should include([@tmp_dir, 'root/file.rb', :file]) +- @handler_results[:update].should include([@tmp_dir, 'root', :directory]) +- end +- +- it "should call create, update, and delete callbacks upon file moving to another directory" do +- run_monitor(3, :directories => true) do +- FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/old_file.rb" +- end +- @handler_results[:create].should include([@tmp_dir, 'old_file.rb', :file]) +- @handler_results[:delete].should include([@tmp_dir, 'root/file.rb', :file]) +- @handler_results[:update].should include([@tmp_dir, 'root', :directory]) +- end +- +- it "should call delete callbacks upon directory structure deletion, in reverse order" do +- expected_delete_events = [ +- ['root/yawn', :directory], +- ['root/moo/cow.txt', :file], +- ['root/moo', :directory], +- ['root/file.yml', :file], +- ['root/file.rb', :file], +- ['root/file.css', :file], +- ['root/duck/quack.txt', :file], +- ['root/duck', :directory], +- ['root', :directory] +- ] +- run_monitor(expected_delete_events.size, :directories => true) do +- FileUtils.rm_rf @tmp_dir + '/.' +- end +- @handler_results[:create].should == [] +- @handler_results[:delete].should == expected_delete_events.map { |(file, type)| [@tmp_dir, file, type] } +- @handler_results[:update].should == [] +- end +- +- it "should call create callbacks upon directory structure creation, in order" do +- expected_create_events = [ +- ['new_root', :directory], +- ['new_root/duck', :directory], +- ['new_root/duck/quack.txt', :file], +- ['new_root/file.css', :file], +- ['new_root/file.rb', :file], +- ['new_root/file.yml', :file], +- ['new_root/moo', :directory], +- ['new_root/moo/cow.txt', :file], +- ['new_root/yawn', :directory] +- ] +- run_monitor(expected_create_events.size, :directories => true) do +- FileUtils.cp_r @tmp_dir + '/root/.', @tmp_dir + '/new_root' +- end +- @handler_results[:create].should == expected_create_events.map { |(file, type)| [@tmp_dir, file, type] } +- @handler_results[:delete].should == [] +- @handler_results[:update].should == [] +- end ++# FIXME: this never worked outside the polling backend. ++# ++# it "should call create, update, and delete callbacks upon directory renaming in the same directory" do ++# run_monitor(3, :directories => true) do ++# FileUtils.mv @tmp_dir + "/root/yawn", @tmp_dir + "/root/old_yawn" ++# end ++# @handler_results[:create].should include([@tmp_dir, 'root/old_yawn', :directory]) ++# @handler_results[:delete].should include([@tmp_dir, 'root/yawn', :directory]) ++# @handler_results[:update].should include([@tmp_dir, 'root', :directory]) ++# end ++# ++# it "should call create, update, and delete callbacks upon directory moving to another directory" do ++# run_monitor(3, :directories => true) do ++# FileUtils.mv @tmp_dir + "/root/yawn", @tmp_dir + "/old_yawn" ++# end ++# @handler_results[:create].should include([@tmp_dir, 'old_yawn', :directory]) ++# @handler_results[:delete].should include([@tmp_dir, 'root/yawn', :directory]) ++# @handler_results[:update].should include([@tmp_dir, 'root', :directory]) ++# end ++# ++# it "should call create, update, and delete callbacks upon file renaming in the same directory" do ++# run_monitor(3, :directories => true) do ++# FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/root/old_file.rb" ++# end ++# @handler_results[:create].should include([@tmp_dir, 'root/old_file.rb', :file]) ++# @handler_results[:delete].should include([@tmp_dir, 'root/file.rb', :file]) ++# @handler_results[:update].should include([@tmp_dir, 'root', :directory]) ++# end ++# ++# it "should call create, update, and delete callbacks upon file moving to another directory" do ++# run_monitor(3, :directories => true) do ++# FileUtils.mv @tmp_dir + "/root/file.rb", @tmp_dir + "/old_file.rb" ++# end ++# @handler_results[:create].should include([@tmp_dir, 'old_file.rb', :file]) ++# @handler_results[:delete].should include([@tmp_dir, 'root/file.rb', :file]) ++# @handler_results[:update].should include([@tmp_dir, 'root', :directory]) ++# end ++# ++# it "should call delete callbacks upon directory structure deletion" do ++# expected_delete_events = [ ++# [@tmp_dir, 'root/yawn', :directory], ++# [@tmp_dir, 'root/moo/cow.txt', :file], ++# [@tmp_dir, 'root/moo', :directory], ++# [@tmp_dir, 'root/file.yml', :file], ++# [@tmp_dir, 'root/file.rb', :file], ++# [@tmp_dir, 'root/file.css', :file], ++# [@tmp_dir, 'root/duck/quack.txt', :file], ++# [@tmp_dir, 'root/duck', :directory], ++# [@tmp_dir, 'root', :directory] ++# ] ++# run_monitor(expected_delete_events.size, :directories => true) do ++# FileUtils.rm_rf @tmp_dir + '/.' ++# end ++# @handler_results[:create].should == [] ++# @handler_results[:delete].should intersect_with(expected_delete_events) ++# @handler_results[:update].should == [] ++# end ++# ++# it "should call create callbacks upon directory structure creation" do ++# expected_create_events = [ ++# [@tmp_dir, 'new_root', :directory], ++# [@tmp_dir, 'new_root/duck', :directory], ++# [@tmp_dir, 'new_root/duck/quack.txt', :file], ++# [@tmp_dir, 'new_root/file.css', :file], ++# [@tmp_dir, 'new_root/file.rb', :file], ++# [@tmp_dir, 'new_root/file.yml', :file], ++# [@tmp_dir, 'new_root/moo', :directory], ++# [@tmp_dir, 'new_root/moo/cow.txt', :file], ++# [@tmp_dir, 'new_root/yawn', :directory] ++# ] ++# run_monitor(expected_create_events.size, :directories => true) do ++# FileUtils.cp_r @tmp_dir + '/root/.', @tmp_dir + '/new_root' ++# end ++# @handler_results[:create].should intersect_with(expected_create_events) ++# @handler_results[:delete].should == [] ++# @handler_results[:update].should == [] ++# end + end + end + end diff --git a/dev-ruby/fssm/fssm-0.2.7-r1.ebuild b/dev-ruby/fssm/fssm-0.2.7-r1.ebuild new file mode 100644 index 000000000000..162a62a5effc --- /dev/null +++ b/dev-ruby/fssm/fssm-0.2.7-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/fssm/fssm-0.2.7-r1.ebuild,v 1.1 2011/08/14 07:23:25 graaff Exp $ + +EAPI=4 + +USE_RUBY="ruby18 ree18 jruby" + +RUBY_FAKEGEM_TASK_TEST="spec" + +RUBY_FAKEGEM_TASK_DOC="" +RUBY_FAKEGEM_EXTRADOC="README.markdown" + +inherit ruby-fakegem + +DESCRIPTION="Monitor API" +HOMEPAGE="http://github.com/ttilley/fssm" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +# rb-inotify is a Linux-specific extension, so we will need to make this +# conditional when keywords are added that are not linux-specific. +ruby_add_rdepend ">=dev-ruby/rb-inotify-0.8.6-r1" + +ruby_add_bdepend "test? ( >=dev-ruby/rspec-2.4.0:2 )" + +all_ruby_prepare() { + # Remove bundler support + sed -i -e '/[Bb]undler/d' Rakefile spec/spec_helper.rb || die + rm Gemfile || die + + # Fix/ignore broken specs with patch from upstream + epatch "${FILESDIR}/${P}-test.patch" +} + +all_ruby_install() { + all_fakegem_install + + dodoc example.rb +} |