Permalink
Browse files

lock vendor down to specific shas, document new option

  • Loading branch information...
1 parent 74e6368 commit 4b40086583a3e26aab9a12fc21e5d558ced35c21 @joshbuddy joshbuddy committed Dec 5, 2011
View
@@ -199,6 +199,13 @@ Turn off completely any Guard terminal [interactions](#interactions) with:
$ guard start -i
$ guard start --no-interactions
+### `-I`/`--no-vendor` option
+
+Ignore the use of vendored gems with:
+
+ $ guard start -I
+ $ guard start --no-vendor
+
An exhaustive list of options is available with:
$ guard help [TASK]
View
@@ -12,8 +12,11 @@ task :build_vendor do
# Clone the correct gems
sh "git clone https://github.com/thibaudgg/rb-fsevent.git lib/vendor/darwin"
+ sh "cd lib/vendor/darwin && git checkout 1ca42b987596f350ee7b19d8f8210b7b6ae8766b"
sh "git clone https://github.com/nex3/rb-inotify.git lib/vendor/linux"
+ sh "cd lib/vendor/linux && git checkout 01e7487e7a8d8f26b13c6835a321390c6618ccb7"
sh "git clone https://github.com/stereobooster/rb-fchange.git lib/vendor/windows"
+ sh "cd lib/vendor/windows && git checkout d655a602b73f11e6cca986cc3f9fe2846f2dc771"
# Strip out the .git directories
%w[darwin linux windows].each {|platform| sh "rm -rf lib/vendor/#{platform}/.git"}
View
@@ -21,7 +21,7 @@
raise "Only Darwin systems greater than 8 (Mac OS X 10.5+) are supported" unless sdk_version
core_flags = %W{
- -isysroot "#{xcode_path}/SDKs/MacOSX#{sdk_version}.sdk"
+ -isysroot #{xcode_path}/SDKs/MacOSX#{sdk_version}.sdk
-mmacosx-version-min=#{sdk_version} -mdynamic-no-pic -std=gnu99
}
View
@@ -47,7 +47,7 @@ class CLI < Thor
:aliases => '-G',
:banner => 'Specify a Guardfile'
- method_option :ignore_vendor,
+ method_option :no_vendor,
:type => :boolean,
:default => false,
:aliases => '-I',
View
@@ -32,12 +32,12 @@ def paused?
# @return [Guard::Listener] the chosen listener
#
def self.select_and_init(watchdir = Dir.pwd, options = nil)
- ignore_vendor = options && options.key?(:ignore_vendor) ? options[:ignore_vendor] : false
- if mac? && Darwin.usable?(ignore_vendor)
+ no_vendor = options && options.key?(:no_vendor) ? options[:no_vendor] : false
+ if mac? && Darwin.usable?(no_vendor)
Darwin.new(watchdir, options)
- elsif linux? && Linux.usable?(ignore_vendor)
+ elsif linux? && Linux.usable?(no_vendor)
Linux.new(watchdir, options)
- elsif windows? && Windows.usable?(ignore_vendor)
+ elsif windows? && Windows.usable?(no_vendor)
Windows.new(watchdir, options)
else
UI.info 'Using polling (Please help us to support your system better than that).'
@@ -29,8 +29,8 @@ def stop
#
# @return [Boolean] whether usable or not
#
- def self.usable?(use_vendor = true)
- $LOAD_PATH << File.expand_path('../../../vendor/darwin/lib', __FILE__) if use_vendor
+ def self.usable?(no_vendor = false)
+ $LOAD_PATH << File.expand_path('../../../vendor/darwin/lib', __FILE__) unless no_vendor
require 'rb-fsevent'
true
rescue LoadError
@@ -21,7 +21,7 @@
raise "Only Darwin systems greater than 8 (Mac OS X 10.5+) are supported" unless sdk_version
core_flags = %W{
- -isysroot "#{xcode_path}/SDKs/MacOSX#{sdk_version}.sdk"
+ -isysroot #{xcode_path}/SDKs/MacOSX#{sdk_version}.sdk
-mmacosx-version-min=#{sdk_version} -mdynamic-no-pic -std=gnu99
}
@@ -9,10 +9,10 @@ namespace(:spec) do
desc "Run all specs on multiple ruby versions (requires pik)"
task(:portability) do
%w[187 192 161].each do |version|
- system "cmd /c echo -----------#{version}------------ & " +
- "pik use #{version} & " +
- "bundle install & " +
- "rake spec"
+ system("echo -----------#{version}------------")
+ system("pik use #{version}")
+ system("bundle install")
+ system("rake spec")
end
end
end
@@ -6,42 +6,30 @@
before(:each) do
@results = []
@notifier = FChange::Notifier.new
- @notifier.watch(@fixture_path.to_s, :recursive) do |event|
+ @notifier.watch(@fixture_path.to_s) do |event|
@results += [event.watcher.path]
end
end
it "should work with path with an apostrophe" do
custom_path = @fixture_path.join("custom 'path")
file = custom_path.join("newfile.rb").to_s
- begin
- File.delete file
- rescue
- end
+ File.delete file if File.exists? file
run
FileUtils.touch file
stop
- begin
- File.delete file
- rescue
- end
- @results.include?(@fixture_path.to_s).should be_true
+ File.delete file
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
end
it "should catch new file" do
file = @fixture_path.join("newfile.rb")
- begin
- File.delete file
- rescue
- end
+ File.delete file if File.exists? file
run
FileUtils.touch file
stop
- begin
- File.delete file
- rescue
- end
- @results.include?(@fixture_path.to_s).should be_true
+ File.delete file
+ @results.should == [@fixture_path.to_s]
end
it "should catch file update" do
@@ -50,7 +38,7 @@
run
FileUtils.touch file
stop
- @results.include?(@fixture_path.to_s).should be_true
+ @results.should == [@fixture_path.to_s]
end
it "should catch files update" do
@@ -62,44 +50,30 @@
FileUtils.touch file1
FileUtils.touch file2
stop
- @results.include?(@fixture_path.to_s).should be_true
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
end
it "should catch new directory" do
dir = @fixture_path.join("new_dir")
- begin
- Dir.delete dir
- rescue
- end
+ Dir.delete dir if Dir.exists? dir
+ Dir.exists?(dir).should be_false
run
Dir.mkdir dir
stop
- begin
- Dir.delete dir
- rescue
- end
- @results.include?(@fixture_path.to_s).should be_true
+ Dir.delete dir
+ @results.should == [@fixture_path.to_s]
end
it "should catch directory rename" do
dir = @fixture_path.join("new_dir")
dir_new = @fixture_path.join("new_dir1")
- begin
- Dir.mkdir dir
- rescue
- end
- begin
- Dir.delete dir_new
- rescue
- end
+ Dir.mkdir dir unless Dir.exists? dir
+ Dir.delete dir_new if Dir.exists? dir_new
run
File.rename(dir, dir_new)
stop
- begin
- Dir.delete dir_new
- rescue
- end
- @results.include?(@fixture_path.to_s).should be_true
+ Dir.delete(dir_new)
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
end
it "should catch file rename" do
@@ -111,7 +85,7 @@
File.rename(file, file_new)
stop
File.rename(file_new, file)
- @results.include?(@fixture_path.to_s).should be_true
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
end
# it "should work with none-ANSI path" do

0 comments on commit 4b40086

Please sign in to comment.