Permalink
Browse files

commander >=4.0.0

  • Loading branch information...
tj committed Oct 10, 2009
1 parent 4a41bbf commit 8aa19cc9f01927a8b0cf3454837f2a2911925861
View
@@ -11,7 +11,7 @@ Echoe.new "bind", Bind::VERSION do |p|
p.summary = "bind actions to filesystem events"
p.url = "http://github.com/visionmedia/bind"
p.runtime_dependencies = []
- p.runtime_dependencies << 'commander >=3.1.6'
+ p.runtime_dependencies << 'commander >=4.0.0'
end
Dir['tasks/**/*.rake'].sort.each { |lib| load lib }
View
@@ -3,7 +3,7 @@
require 'rubygems'
require 'bind'
require 'bind/command_helpers'
-require 'commander'
+require 'commander/import'
program :name, 'rbind'
program :version, Bind::VERSION
@@ -17,7 +17,7 @@ command :to do |c|
c.example 'Bind to a single file, logging its path when changed', "rbind to style.css -e 'puts file.path'"
c.example 'Bind to a file, and a directory of files', "rbind to stylesheets style.css -e 'puts file.path'"
c.example 'Run specs when ruby files are modified', "rbind to 'lib/**/*.rb' -e 'system \"rake spec\"'"
- c.when_called do |args, options|
+ c.action do |args, options|
abort 'invalid option. --eval switch is required in order to perform any action on the bound file(s)' unless options.eval
common_options options
options.paths = args
@@ -34,7 +34,7 @@ command :refresh do |c|
c.example 'Bind local static html (no scheme)', 'bind refresh examples/demo.html -f style.css -b Safari'
c.option '-b', '--browsers BROWSERS', Array, 'List of browsers you wish to refresh. Defaults to Safari'
c.option '-p', '--paths PATHS', Array, 'List of files, directories, or globs to bind to'
- c.when_called do |args, options|
+ c.action do |args, options|
common_options options
uri = expand_path args.shift
browsers = options.browsers || ['Safari']
View
@@ -25,11 +25,11 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<commander>, [">= 3.1.6"])
+ s.add_runtime_dependency(%q<commander>, [">= 4.0.0"])
else
- s.add_dependency(%q<commander>, [">= 3.1.6"])
+ s.add_dependency(%q<commander>, [">= 4.0.0"])
end
else
- s.add_dependency(%q<commander>, [">= 3.1.6"])
+ s.add_dependency(%q<commander>, [">= 4.0.0"])
end
end
@@ -1,19 +0,0 @@
-
-require 'bind/command_helpers'
-require 'ostruct'
-
-describe Bind do
- describe "Helpers" do
-
- describe "#expand_path" do
- it "should expand local files to an asolute path" do
- expand_path('History.rdoc').should include('bind/History.rdoc')
- end
-
- it "should leave uris as they are" do
- expand_path('http://foo.com').should == 'http://foo.com'
- end
- end
-
- end
-end
No changes.
No changes.
No changes.
No changes.
No changes.
View
No changes.
View
@@ -1,41 +0,0 @@
-
-describe Bind::Listener do
-
- def listener *paths, &action
- Bind::Listener.new :event => :change, :paths => paths, :interval => 1, :actions => [action], :timeout => 2
- end
-
- it "should expand directories" do
- files = %w(
- ./spec/fixtures/assets/bar.css
- ./spec/fixtures/assets/foo.css
- ./spec/fixtures/assets/jquery.js
- ./spec/fixtures/assets/js/app.js
- ./spec/fixtures/assets/js/test.js
- )
- l = listener {}
- l.expand_dirs(fixture_path('assets')).should == files
- end
-
- it "should expand paths to a single file" do
- l = listener {}
- l.expand_dirs(fixture_path('style.css')).should == ['./spec/fixtures/style.css']
- end
-
- it "should expand directories using globbing" do
- files = %w(
- ./spec/fixtures/assets/jquery.js
- ./spec/fixtures/assets/js/app.js
- ./spec/fixtures/assets/js/test.js
- )
- l = listener {}
- l.expand_dirs(fixture_path('assets/**/*.js')).should == files
- end
-
- it "should record total runtime" do
- l = listener(fixture_path('style.css')) {}
- l.run!
- l.run_time.to_i.should == 2
- end
-
-end
View
@@ -1,6 +0,0 @@
-
-require 'bind'
-
-def fixture_path path
- File.join File.dirname(__FILE__), 'fixtures', path
-end

0 comments on commit 8aa19cc

Please sign in to comment.