fswatch 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in fswatch.gemspec
4
+ gemspec
@@ -0,0 +1,14 @@
1
+ # fswatch
2
+ A super trivial Ruby script for triggering a command on file system change in OS X.
3
+
4
+ ## Installation
5
+
6
+ The point was mainly to shove this into gemcutter so it's easy to deploy:
7
+
8
+ $ gem install fswatch
9
+
10
+ ## Usage
11
+
12
+ On file system change execute `ls -l`:
13
+
14
+ $ fswatch ls -l
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+
4
+ require 'fswatch'
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "fswatch/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "fswatch"
7
+ s.version = Fswatch::VERSION
8
+ s.authors = ["Wiktor Macura"]
9
+ s.email = ["wiktor@tumblr.com"]
10
+ s.homepage = "http://wiktormacura.com"
11
+ s.summary = %q{Trivial script for triggering a script on file system change (on OS X)}
12
+ s.description = %q{}
13
+
14
+ s.rubyforge_project = "fswatch"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+ s.add_runtime_dependency 'rb-fsevent'
25
+ s.add_runtime_dependency 'term-ansicolor'
26
+ end
@@ -0,0 +1,17 @@
1
+ require 'fswatch/version'
2
+
3
+ require 'rb-fsevent'
4
+ require 'term/ansicolor'
5
+
6
+ include Term::ANSIColor
7
+
8
+ module FSWatch
9
+
10
+ fsevent = FSEvent.new
11
+ fsevent.watch Dir.pwd do |directories|
12
+ print red, "\n\n--- Changed: ", bold, blue, directories.inspect, reset, "\n"
13
+ system(ARGV.join(' '))
14
+ end
15
+
16
+ fsevent.run
17
+ end
@@ -0,0 +1,3 @@
1
+ module Fswatch
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fswatch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Wiktor Macura
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-14 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rb-fsevent
16
+ requirement: &70326022078700 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70326022078700
25
+ - !ruby/object:Gem::Dependency
26
+ name: term-ansicolor
27
+ requirement: &70326022078160 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70326022078160
36
+ description: ''
37
+ email:
38
+ - wiktor@tumblr.com
39
+ executables:
40
+ - fswatch
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - .gitignore
45
+ - Gemfile
46
+ - README.md
47
+ - Rakefile
48
+ - bin/fswatch
49
+ - fswatch.gemspec
50
+ - lib/fswatch.rb
51
+ - lib/fswatch/version.rb
52
+ homepage: http://wiktormacura.com
53
+ licenses: []
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project: fswatch
72
+ rubygems_version: 1.8.10
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: Trivial script for triggering a script on file system change (on OS X)
76
+ test_files: []