rerun 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +3 -1
  2. data/bin/rerun +3 -2
  3. data/lib/rerun.rb +4 -1
  4. data/rerun.gemspec +1 -1
  5. metadata +1 -1
data/README.md CHANGED
@@ -41,7 +41,7 @@ Rubyforge only when it's had some time to bake.
41
41
  For example, if you're running a Sinatra app whose main file is
42
42
  app.rb:
43
43
 
44
- rerun app.rb
44
+ rerun "ruby app.rb"
45
45
 
46
46
  Or if you're running a Rack app that's configured in config.ru
47
47
  but you want it on port 4000 and in debug mode:
@@ -52,6 +52,8 @@ but you want it on port 4000 and in debug mode:
52
52
 
53
53
  --dir directory to watch (default = ".")
54
54
 
55
+ --pattern glob to match inside directory. This uses the Ruby Dir glob style -- see <http://www.ruby-doc.org/core/classes/Dir.html#M002322> for details. By default it watches .rb, .js, and .css files.
56
+
55
57
  Also --version and --help.
56
58
 
57
59
  # To Do:
data/bin/rerun CHANGED
@@ -7,6 +7,8 @@ $LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)
7
7
 
8
8
  load "#{libdir}/../rerun.gemspec" # defines "$spec" variable, which we read the version from
9
9
 
10
+ require 'rerun'
11
+
10
12
  require 'optparse'
11
13
 
12
14
  options = {}
@@ -24,7 +26,7 @@ opts = OptionParser.new("", 24, ' ') { |opts|
24
26
  options[:dir] = dir
25
27
  end
26
28
 
27
- opts.on("-p pattern", "--pattern pattern", "file glob, default = \"**/*.rb\"") do |dir|
29
+ opts.on("-p pattern", "--pattern pattern", "file glob, default = \"#{Rerun::DEFAULT_PATTERN}\"") do |dir|
28
30
  options[:dir] = dir
29
31
  end
30
32
 
@@ -53,7 +55,6 @@ if ARGV.empty?
53
55
  exit
54
56
  end
55
57
 
56
- require 'rerun'
57
58
  cmd = ARGV.join(" ")
58
59
  runner = Rerun::Runner.new(cmd, options)
59
60
  runner.start
data/lib/rerun.rb CHANGED
@@ -5,6 +5,9 @@ require "fswatcher"
5
5
 
6
6
  # todo: make sure this works in non-Mac environments (also Macs without growlnotify)
7
7
  module Rerun
8
+
9
+ DEFAULT_PATTERN = "**/*.{rb,js,css}"
10
+
8
11
  class Runner
9
12
 
10
13
  include System
@@ -25,7 +28,7 @@ module Rerun
25
28
  end
26
29
 
27
30
  def pattern
28
- @options[:pattern] || "**/*.rb"
31
+ @options[:pattern] || DEFAULT_PATTERN
29
32
  end
30
33
 
31
34
  def start
data/rerun.gemspec CHANGED
@@ -3,7 +3,7 @@ $spec = Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'rerun'
6
- s.version = '0.5'
6
+ s.version = '0.5.1'
7
7
  s.date = '2009-12-03'
8
8
 
9
9
  s.description = "Restarts your app when a file changes"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rerun
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.5"
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Chaffee