kicker 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -1
- data/lib/kicker.rb +3 -2
- data/lib/kicker/options.rb +5 -0
- data/lib/kicker/recipes.rb +6 -5
- data/lib/kicker/recipes/ruby.rb +4 -3
- data/lib/kicker/utils.rb +37 -8
- data/lib/kicker/version.rb +3 -0
- metadata +98 -155
- data/.kick +0 -37
- data/.travis.yml +0 -6
- data/Gemfile +0 -11
- data/Gemfile.lock +0 -34
- data/Rakefile +0 -37
- data/TODO.rdoc +0 -5
- data/VERSION +0 -1
- data/kicker.gemspec +0 -106
- data/test/callback_chain_test.rb +0 -165
- data/test/core_ext_test.rb +0 -38
- data/test/filesystem_change_test.rb +0 -104
- data/test/fixtures/a_file_thats_reloaded.rb +0 -2
- data/test/fsevents_test.rb +0 -35
- data/test/growl_test.rb +0 -87
- data/test/initialization_test.rb +0 -137
- data/test/log_status_helper_test.rb +0 -56
- data/test/options_test.rb +0 -80
- data/test/recipes/could_not_handle_file_test.rb +0 -21
- data/test/recipes/dot_kick_test.rb +0 -22
- data/test/recipes/execute_cli_command_test.rb +0 -37
- data/test/recipes/ignore_test.rb +0 -29
- data/test/recipes/jstest_test.rb +0 -31
- data/test/recipes/rails_test.rb +0 -186
- data/test/recipes/ruby_test.rb +0 -162
- data/test/recipes_test.rb +0 -67
- data/test/test_helper.rb +0 -29
- data/test/utils_test.rb +0 -193
data/.kick
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
recipe :ignore
|
2
|
-
recipe :ruby
|
3
|
-
|
4
|
-
process do |files|
|
5
|
-
test_files = files.take_and_map do |file|
|
6
|
-
case file
|
7
|
-
when %r{^lib/kicker(\.rb|/validate\.rb|/growl\.rb)$}
|
8
|
-
["test/initialization_test.rb", ("test/filesystem_change_test.rb" if $1 == '.rb')]
|
9
|
-
when %r{^lib/kicker/(.+)\.rb$}
|
10
|
-
"test/#{$1}_test.rb"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
Ruby.run_tests test_files
|
15
|
-
end
|
16
|
-
|
17
|
-
process do |files|
|
18
|
-
execute("rake docs:generate && open -a Safari html/index.html") if files.delete("README.rdoc")
|
19
|
-
end
|
20
|
-
|
21
|
-
startup do
|
22
|
-
log "Good choice mate!"
|
23
|
-
end
|
24
|
-
|
25
|
-
# process do
|
26
|
-
# execute "ls -l" do |status|
|
27
|
-
# if status.before?
|
28
|
-
# status.stdout? ? "Here we go!: #{status.command}" : "Here we go! GROWL"
|
29
|
-
# elsif status.after?
|
30
|
-
# if status.success?
|
31
|
-
# status.stdout? ? "Nice!\n\n#{status.output}" : "Nice!"
|
32
|
-
# else
|
33
|
-
# status.stdout? ? "Damn brow!\n\n#{status.output}" : "Damn bro!"
|
34
|
-
# end
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
# end
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activesupport (3.2.1)
|
5
|
-
i18n (~> 0.6)
|
6
|
-
multi_json (~> 1.0)
|
7
|
-
git (1.2.5)
|
8
|
-
i18n (0.6.0)
|
9
|
-
jeweler (1.8.3)
|
10
|
-
bundler (~> 1.0)
|
11
|
-
git (>= 1.2.5)
|
12
|
-
rake
|
13
|
-
rdoc
|
14
|
-
json (1.6.5)
|
15
|
-
metaclass (0.0.1)
|
16
|
-
mocha (0.10.3)
|
17
|
-
metaclass (~> 0.0.1)
|
18
|
-
multi_json (1.0.4)
|
19
|
-
rake (0.9.2.2)
|
20
|
-
rb-fsevent (0.9.0)
|
21
|
-
rdoc (3.12)
|
22
|
-
json (~> 1.4)
|
23
|
-
test-spec (0.10.0)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
activesupport
|
30
|
-
jeweler
|
31
|
-
mocha
|
32
|
-
rake
|
33
|
-
rb-fsevent
|
34
|
-
test-spec
|
data/Rakefile
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
|
6
|
-
begin
|
7
|
-
require 'jeweler'
|
8
|
-
Jeweler::Tasks.new do |gem|
|
9
|
-
gem.name = "kicker"
|
10
|
-
gem.summary = %Q{A lean, agnostic, flexible file-change watcher, using OS X FSEvents.}
|
11
|
-
gem.email = "eloy.de.enige@gmail.com"
|
12
|
-
gem.homepage = "http://github.com/alloy/kicker"
|
13
|
-
gem.authors = ["Eloy Duran"]
|
14
|
-
gem.files.concat FileList['vendor/**/*']
|
15
|
-
gem.require_paths = ["lib", "vendor"]
|
16
|
-
gem.has_rdoc = true
|
17
|
-
gem.add_dependency 'rb-fsevent'
|
18
|
-
end
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://gems.github.com"
|
21
|
-
end
|
22
|
-
|
23
|
-
Rake::TestTask.new do |t|
|
24
|
-
t.libs << "test"
|
25
|
-
t.test_files = FileList['test/**/*_test.rb']
|
26
|
-
t.options = '-rs'
|
27
|
-
end
|
28
|
-
|
29
|
-
namespace :docs do
|
30
|
-
Rake::RDocTask.new('generate') do |t|
|
31
|
-
t.main = "README.rdoc"
|
32
|
-
t.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
33
|
-
t.options << '--charset=utf8'
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
task :default => :test
|
data/TODO.rdoc
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
* Move larger parts of README to the GitHub wiki so the README is to the point.
|
2
|
-
* Add a recipe which implements the basic autotest mapping API.
|
3
|
-
* Make the loggers, stdout and growl, work in a chain so one can add others.
|
4
|
-
This should improve portability as well, as people can easily insert growl
|
5
|
-
alternatives for their platform.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.4.0
|
data/kicker.gemspec
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{kicker}
|
8
|
-
s.version = "2.4.0"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Eloy Duran"]
|
12
|
-
s.date = %q{2012-02-03}
|
13
|
-
s.default_executable = %q{kicker}
|
14
|
-
s.email = %q{eloy.de.enige@gmail.com}
|
15
|
-
s.executables = ["kicker"]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"LICENSE",
|
18
|
-
"README.rdoc"
|
19
|
-
]
|
20
|
-
s.files = [
|
21
|
-
".kick",
|
22
|
-
".travis.yml",
|
23
|
-
"Gemfile",
|
24
|
-
"Gemfile.lock",
|
25
|
-
"LICENSE",
|
26
|
-
"README.rdoc",
|
27
|
-
"Rakefile",
|
28
|
-
"TODO.rdoc",
|
29
|
-
"VERSION",
|
30
|
-
"bin/kicker",
|
31
|
-
"html/images/kikker.jpg",
|
32
|
-
"kicker.gemspec",
|
33
|
-
"lib/kicker.rb",
|
34
|
-
"lib/kicker/callback_chain.rb",
|
35
|
-
"lib/kicker/core_ext.rb",
|
36
|
-
"lib/kicker/fsevents.rb",
|
37
|
-
"lib/kicker/growl.rb",
|
38
|
-
"lib/kicker/log_status_helper.rb",
|
39
|
-
"lib/kicker/options.rb",
|
40
|
-
"lib/kicker/recipes.rb",
|
41
|
-
"lib/kicker/recipes/could_not_handle_file.rb",
|
42
|
-
"lib/kicker/recipes/dot_kick.rb",
|
43
|
-
"lib/kicker/recipes/execute_cli_command.rb",
|
44
|
-
"lib/kicker/recipes/ignore.rb",
|
45
|
-
"lib/kicker/recipes/jstest.rb",
|
46
|
-
"lib/kicker/recipes/rails.rb",
|
47
|
-
"lib/kicker/recipes/ruby.rb",
|
48
|
-
"lib/kicker/utils.rb",
|
49
|
-
"test/callback_chain_test.rb",
|
50
|
-
"test/core_ext_test.rb",
|
51
|
-
"test/filesystem_change_test.rb",
|
52
|
-
"test/fixtures/a_file_thats_reloaded.rb",
|
53
|
-
"test/fsevents_test.rb",
|
54
|
-
"test/growl_test.rb",
|
55
|
-
"test/initialization_test.rb",
|
56
|
-
"test/log_status_helper_test.rb",
|
57
|
-
"test/options_test.rb",
|
58
|
-
"test/recipes/could_not_handle_file_test.rb",
|
59
|
-
"test/recipes/dot_kick_test.rb",
|
60
|
-
"test/recipes/execute_cli_command_test.rb",
|
61
|
-
"test/recipes/ignore_test.rb",
|
62
|
-
"test/recipes/jstest_test.rb",
|
63
|
-
"test/recipes/rails_test.rb",
|
64
|
-
"test/recipes/ruby_test.rb",
|
65
|
-
"test/recipes_test.rb",
|
66
|
-
"test/test_helper.rb",
|
67
|
-
"test/utils_test.rb",
|
68
|
-
"vendor/growlnotifier/growl.rb",
|
69
|
-
"vendor/growlnotifier/growl_helpers.rb"
|
70
|
-
]
|
71
|
-
s.homepage = %q{http://github.com/alloy/kicker}
|
72
|
-
s.require_paths = ["lib", "vendor"]
|
73
|
-
s.rubygems_version = %q{1.6.2}
|
74
|
-
s.summary = %q{A lean, agnostic, flexible file-change watcher, using OS X FSEvents.}
|
75
|
-
|
76
|
-
if s.respond_to? :specification_version then
|
77
|
-
s.specification_version = 3
|
78
|
-
|
79
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
80
|
-
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
81
|
-
s.add_development_dependency(%q<mocha>, [">= 0"])
|
82
|
-
s.add_development_dependency(%q<test-spec>, [">= 0"])
|
83
|
-
s.add_development_dependency(%q<activesupport>, [">= 0"])
|
84
|
-
s.add_development_dependency(%q<rb-fsevent>, [">= 0"])
|
85
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
86
|
-
s.add_runtime_dependency(%q<rb-fsevent>, [">= 0"])
|
87
|
-
else
|
88
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
89
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
90
|
-
s.add_dependency(%q<test-spec>, [">= 0"])
|
91
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
92
|
-
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
93
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
94
|
-
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
95
|
-
end
|
96
|
-
else
|
97
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
98
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
99
|
-
s.add_dependency(%q<test-spec>, [">= 0"])
|
100
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
101
|
-
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
102
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
103
|
-
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
data/test/callback_chain_test.rb
DELETED
@@ -1,165 +0,0 @@
|
|
1
|
-
require File.expand_path('../test_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "Kicker, concerning its callback chains" do
|
4
|
-
before do
|
5
|
-
@chains = [:startup_chain, :pre_process_chain, :process_chain, :post_process_chain, :full_chain]
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return the callback chain instances" do
|
9
|
-
@chains.each do |chain|
|
10
|
-
Kicker.send(chain).should.be.instance_of Kicker::CallbackChain
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should be accessible by an instance" do
|
15
|
-
kicker = Kicker.new
|
16
|
-
|
17
|
-
@chains.each do |chain|
|
18
|
-
kicker.send(chain).should == Kicker.send(chain)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should provide a shortcut method which appends a callback to the startup chain" do
|
23
|
-
Kicker.startup_chain.expects(:append_callback).with do |callback|
|
24
|
-
callback.call == :from_callback
|
25
|
-
end
|
26
|
-
|
27
|
-
startup { :from_callback }
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should provide a shortcut method which appends a callback to the pre-process chain" do
|
31
|
-
Kicker.pre_process_chain.expects(:append_callback).with do |callback|
|
32
|
-
callback.call == :from_callback
|
33
|
-
end
|
34
|
-
|
35
|
-
pre_process { :from_callback }
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should provide a shortcut method which appends a callback to the process chain" do
|
39
|
-
Kicker.process_chain.expects(:append_callback).with do |callback|
|
40
|
-
callback.call == :from_callback
|
41
|
-
end
|
42
|
-
|
43
|
-
process { :from_callback }
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should provide a shortcut method which prepends a callback to the post-process chain" do
|
47
|
-
Kicker.post_process_chain.expects(:prepend_callback).with do |callback|
|
48
|
-
callback.call == :from_callback
|
49
|
-
end
|
50
|
-
|
51
|
-
post_process { :from_callback }
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should have assigned the chains to the `full_chain' (except startup_chain)" do
|
55
|
-
Kicker.full_chain.length.should == 3
|
56
|
-
Kicker.full_chain.each_with_index do |chain, index|
|
57
|
-
chain.should.be Kicker.send(@chains[index + 1])
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "Kicker::CallbackChain" do
|
63
|
-
it "should be a subclass of Array" do
|
64
|
-
Kicker::CallbackChain.superclass.should.be Array
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe "An instance of Kicker::CallbackChain, concerning it's API" do
|
69
|
-
before do
|
70
|
-
@chain = Kicker::CallbackChain.new
|
71
|
-
|
72
|
-
@callback1 = lambda {}
|
73
|
-
@callback2 = lambda {}
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should append a callback" do
|
77
|
-
@chain << @callback1
|
78
|
-
@chain.append_callback(@callback2)
|
79
|
-
|
80
|
-
@chain.should == [@callback1, @callback2]
|
81
|
-
end
|
82
|
-
|
83
|
-
it "should prepend a callback" do
|
84
|
-
@chain << @callback1
|
85
|
-
@chain.prepend_callback(@callback2)
|
86
|
-
|
87
|
-
@chain.should == [@callback2, @callback1]
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
describe "An instance of Kicker::CallbackChain, when calling the chain" do
|
92
|
-
before do
|
93
|
-
@chain = Kicker::CallbackChain.new
|
94
|
-
@result = []
|
95
|
-
end
|
96
|
-
|
97
|
-
it "should call the callbacks from first to last" do
|
98
|
-
@chain.append_callback lambda { @result << 1 }
|
99
|
-
@chain.append_callback lambda { @result << 2 }
|
100
|
-
@chain.call(%w{ file })
|
101
|
-
@result.should == [1, 2]
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should pass the files array given to #call to each callback in the chain" do
|
105
|
-
array = %w{ /file/1 }
|
106
|
-
|
107
|
-
@chain.append_callback lambda { |files|
|
108
|
-
files.should.be array
|
109
|
-
files.concat(%w{ /file/2 })
|
110
|
-
}
|
111
|
-
|
112
|
-
@chain.append_callback lambda { |files|
|
113
|
-
files.should.be array
|
114
|
-
@result.concat(files)
|
115
|
-
}
|
116
|
-
|
117
|
-
@chain.call(array)
|
118
|
-
@result.should == %w{ /file/1 /file/2 }
|
119
|
-
end
|
120
|
-
|
121
|
-
it "should halt the callback chain once the given array is empty" do
|
122
|
-
@chain.append_callback lambda { |files| @result << 1; files.clear }
|
123
|
-
@chain.append_callback lambda { |files| @result << 2 }
|
124
|
-
@chain.call(%w{ /file/1 /file/2 })
|
125
|
-
@result.should == [1]
|
126
|
-
end
|
127
|
-
|
128
|
-
it "should not halt the chain if the array is empty if specified" do
|
129
|
-
@chain.append_callback lambda { |files| @result << 1; files.clear }
|
130
|
-
@chain.append_callback lambda { |files| @result << 2 }
|
131
|
-
@chain.call(%w{ /file/1 /file/2 }, false)
|
132
|
-
@result.should == [1, 2]
|
133
|
-
end
|
134
|
-
|
135
|
-
it "should not call any callback if the given array is empty" do
|
136
|
-
@chain.append_callback lambda { |files| @result << 1 }
|
137
|
-
@chain.call([])
|
138
|
-
@result.should == []
|
139
|
-
end
|
140
|
-
|
141
|
-
it "should work with a chain of chains as well" do
|
142
|
-
array = %w{ file }
|
143
|
-
|
144
|
-
kicker_and_files = lambda do |kicker, files|
|
145
|
-
kicker.should.be @kicker
|
146
|
-
files.should.be array
|
147
|
-
end
|
148
|
-
|
149
|
-
chain1 = Kicker::CallbackChain.new([
|
150
|
-
lambda { |files| files.should.be array; @result << 1 },
|
151
|
-
lambda { |files| files.should.be array; @result << 2 }
|
152
|
-
])
|
153
|
-
|
154
|
-
chain2 = Kicker::CallbackChain.new([
|
155
|
-
lambda { |files| files.should.be array; @result << 3 },
|
156
|
-
lambda { |files| files.should.be array; @result << 4 }
|
157
|
-
])
|
158
|
-
|
159
|
-
@chain.append_callback chain1
|
160
|
-
@chain.append_callback chain2
|
161
|
-
|
162
|
-
@chain.call(array)
|
163
|
-
@result.should == [1, 2, 3, 4]
|
164
|
-
end
|
165
|
-
end
|
data/test/core_ext_test.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require File.expand_path('../test_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "Array#take_and_map" do
|
4
|
-
before do
|
5
|
-
@array = %w{ foo bar baz foo/bar.baz foo/bar/baz }
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should remove elements from the array for which the block evaluates to true" do
|
9
|
-
@array.take_and_map { |x| x =~ /^ba/ }
|
10
|
-
@array.should == %w{ foo foo/bar.baz foo/bar/baz }
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should return a new array of the return values of each block call that evaluates to true" do
|
14
|
-
@array.take_and_map { |x| $1 if x =~ /^ba(\w)/ }.should == %w{ r z }
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should flatten and compact the result array" do
|
18
|
-
@array.take_and_map do |x|
|
19
|
-
x =~ /^ba/ ? %w{ f o o } : [nil]
|
20
|
-
end.should == %w{ f o o f o o }
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should not flatten and compact the result array if specified" do
|
24
|
-
@array.take_and_map(nil, false) do |x|
|
25
|
-
x =~ /^ba/ ? %w{ f o o } : [nil]
|
26
|
-
end.should == [[nil], %w{ f o o }, %w{ f o o }, [nil], [nil]]
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should take only files matching the pattern" do
|
30
|
-
@array.take_and_map('**/*') { |x| x.reverse }.should ==
|
31
|
-
%w{ foo/bar.baz foo/bar/baz }.map { |s| s.reverse }
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should not remove files not matching the pattern" do
|
35
|
-
@array.take_and_map('**/*') { |x| x }
|
36
|
-
@array.should == %w{ foo bar baz }
|
37
|
-
end
|
38
|
-
end
|