guard 1.0.3 → 1.1.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +0 -6
- data/README.md +38 -30
- data/lib/guard.rb +158 -285
- data/lib/guard/cli.rb +16 -2
- data/lib/guard/dsl.rb +41 -20
- data/lib/guard/dsl_describer.rb +1 -1
- data/lib/guard/group.rb +1 -1
- data/lib/guard/guard.rb +39 -5
- data/lib/guard/guardfile.rb +70 -0
- data/lib/guard/runner.rb +179 -0
- data/lib/guard/ui.rb +1 -1
- data/lib/guard/version.rb +2 -4
- data/lib/guard/watcher.rb +1 -0
- metadata +16 -77
- data/bin/fsevent_watch_guard_guard +0 -0
- data/lib/guard/listener.rb +0 -376
- data/lib/guard/listeners/darwin.rb +0 -62
- data/lib/guard/listeners/linux.rb +0 -93
- data/lib/guard/listeners/polling.rb +0 -55
- data/lib/guard/listeners/windows.rb +0 -63
- data/lib/vendor/darwin/Gemfile +0 -6
- data/lib/vendor/darwin/Guardfile +0 -8
- data/lib/vendor/darwin/LICENSE +0 -20
- data/lib/vendor/darwin/README.rdoc +0 -255
- data/lib/vendor/darwin/Rakefile +0 -21
- data/lib/vendor/darwin/bin/fsevent_watch +0 -0
- data/lib/vendor/darwin/ext/fsevent_watch/Info.plist +0 -38
- data/lib/vendor/darwin/ext/fsevent_watch/LICENSE +0 -21
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch.xcodeproj/project.pbxproj +0 -254
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/TSICTString.c +0 -394
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/TSICTString.h +0 -74
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/cli.c +0 -160
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/cli.h +0 -45
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/common.h +0 -34
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/compat.c +0 -20
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/compat.h +0 -40
- data/lib/vendor/darwin/ext/fsevent_watch/fsevent_watch/main.c +0 -509
- data/lib/vendor/darwin/ext/fsevent_watch/xcconfig/Common.xcconfig +0 -82
- data/lib/vendor/darwin/ext/fsevent_watch/xcconfig/Debug.xcconfig +0 -19
- data/lib/vendor/darwin/ext/fsevent_watch/xcconfig/Release.xcconfig +0 -23
- data/lib/vendor/darwin/ext/fsevent_watch/xcconfig/fsevent_watch.xcconfig +0 -17
- data/lib/vendor/darwin/ext/rakefile.rb +0 -47
- data/lib/vendor/darwin/ext/rb-fsevent.xcconfig +0 -33
- data/lib/vendor/darwin/lib/rb-fsevent.rb +0 -2
- data/lib/vendor/darwin/lib/rb-fsevent/fsevent.rb +0 -111
- data/lib/vendor/darwin/lib/rb-fsevent/version.rb +0 -3
- data/lib/vendor/darwin/rb-fsevent.gemspec +0 -25
- data/lib/vendor/darwin/spec/fixtures/folder1/file1.txt +0 -0
- data/lib/vendor/darwin/spec/fixtures/folder1/folder2/file2.txt +0 -0
- data/lib/vendor/darwin/spec/rb-fsevent/fsevent_spec.rb +0 -88
- data/lib/vendor/darwin/spec/spec_helper.rb +0 -23
- data/lib/vendor/linux/MIT-LICENSE +0 -20
- data/lib/vendor/linux/README.md +0 -66
- data/lib/vendor/linux/Rakefile +0 -54
- data/lib/vendor/linux/VERSION +0 -1
- data/lib/vendor/linux/lib/rb-inotify.rb +0 -17
- data/lib/vendor/linux/lib/rb-inotify/event.rb +0 -139
- data/lib/vendor/linux/lib/rb-inotify/native.rb +0 -31
- data/lib/vendor/linux/lib/rb-inotify/native/flags.rb +0 -89
- data/lib/vendor/linux/lib/rb-inotify/notifier.rb +0 -308
- data/lib/vendor/linux/lib/rb-inotify/watcher.rb +0 -83
- data/lib/vendor/linux/rb-inotify.gemspec +0 -53
- data/lib/vendor/windows/Gemfile +0 -4
- data/lib/vendor/windows/README.md +0 -34
- data/lib/vendor/windows/Rakefile +0 -18
- data/lib/vendor/windows/lib/rb-fchange.rb +0 -14
- data/lib/vendor/windows/lib/rb-fchange/event.rb +0 -29
- data/lib/vendor/windows/lib/rb-fchange/native.rb +0 -45
- data/lib/vendor/windows/lib/rb-fchange/native/flags.rb +0 -78
- data/lib/vendor/windows/lib/rb-fchange/notifier.rb +0 -149
- data/lib/vendor/windows/lib/rb-fchange/version.rb +0 -3
- data/lib/vendor/windows/lib/rb-fchange/watcher.rb +0 -99
- data/lib/vendor/windows/rb-fchange.gemspec +0 -34
- data/lib/vendor/windows/spec/fixtures/folder1/file1.txt +0 -0
- data/lib/vendor/windows/spec/fixtures/folder1/folder2/file2.txt +0 -0
- data/lib/vendor/windows/spec/rb-fchange/fchange_spec.rb +0 -119
- data/lib/vendor/windows/spec/spec_helper.rb +0 -21
@@ -1,34 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "rb-fchange/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = %q{rb-fchange}
|
7
|
-
s.version = FChange::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["stereobooster"]
|
10
|
-
s.date = %q{2011-05-15}
|
11
|
-
s.description = %q{A Ruby wrapper for Windows Kernel functions for monitoring the specified directory or subtree}
|
12
|
-
s.email = ["stereobooster@gmail.com"]
|
13
|
-
s.extra_rdoc_files = [
|
14
|
-
"README.md"
|
15
|
-
]
|
16
|
-
s.files = [
|
17
|
-
"README.md",
|
18
|
-
"Rakefile",
|
19
|
-
"lib/rb-fchange.rb",
|
20
|
-
"lib/rb-fchange/event.rb",
|
21
|
-
"lib/rb-fchange/native.rb",
|
22
|
-
"lib/rb-fchange/native/flags.rb",
|
23
|
-
"lib/rb-fchange/notifier.rb",
|
24
|
-
"lib/rb-fchange/watcher.rb",
|
25
|
-
"rb-fchange.gemspec"
|
26
|
-
]
|
27
|
-
s.homepage = %q{http://github.com/stereobooster/rb-fchange}
|
28
|
-
s.require_paths = ["lib"]
|
29
|
-
s.rubygems_version = %q{1.3.7}
|
30
|
-
s.summary = %q{A Ruby wrapper for Windows Kernel functions for monitoring the specified directory or subtree}
|
31
|
-
s.add_dependency 'ffi'
|
32
|
-
s.add_development_dependency 'bundler'
|
33
|
-
s.add_development_dependency 'rspec'
|
34
|
-
end
|
File without changes
|
File without changes
|
@@ -1,119 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe FChange do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
@results = []
|
8
|
-
@notifier = FChange::Notifier.new
|
9
|
-
@notifier.watch(@fixture_path.to_s) do |event|
|
10
|
-
@results += [event.watcher.path]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should work with path with an apostrophe" do
|
15
|
-
custom_path = @fixture_path.join("custom 'path")
|
16
|
-
file = custom_path.join("newfile.rb").to_s
|
17
|
-
File.delete file if File.exists? file
|
18
|
-
run
|
19
|
-
FileUtils.touch file
|
20
|
-
stop
|
21
|
-
File.delete file
|
22
|
-
@results.should == [@fixture_path.to_s, @fixture_path.to_s]
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should catch new file" do
|
26
|
-
file = @fixture_path.join("newfile.rb")
|
27
|
-
File.delete file if File.exists? file
|
28
|
-
run
|
29
|
-
FileUtils.touch file
|
30
|
-
stop
|
31
|
-
File.delete file
|
32
|
-
@results.should == [@fixture_path.to_s]
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should catch file update" do
|
36
|
-
file = @fixture_path.join("folder1/file1.txt")
|
37
|
-
File.exists?(file).should be_true
|
38
|
-
run
|
39
|
-
FileUtils.touch file
|
40
|
-
stop
|
41
|
-
@results.should == [@fixture_path.to_s]
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should catch files update" do
|
45
|
-
file1 = @fixture_path.join("folder1/file1.txt")
|
46
|
-
file2 = @fixture_path.join("folder1/folder2/file2.txt")
|
47
|
-
File.exists?(file1).should be_true
|
48
|
-
File.exists?(file2).should be_true
|
49
|
-
run
|
50
|
-
FileUtils.touch file1
|
51
|
-
FileUtils.touch file2
|
52
|
-
stop
|
53
|
-
@results.should == [@fixture_path.to_s, @fixture_path.to_s]
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should catch new directory" do
|
57
|
-
dir = @fixture_path.join("new_dir")
|
58
|
-
Dir.delete dir if Dir.exists? dir
|
59
|
-
Dir.exists?(dir).should be_false
|
60
|
-
run
|
61
|
-
Dir.mkdir dir
|
62
|
-
stop
|
63
|
-
Dir.delete dir
|
64
|
-
@results.should == [@fixture_path.to_s]
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should catch directory rename" do
|
68
|
-
dir = @fixture_path.join("new_dir")
|
69
|
-
dir_new = @fixture_path.join("new_dir1")
|
70
|
-
Dir.mkdir dir unless Dir.exists? dir
|
71
|
-
Dir.delete dir_new if Dir.exists? dir_new
|
72
|
-
run
|
73
|
-
File.rename(dir, dir_new)
|
74
|
-
stop
|
75
|
-
Dir.delete(dir_new)
|
76
|
-
@results.should == [@fixture_path.to_s, @fixture_path.to_s]
|
77
|
-
end
|
78
|
-
|
79
|
-
it "should catch file rename" do
|
80
|
-
file = @fixture_path.join("folder1/file1.txt")
|
81
|
-
file_new = @fixture_path.join("folder1/file3.txt")
|
82
|
-
File.exists?(file).should be_true
|
83
|
-
File.exists?(file_new).should be_false
|
84
|
-
run
|
85
|
-
File.rename(file, file_new)
|
86
|
-
stop
|
87
|
-
File.rename(file_new, file)
|
88
|
-
@results.should == [@fixture_path.to_s, @fixture_path.to_s]
|
89
|
-
end
|
90
|
-
|
91
|
-
# it "should work with none-ANSI path" do
|
92
|
-
# dir = @fixture_path.join("../тест")
|
93
|
-
# Dir.mkdir dir unless Dir.exists? dir
|
94
|
-
# file = dir.join("тест");
|
95
|
-
# File.delete file if File.exists? file
|
96
|
-
# File.exists?(file).should be_false
|
97
|
-
# @notifier.watch(dir.to_s, :all_events, :recursive) do |event|
|
98
|
-
# @results += [event.watcher.path]
|
99
|
-
# end
|
100
|
-
# run
|
101
|
-
# FileUtils.touch file
|
102
|
-
# stop
|
103
|
-
# File.delete file
|
104
|
-
# Dir.delete dir
|
105
|
-
# @results.should == [@fixture_path.to_s, @fixture_path.to_s]
|
106
|
-
# end
|
107
|
-
|
108
|
-
def run
|
109
|
-
sleep 0.6
|
110
|
-
Thread.new { @notifier.run }
|
111
|
-
sleep 0.6
|
112
|
-
end
|
113
|
-
|
114
|
-
def stop
|
115
|
-
sleep 0.6
|
116
|
-
@notifier.stop
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'rb-fchange'
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
# config.color_enabled = true
|
6
|
-
config.filter_run :focus => true
|
7
|
-
config.run_all_when_everything_filtered = true
|
8
|
-
|
9
|
-
config.before(:each) do
|
10
|
-
@fixture_path = Pathname.new(File.expand_path('../fixtures/', __FILE__))
|
11
|
-
end
|
12
|
-
|
13
|
-
config.before(:all) do
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
config.after(:all) do
|
18
|
-
gem_root = Pathname.new(File.expand_path('../../', __FILE__))
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|