Skip to content

Commit

Permalink
Update FSSM => Listen for jim watch
Browse files Browse the repository at this point in the history
  • Loading branch information
quirkey committed May 30, 2012
1 parent 7ed659f commit 0f8e865
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -2,7 +2,7 @@ source "http://rubygems.org"

gem "downlow", "~> 0.1.3"
gem "thor", "~>0.15"
gem "fssm"
gem "listen"
gem "yajl-ruby"
gem "version_sorter", "~> 1.1.0"

Expand Down
13 changes: 11 additions & 2 deletions Gemfile.lock
Expand Up @@ -6,21 +6,30 @@ GEM
archive-tar-minitar (>= 0.5.2)
rubyzip (>= 0.9.4)
fakeweb (1.3.0)
fssm (0.2.9)
ffi (1.0.11)
git (1.2.5)
jeweler (1.8.3)
bundler (~> 1.0)
git (>= 1.2.5)
rake
rdoc
json (1.7.3)
listen (0.4.2)
rb-fchange (~> 0.0.5)
rb-fsevent (~> 0.9.1)
rb-inotify (~> 0.8.8)
metaclass (0.0.1)
mocha (0.11.4)
metaclass (~> 0.0.1)
rack (1.4.1)
rack-test (0.6.1)
rack (>= 1.0)
rake (0.9.2.2)
rb-fchange (0.0.5)
ffi
rb-fsevent (0.9.1)
rb-inotify (0.8.8)
ffi (>= 0.5.0)
rdoc (3.12)
json (~> 1.4)
rubyzip (0.9.8)
Expand All @@ -40,8 +49,8 @@ PLATFORMS
DEPENDENCIES
downlow (~> 0.1.3)
fakeweb (>= 1.2.8)
fssm
jeweler
listen
mocha
rack-test
rake
Expand Down
5 changes: 5 additions & 0 deletions HISTORY
@@ -1,3 +1,8 @@
== 0.3.3 [05-29-12]

* Update dependencies (Thor, etc)
* Move to listen gem (replaces FSSM)

== 0.3.2 [11-09-11]

* Dont raise error on install anymore, just return false (better for the CLI)
Expand Down
2 changes: 1 addition & 1 deletion lib/jim.rb
Expand Up @@ -5,7 +5,7 @@
require 'digest/md5'

module Jim
VERSION = '0.3.2'
VERSION = '0.3.3'

class Error < RuntimeError; end
class InstallError < Error; end
Expand Down
11 changes: 6 additions & 5 deletions lib/jim/cli.rb
Expand Up @@ -211,7 +211,7 @@ def pack(dir = nil)
"Watches your Jimfile and JS files and triggers `bundle` if something " +
"changes. Handy for development."
def watch(dir = nil)
require 'fssm'
require 'listen'
run_update = lambda {|type, path|
unless bundler.bundle_paths.any? {|p| path.include?(p) }
say("--> #{path} #{type}")
Expand All @@ -220,16 +220,17 @@ def watch(dir = nil)
}
say "Now watching JS files..."
run_update["started", 'Jimfile']
FSSM.monitor(Dir.pwd, [File.join('**','*.js'), 'Jimfile']) do
update do |base, relative|
dir ||= Dir.pwd
Listen.to(File.expand_path(dir), :filter => /(\.js$|Jimfile)/) do |modified, added, removed|
modified.each do |relative|
run_update["changed", relative]
end

create do |base, relative|
added.each do |relative|
run_update["created", relative]
end

delete do |base, relative|
removed.each do |relative|
run_update["deleted", relative]
end
end
Expand Down

0 comments on commit 0f8e865

Please sign in to comment.