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 CHANGED
@@ -1,5 +1,7 @@
1
1
  = Kicker
2
2
 
3
+ {<img src="https://secure.travis-ci.org/alloy/kicker.png" />}[http://travis-ci.org/alloy/kicker]
4
+
3
5
  A lean, agnostic, flexible file-change watcher, using OS X FSEvents.
4
6
 
5
7
  https://github.com/alloy/kicker/raw/master/html/images/kikker.jpg
@@ -141,4 +143,4 @@ be important in your decision on where to specify handlers.
141
143
  * Manfred Stienstra (@manfred)
142
144
  * Cristi Balan (@evilchelu)
143
145
  * Damir Zekic (@sidonath)
144
- * Adam Keys (@therealadam)
146
+ * Adam Keys (@therealadam)
data/lib/kicker.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  $:.unshift File.expand_path('../../vendor', __FILE__)
2
2
 
3
+ require 'kicker/version'
3
4
  require 'kicker/fsevents'
4
5
  require 'kicker/callback_chain'
5
6
  require 'kicker/core_ext'
@@ -31,7 +32,7 @@ class Kicker #:nodoc:
31
32
  log "Watching for changes on: #{paths.join(', ')}"
32
33
  log ''
33
34
 
34
- Kicker::Growl.start! if Kicker::Growl.use?
35
+ Kicker::Growl.start! if Kicker::Growl.usable? && Kicker::Growl.use?
35
36
  run_startup_chain
36
37
  run_watch_dog!
37
38
  end
@@ -116,4 +117,4 @@ class Kicker #:nodoc:
116
117
  end
117
118
  end
118
119
  end
119
- end
120
+ end
@@ -41,6 +41,11 @@ class Kicker
41
41
  opt.separator " Available recipes: #{recipes_for_display.join(", ")}."
42
42
  opt.separator " "
43
43
 
44
+ opt.on('-v', 'Print the Kicker version') do
45
+ puts VERSION
46
+ exit
47
+ end
48
+
44
49
  opt.on('-s', '--silent', 'Keep output to a minimum.') do |silent|
45
50
  Kicker.silent = true
46
51
  end
@@ -28,6 +28,10 @@ class Kicker
28
28
  class << self
29
29
  def reset!
30
30
  @recipes = nil
31
+ # Always load all the base recipes
32
+ load_recipe :execute_cli_command
33
+ load_recipe :could_not_handle_file
34
+ load_recipe :dot_kick
31
35
  end
32
36
 
33
37
  def recipes
@@ -86,9 +90,6 @@ class Kicker
86
90
  end
87
91
  end
88
92
 
89
- # Always load all the base recipes
90
- load_recipe :execute_cli_command
91
- load_recipe :could_not_handle_file
92
- load_recipe :dot_kick
93
+ reset!
93
94
  end
94
- end
95
+ end
@@ -20,7 +20,7 @@ class Kicker::Recipes::Ruby
20
20
  # Defaults to `ruby' if test_type is `test' and `spec' if test_type is
21
21
  # `spec'.
22
22
  def runner_bin
23
- @runner_bin ||= test_type == 'test' ? 'ruby' : 'spec'
23
+ @runner_bin ||= test_type == 'test' ? 'ruby' : 'rspec'
24
24
  end
25
25
 
26
26
  # Assigns the root directory of where test cases will be looked up.
@@ -68,7 +68,8 @@ class Kicker::Recipes::Ruby
68
68
  end
69
69
 
70
70
  def test_runner_command(tests)
71
- runner_command(runner_bin, test_options, '-r', tests.join(' -r '), "-e ''")
71
+ tests_without_ext = tests.map { |f| f[0,f.size-3] }
72
+ runner_command(runner_bin, %w{ -I. } + test_options, '-r', tests_without_ext.join(' -r '), "-e ''")
72
73
  end
73
74
 
74
75
  # Runs the given tests with `ruby' as unit-test tests.
@@ -170,4 +171,4 @@ end
170
171
 
171
172
  recipe :ruby do
172
173
  process Kicker::Recipes::Ruby
173
- end
174
+ end
data/lib/kicker/utils.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'shellwords' if RUBY_VERSION >= "1.9"
2
+
1
3
  class Kicker
2
4
  module Utils #:nodoc:
3
5
  extend self
@@ -5,9 +7,9 @@ class Kicker
5
7
  def execute(command, &block)
6
8
  @last_command = command
7
9
  status = LogStatusHelper.new(block, command)
8
-
9
10
  will_execute_command(status)
10
- status.result(`#{command}`, last_command_succeeded?, last_command_status)
11
+ output = _execute(command)
12
+ status.result(output, last_command_succeeded?, last_command_status)
11
13
  did_execute_command(status)
12
14
  end
13
15
 
@@ -35,6 +37,37 @@ class Kicker
35
37
  private
36
38
 
37
39
  CLEAR = "\e[H\e[2J"
40
+
41
+ def _execute(command)
42
+ silent = Kicker.silent?
43
+ unless silent
44
+ puts
45
+ sync_before, $stdout.sync = $stdout.sync, true
46
+ end
47
+ output = ""
48
+ popen(command) do |io|
49
+ while str = io.read(1)
50
+ output << str
51
+ $stdout.print str unless silent
52
+ end
53
+ end
54
+ output
55
+ ensure
56
+ unless silent
57
+ $stdout.sync = sync_before
58
+ puts("\n\n")
59
+ end
60
+ end
61
+
62
+ def popen(command, &block)
63
+ if RUBY_VERSION >= "1.9"
64
+ args = Shellwords.shellsplit(command)
65
+ args << { :err => [:child, :out] }
66
+ IO.popen(args, &block)
67
+ else
68
+ IO.popen("#{command} 2>&1", &block)
69
+ end
70
+ end
38
71
 
39
72
  def will_execute_command(status)
40
73
  puts(CLEAR) if Kicker.clear_console?
@@ -47,12 +80,8 @@ class Kicker
47
80
  if message = status.call(:stdout)
48
81
  log(message) unless message.empty?
49
82
  else
50
- if status.success? && Kicker.silent?
51
- log 'Success'
52
- else
53
- puts("\n#{status.output.strip}\n\n")
54
- log(status.success? ? "Success" : "Failed (#{status.exit_code})")
55
- end
83
+ puts("\n#{status.output.strip}\n\n") if Kicker.silent? && !status.success?
84
+ log(status.success? ? "Success" : "Failed (#{status.exit_code})")
56
85
  end
57
86
 
58
87
  Kicker::Growl.result(status) if Kicker::Growl.use?
@@ -0,0 +1,3 @@
1
+ class Kicker
2
+ VERSION = "2.5.0"
3
+ end
metadata CHANGED
@@ -1,151 +1,112 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: kicker
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.5.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 4
9
- - 0
10
- version: 2.4.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Eloy Duran
9
+ - Manfred Stienstra
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2012-02-03 00:00:00 +01:00
19
- default_executable: kicker
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
13
+ date: 2012-02-04 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rb-fsevent
17
+ requirement: &70258430386300 !ruby/object:Gem::Requirement
24
18
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
32
- name: rake
33
- version_requirements: *id001
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
34
24
  prerelease: false
35
- - !ruby/object:Gem::Dependency
36
- type: :development
37
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70258430386300
26
+ - !ruby/object:Gem::Dependency
27
+ name: rake
28
+ requirement: &70258430385620 !ruby/object:Gem::Requirement
38
29
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- name: mocha
47
- version_requirements: *id002
48
- prerelease: false
49
- - !ruby/object:Gem::Dependency
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
50
34
  type: :development
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- name: test-spec
61
- version_requirements: *id003
62
35
  prerelease: false
63
- - !ruby/object:Gem::Dependency
64
- type: :development
65
- requirement: &id004 !ruby/object:Gem::Requirement
36
+ version_requirements: *70258430385620
37
+ - !ruby/object:Gem::Dependency
38
+ name: rdoc
39
+ requirement: &70258430385060 !ruby/object:Gem::Requirement
66
40
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
74
- name: activesupport
75
- version_requirements: *id004
76
- prerelease: false
77
- - !ruby/object:Gem::Dependency
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
78
45
  type: :development
79
- requirement: &id005 !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ version_requirements: *70258430385060
48
+ - !ruby/object:Gem::Dependency
49
+ name: mocha
50
+ requirement: &70258430384360 !ruby/object:Gem::Requirement
80
51
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- version: "0"
88
- name: rb-fsevent
89
- version_requirements: *id005
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
90
57
  prerelease: false
91
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *70258430384360
59
+ - !ruby/object:Gem::Dependency
60
+ name: test-unit
61
+ requirement: &70258430411940 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
92
67
  type: :development
93
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ prerelease: false
69
+ version_requirements: *70258430411940
70
+ - !ruby/object:Gem::Dependency
71
+ name: test-spec
72
+ requirement: &70258430407460 !ruby/object:Gem::Requirement
94
73
  none: false
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 0
101
- version: "0"
102
- name: jeweler
103
- version_requirements: *id006
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :development
104
79
  prerelease: false
105
- - !ruby/object:Gem::Dependency
106
- type: :runtime
107
- requirement: &id007 !ruby/object:Gem::Requirement
80
+ version_requirements: *70258430407460
81
+ - !ruby/object:Gem::Dependency
82
+ name: activesupport
83
+ requirement: &70258430406080 !ruby/object:Gem::Requirement
108
84
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
116
- name: rb-fsevent
117
- version_requirements: *id007
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :development
118
90
  prerelease: false
91
+ version_requirements: *70258430406080
119
92
  description:
120
- email: eloy.de.enige@gmail.com
121
- executables:
93
+ email:
94
+ - eloy.de.enige@gmail.com
95
+ - manfred@fngtps.com
96
+ executables:
122
97
  - kicker
123
98
  extensions: []
124
-
125
- extra_rdoc_files:
126
- - LICENSE
127
- - README.rdoc
128
- files:
129
- - .kick
130
- - .travis.yml
131
- - Gemfile
132
- - Gemfile.lock
99
+ extra_rdoc_files:
133
100
  - LICENSE
134
101
  - README.rdoc
135
- - Rakefile
136
- - TODO.rdoc
137
- - VERSION
102
+ files:
138
103
  - bin/kicker
139
- - html/images/kikker.jpg
140
- - kicker.gemspec
141
- - lib/kicker.rb
142
104
  - lib/kicker/callback_chain.rb
143
105
  - lib/kicker/core_ext.rb
144
106
  - lib/kicker/fsevents.rb
145
107
  - lib/kicker/growl.rb
146
108
  - lib/kicker/log_status_helper.rb
147
109
  - lib/kicker/options.rb
148
- - lib/kicker/recipes.rb
149
110
  - lib/kicker/recipes/could_not_handle_file.rb
150
111
  - lib/kicker/recipes/dot_kick.rb
151
112
  - lib/kicker/recipes/execute_cli_command.rb
@@ -153,62 +114,44 @@ files:
153
114
  - lib/kicker/recipes/jstest.rb
154
115
  - lib/kicker/recipes/rails.rb
155
116
  - lib/kicker/recipes/ruby.rb
117
+ - lib/kicker/recipes.rb
156
118
  - lib/kicker/utils.rb
157
- - test/callback_chain_test.rb
158
- - test/core_ext_test.rb
159
- - test/filesystem_change_test.rb
160
- - test/fixtures/a_file_thats_reloaded.rb
161
- - test/fsevents_test.rb
162
- - test/growl_test.rb
163
- - test/initialization_test.rb
164
- - test/log_status_helper_test.rb
165
- - test/options_test.rb
166
- - test/recipes/could_not_handle_file_test.rb
167
- - test/recipes/dot_kick_test.rb
168
- - test/recipes/execute_cli_command_test.rb
169
- - test/recipes/ignore_test.rb
170
- - test/recipes/jstest_test.rb
171
- - test/recipes/rails_test.rb
172
- - test/recipes/ruby_test.rb
173
- - test/recipes_test.rb
174
- - test/test_helper.rb
175
- - test/utils_test.rb
119
+ - lib/kicker/version.rb
120
+ - lib/kicker.rb
176
121
  - vendor/growlnotifier/growl.rb
177
122
  - vendor/growlnotifier/growl_helpers.rb
178
- has_rdoc: true
123
+ - README.rdoc
124
+ - LICENSE
125
+ - html/images/kikker.jpg
179
126
  homepage: http://github.com/alloy/kicker
180
127
  licenses: []
181
-
182
128
  post_install_message:
183
129
  rdoc_options: []
184
-
185
- require_paths:
130
+ require_paths:
186
131
  - lib
187
132
  - vendor
188
- required_ruby_version: !ruby/object:Gem::Requirement
133
+ required_ruby_version: !ruby/object:Gem::Requirement
189
134
  none: false
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- hash: 3
194
- segments:
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ segments:
195
140
  - 0
196
- version: "0"
197
- required_rubygems_version: !ruby/object:Gem::Requirement
141
+ hash: 1334081187386863213
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
198
143
  none: false
199
- requirements:
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- hash: 3
203
- segments:
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ segments:
204
149
  - 0
205
- version: "0"
150
+ hash: 1334081187386863213
206
151
  requirements: []
207
-
208
152
  rubyforge_project:
209
- rubygems_version: 1.6.2
153
+ rubygems_version: 1.8.11
210
154
  signing_key:
211
155
  specification_version: 3
212
156
  summary: A lean, agnostic, flexible file-change watcher, using OS X FSEvents.
213
157
  test_files: []
214
-