bind 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.rdoc +4 -0
 - data/Manifest +0 -9
 - data/Rakefile +1 -1
 - data/bin/rbind +3 -3
 - data/bind.gemspec +5 -5
 - data/lib/bind/version.rb +1 -1
 - metadata +2 -11
 - data/spec/command_helper_spec.rb +0 -19
 - data/spec/fixtures/assets/bar.css +0 -0
 - data/spec/fixtures/assets/foo.css +0 -0
 - data/spec/fixtures/assets/jquery.js +0 -0
 - data/spec/fixtures/assets/js/app.js +0 -0
 - data/spec/fixtures/assets/js/test.js +0 -0
 - data/spec/fixtures/style.css +0 -0
 - data/spec/listener_spec.rb +0 -41
 - data/spec/spec_helper.rb +0 -6
 
    
        data/History.rdoc
    CHANGED
    
    
    
        data/Manifest
    CHANGED
    
    | 
         @@ -16,15 +16,6 @@ lib/bind/actions/refresh_browsers.rb 
     | 
|
| 
       16 
16 
     | 
    
         
             
            lib/bind/command_helpers.rb
         
     | 
| 
       17 
17 
     | 
    
         
             
            lib/bind/listener.rb
         
     | 
| 
       18 
18 
     | 
    
         
             
            lib/bind/version.rb
         
     | 
| 
       19 
     | 
    
         
            -
            spec/command_helper_spec.rb
         
     | 
| 
       20 
     | 
    
         
            -
            spec/fixtures/assets/bar.css
         
     | 
| 
       21 
     | 
    
         
            -
            spec/fixtures/assets/foo.css
         
     | 
| 
       22 
     | 
    
         
            -
            spec/fixtures/assets/jquery.js
         
     | 
| 
       23 
     | 
    
         
            -
            spec/fixtures/assets/js/app.js
         
     | 
| 
       24 
     | 
    
         
            -
            spec/fixtures/assets/js/test.js
         
     | 
| 
       25 
     | 
    
         
            -
            spec/fixtures/style.css
         
     | 
| 
       26 
     | 
    
         
            -
            spec/listener_spec.rb
         
     | 
| 
       27 
     | 
    
         
            -
            spec/spec_helper.rb
         
     | 
| 
       28 
19 
     | 
    
         
             
            tasks/docs.rake
         
     | 
| 
       29 
20 
     | 
    
         
             
            tasks/gemspec.rake
         
     | 
| 
       30 
21 
     | 
    
         
             
            tasks/release.rake
         
     | 
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -11,7 +11,7 @@ Echoe.new "bind", Bind::VERSION do |p| 
     | 
|
| 
       11 
11 
     | 
    
         
             
              p.summary = "bind actions to filesystem events"
         
     | 
| 
       12 
12 
     | 
    
         
             
              p.url = "http://github.com/visionmedia/bind"
         
     | 
| 
       13 
13 
     | 
    
         
             
              p.runtime_dependencies = []
         
     | 
| 
       14 
     | 
    
         
            -
              p.runtime_dependencies << 'commander >= 
     | 
| 
      
 14 
     | 
    
         
            +
              p.runtime_dependencies << 'commander >=4.0.0'
         
     | 
| 
       15 
15 
     | 
    
         
             
            end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            Dir['tasks/**/*.rake'].sort.each { |lib| load lib }
         
     | 
    
        data/bin/rbind
    CHANGED
    
    | 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require 'rubygems'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require 'bind'
         
     | 
| 
       5 
5 
     | 
    
         
             
            require 'bind/command_helpers'
         
     | 
| 
       6 
     | 
    
         
            -
            require 'commander'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'commander/import'
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            program :name, 'rbind'
         
     | 
| 
       9 
9 
     | 
    
         
             
            program :version, Bind::VERSION
         
     | 
| 
         @@ -17,7 +17,7 @@ command :to do |c| 
     | 
|
| 
       17 
17 
     | 
    
         
             
              c.example 'Bind to a single file, logging its path when changed', "rbind to style.css -e 'puts file.path'"
         
     | 
| 
       18 
18 
     | 
    
         
             
              c.example 'Bind to a file, and a directory of files', "rbind to stylesheets style.css -e 'puts file.path'"
         
     | 
| 
       19 
19 
     | 
    
         
             
              c.example 'Run specs when ruby files are modified', "rbind to 'lib/**/*.rb' -e 'system \"rake spec\"'"
         
     | 
| 
       20 
     | 
    
         
            -
              c. 
     | 
| 
      
 20 
     | 
    
         
            +
              c.action do |args, options|
         
     | 
| 
       21 
21 
     | 
    
         
             
                abort 'invalid option. --eval switch is required in order to perform any action on the bound file(s)' unless options.eval
         
     | 
| 
       22 
22 
     | 
    
         
             
                common_options options
         
     | 
| 
       23 
23 
     | 
    
         
             
                options.paths = args
         
     | 
| 
         @@ -34,7 +34,7 @@ command :refresh do |c| 
     | 
|
| 
       34 
34 
     | 
    
         
             
              c.example 'Bind local static html (no scheme)', 'bind refresh examples/demo.html -f style.css -b Safari'
         
     | 
| 
       35 
35 
     | 
    
         
             
              c.option '-b', '--browsers BROWSERS', Array, 'List of browsers you wish to refresh. Defaults to Safari'
         
     | 
| 
       36 
36 
     | 
    
         
             
              c.option '-p', '--paths PATHS', Array, 'List of files, directories, or globs to bind to'
         
     | 
| 
       37 
     | 
    
         
            -
              c. 
     | 
| 
      
 37 
     | 
    
         
            +
              c.action do |args, options|
         
     | 
| 
       38 
38 
     | 
    
         
             
                common_options options
         
     | 
| 
       39 
39 
     | 
    
         
             
                uri = expand_path args.shift
         
     | 
| 
       40 
40 
     | 
    
         
             
                browsers = options.browsers || ['Safari']
         
     | 
    
        data/bind.gemspec
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.name = %q{bind}
         
     | 
| 
       5 
     | 
    
         
            -
              s.version = "0.2. 
     | 
| 
      
 5 
     | 
    
         
            +
              s.version = "0.2.8"
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.authors = ["TJ Holowaychuk"]
         
     | 
| 
         @@ -12,7 +12,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       12 
12 
     | 
    
         
             
              s.email = %q{tj@vision-media.ca}
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.executables = ["rbind"]
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.extra_rdoc_files = ["README.rdoc", "bin/rbind", "bind.gemspec", "lib/bind.rb", "lib/bind/actions.rb", "lib/bind/actions/refresh_browsers.rb", "lib/bind/command_helpers.rb", "lib/bind/listener.rb", "lib/bind/version.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/release.rake", "tasks/spec.rake"]
         
     | 
| 
       15 
     | 
    
         
            -
              s.files = ["History.rdoc", "Manifest", "README.rdoc", "Rakefile", "Todo.rdoc", "bin/rbind", "bind.gemspec", "examples/demo.html", "examples/globbing.rb", "examples/log_changes.rb", "examples/refresh_browsers.rb", "examples/style.css", "lib/bind.rb", "lib/bind/actions.rb", "lib/bind/actions/refresh_browsers.rb", "lib/bind/command_helpers.rb", "lib/bind/listener.rb", "lib/bind/version.rb", " 
     | 
| 
      
 15 
     | 
    
         
            +
              s.files = ["History.rdoc", "Manifest", "README.rdoc", "Rakefile", "Todo.rdoc", "bin/rbind", "bind.gemspec", "examples/demo.html", "examples/globbing.rb", "examples/log_changes.rb", "examples/refresh_browsers.rb", "examples/style.css", "lib/bind.rb", "lib/bind/actions.rb", "lib/bind/actions/refresh_browsers.rb", "lib/bind/command_helpers.rb", "lib/bind/listener.rb", "lib/bind/version.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/release.rake", "tasks/spec.rake"]
         
     | 
| 
       16 
16 
     | 
    
         
             
              s.homepage = %q{http://github.com/visionmedia/bind}
         
     | 
| 
       17 
17 
     | 
    
         
             
              s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Bind", "--main", "README.rdoc"]
         
     | 
| 
       18 
18 
     | 
    
         
             
              s.require_paths = ["lib"]
         
     | 
| 
         @@ -25,11 +25,11 @@ Gem::Specification.new do |s| 
     | 
|
| 
       25 
25 
     | 
    
         
             
                s.specification_version = 3
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
                if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
         
     | 
| 
       28 
     | 
    
         
            -
                  s.add_runtime_dependency(%q<commander>, [">=  
     | 
| 
      
 28 
     | 
    
         
            +
                  s.add_runtime_dependency(%q<commander>, [">= 4.0.0"])
         
     | 
| 
       29 
29 
     | 
    
         
             
                else
         
     | 
| 
       30 
     | 
    
         
            -
                  s.add_dependency(%q<commander>, [">=  
     | 
| 
      
 30 
     | 
    
         
            +
                  s.add_dependency(%q<commander>, [">= 4.0.0"])
         
     | 
| 
       31 
31 
     | 
    
         
             
                end
         
     | 
| 
       32 
32 
     | 
    
         
             
              else
         
     | 
| 
       33 
     | 
    
         
            -
                s.add_dependency(%q<commander>, [">=  
     | 
| 
      
 33 
     | 
    
         
            +
                s.add_dependency(%q<commander>, [">= 4.0.0"])
         
     | 
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
       35 
35 
     | 
    
         
             
            end
         
     | 
    
        data/lib/bind/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: bind
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.8
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - TJ Holowaychuk
         
     | 
| 
         @@ -20,7 +20,7 @@ dependencies: 
     | 
|
| 
       20 
20 
     | 
    
         
             
                requirements: 
         
     | 
| 
       21 
21 
     | 
    
         
             
                - - ">="
         
     | 
| 
       22 
22 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       23 
     | 
    
         
            -
                    version:  
     | 
| 
      
 23 
     | 
    
         
            +
                    version: 4.0.0
         
     | 
| 
       24 
24 
     | 
    
         
             
                version: 
         
     | 
| 
       25 
25 
     | 
    
         
             
            description: bind actions to filesystem events
         
     | 
| 
       26 
26 
     | 
    
         
             
            email: tj@vision-media.ca
         
     | 
| 
         @@ -61,15 +61,6 @@ files: 
     | 
|
| 
       61 
61 
     | 
    
         
             
            - lib/bind/command_helpers.rb
         
     | 
| 
       62 
62 
     | 
    
         
             
            - lib/bind/listener.rb
         
     | 
| 
       63 
63 
     | 
    
         
             
            - lib/bind/version.rb
         
     | 
| 
       64 
     | 
    
         
            -
            - spec/command_helper_spec.rb
         
     | 
| 
       65 
     | 
    
         
            -
            - spec/fixtures/assets/bar.css
         
     | 
| 
       66 
     | 
    
         
            -
            - spec/fixtures/assets/foo.css
         
     | 
| 
       67 
     | 
    
         
            -
            - spec/fixtures/assets/jquery.js
         
     | 
| 
       68 
     | 
    
         
            -
            - spec/fixtures/assets/js/app.js
         
     | 
| 
       69 
     | 
    
         
            -
            - spec/fixtures/assets/js/test.js
         
     | 
| 
       70 
     | 
    
         
            -
            - spec/fixtures/style.css
         
     | 
| 
       71 
     | 
    
         
            -
            - spec/listener_spec.rb
         
     | 
| 
       72 
     | 
    
         
            -
            - spec/spec_helper.rb
         
     | 
| 
       73 
64 
     | 
    
         
             
            - tasks/docs.rake
         
     | 
| 
       74 
65 
     | 
    
         
             
            - tasks/gemspec.rake
         
     | 
| 
       75 
66 
     | 
    
         
             
            - tasks/release.rake
         
     | 
    
        data/spec/command_helper_spec.rb
    DELETED
    
    | 
         @@ -1,19 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
            require 'bind/command_helpers'
         
     | 
| 
       3 
     | 
    
         
            -
            require 'ostruct'
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            describe Bind do
         
     | 
| 
       6 
     | 
    
         
            -
              describe "Helpers" do
         
     | 
| 
       7 
     | 
    
         
            -
                
         
     | 
| 
       8 
     | 
    
         
            -
                describe "#expand_path" do
         
     | 
| 
       9 
     | 
    
         
            -
                  it "should expand local files to an asolute path" do
         
     | 
| 
       10 
     | 
    
         
            -
                    expand_path('History.rdoc').should include('bind/History.rdoc')
         
     | 
| 
       11 
     | 
    
         
            -
                  end
         
     | 
| 
       12 
     | 
    
         
            -
                  
         
     | 
| 
       13 
     | 
    
         
            -
                  it "should leave uris as they are" do
         
     | 
| 
       14 
     | 
    
         
            -
                    expand_path('http://foo.com').should == 'http://foo.com'
         
     | 
| 
       15 
     | 
    
         
            -
                  end
         
     | 
| 
       16 
     | 
    
         
            -
                end
         
     | 
| 
       17 
     | 
    
         
            -
                
         
     | 
| 
       18 
     | 
    
         
            -
              end
         
     | 
| 
       19 
     | 
    
         
            -
            end
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
    
        data/spec/fixtures/style.css
    DELETED
    
    | 
         
            File without changes
         
     | 
    
        data/spec/listener_spec.rb
    DELETED
    
    | 
         @@ -1,41 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
            describe Bind::Listener do
         
     | 
| 
       3 
     | 
    
         
            -
              
         
     | 
| 
       4 
     | 
    
         
            -
              def listener *paths, &action
         
     | 
| 
       5 
     | 
    
         
            -
                Bind::Listener.new :event => :change, :paths => paths, :interval => 1, :actions => [action], :timeout => 2
         
     | 
| 
       6 
     | 
    
         
            -
              end
         
     | 
| 
       7 
     | 
    
         
            -
              
         
     | 
| 
       8 
     | 
    
         
            -
              it "should expand directories" do
         
     | 
| 
       9 
     | 
    
         
            -
                files = %w(
         
     | 
| 
       10 
     | 
    
         
            -
                  ./spec/fixtures/assets/bar.css
         
     | 
| 
       11 
     | 
    
         
            -
                  ./spec/fixtures/assets/foo.css
         
     | 
| 
       12 
     | 
    
         
            -
                  ./spec/fixtures/assets/jquery.js
         
     | 
| 
       13 
     | 
    
         
            -
                  ./spec/fixtures/assets/js/app.js
         
     | 
| 
       14 
     | 
    
         
            -
                  ./spec/fixtures/assets/js/test.js
         
     | 
| 
       15 
     | 
    
         
            -
                )
         
     | 
| 
       16 
     | 
    
         
            -
                l = listener {}
         
     | 
| 
       17 
     | 
    
         
            -
                l.expand_dirs(fixture_path('assets')).should == files
         
     | 
| 
       18 
     | 
    
         
            -
              end
         
     | 
| 
       19 
     | 
    
         
            -
              
         
     | 
| 
       20 
     | 
    
         
            -
              it "should expand paths to a single file" do
         
     | 
| 
       21 
     | 
    
         
            -
                l = listener {}
         
     | 
| 
       22 
     | 
    
         
            -
                l.expand_dirs(fixture_path('style.css')).should == ['./spec/fixtures/style.css']
         
     | 
| 
       23 
     | 
    
         
            -
              end
         
     | 
| 
       24 
     | 
    
         
            -
              
         
     | 
| 
       25 
     | 
    
         
            -
              it "should expand directories using globbing" do
         
     | 
| 
       26 
     | 
    
         
            -
                files = %w(
         
     | 
| 
       27 
     | 
    
         
            -
                  ./spec/fixtures/assets/jquery.js
         
     | 
| 
       28 
     | 
    
         
            -
                  ./spec/fixtures/assets/js/app.js
         
     | 
| 
       29 
     | 
    
         
            -
                  ./spec/fixtures/assets/js/test.js
         
     | 
| 
       30 
     | 
    
         
            -
                )
         
     | 
| 
       31 
     | 
    
         
            -
                l = listener {}
         
     | 
| 
       32 
     | 
    
         
            -
                l.expand_dirs(fixture_path('assets/**/*.js')).should == files
         
     | 
| 
       33 
     | 
    
         
            -
              end
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
              it "should record total runtime" do
         
     | 
| 
       36 
     | 
    
         
            -
                l = listener(fixture_path('style.css')) {}
         
     | 
| 
       37 
     | 
    
         
            -
                l.run!
         
     | 
| 
       38 
     | 
    
         
            -
                l.run_time.to_i.should == 2
         
     | 
| 
       39 
     | 
    
         
            -
              end
         
     | 
| 
       40 
     | 
    
         
            -
                
         
     | 
| 
       41 
     | 
    
         
            -
            end
         
     |