kicker 2.2.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.3.0
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kicker}
8
- s.version = "2.2.3"
8
+ s.version = "2.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Eloy Duran"]
12
- s.date = %q{2009-12-11}
12
+ s.date = %q{2010-07-27}
13
13
  s.default_executable = %q{kicker}
14
14
  s.email = %q{eloy.de.enige@gmail.com}
15
15
  s.executables = ["kicker"]
@@ -62,10 +62,7 @@ Gem::Specification.new do |s|
62
62
  "test/test_helper.rb",
63
63
  "test/utils_test.rb",
64
64
  "vendor/growlnotifier/growl.rb",
65
- "vendor/growlnotifier/growl.rb",
66
- "vendor/growlnotifier/growl_helpers.rb",
67
65
  "vendor/growlnotifier/growl_helpers.rb",
68
- "vendor/rucola/fsevents.rb",
69
66
  "vendor/rucola/fsevents.rb"
70
67
  ]
71
68
  s.homepage = %q{http://github.com/alloy/kicker}
@@ -104,3 +101,4 @@ Gem::Specification.new do |s|
104
101
  else
105
102
  end
106
103
  end
104
+
@@ -2,7 +2,7 @@ require 'optparse'
2
2
 
3
3
  class Kicker
4
4
  class << self
5
- attr_accessor :latency, :paths, :silent, :quiet
5
+ attr_accessor :latency, :paths, :silent, :quiet, :clear_console
6
6
 
7
7
  def silent?
8
8
  @silent
@@ -11,12 +11,17 @@ class Kicker
11
11
  def quiet?
12
12
  @quiet
13
13
  end
14
+
15
+ def clear_console?
16
+ @clear_console
17
+ end
14
18
  end
15
19
 
16
20
  self.latency = 1
17
21
  self.paths = %w{ . }
18
22
  self.silent = false
19
23
  self.quiet = false
24
+ self.clear_console = false
20
25
 
21
26
  module Options #:nodoc:
22
27
  DONT_SHOW_RECIPES = %w{ could_not_handle_file execute_cli_command dot_kick }
@@ -40,6 +45,10 @@ class Kicker
40
45
  Kicker.silent = Kicker.quiet = true
41
46
  end
42
47
 
48
+ opt.on('-c', '--clear', "Clear console before each run.") do |clear|
49
+ Kicker.clear_console = true
50
+ end
51
+
43
52
  opt.on('--[no-]growl', 'Whether or not to use Growl. Default is to use growl.') do |growl|
44
53
  Kicker::Growl.use = growl
45
54
  end
@@ -71,4 +80,4 @@ module Kernel
71
80
  def options
72
81
  Kicker::Options.parser
73
82
  end
74
- end
83
+ end
@@ -34,7 +34,10 @@ class Kicker
34
34
 
35
35
  private
36
36
 
37
+ CLEAR = "\e[H\e[2J"
38
+
37
39
  def will_execute_command(status)
40
+ puts(CLEAR) if Kicker.clear_console?
38
41
  message = status.call(:stdout) || "Executing: #{status.command}"
39
42
  log(message) unless message.empty?
40
43
  Kicker::Growl.change_occured(status) if Kicker::Growl.use? && !Kicker.silent?
@@ -72,4 +75,4 @@ module Kernel
72
75
  def last_command
73
76
  Kicker::Utils.last_command
74
77
  end
75
- end
78
+ end
@@ -47,6 +47,14 @@ describe "Kicker::Options.parse" do
47
47
  Kicker.should.be.silent
48
48
  end
49
49
 
50
+ it "should parse whether or not to clear the console before running" do
51
+ Kicker::Options.parse([])
52
+ Kicker.should.not.clear_console
53
+
54
+ Kicker::Options.parse(%w{ --clear })
55
+ Kicker.should.clear_console
56
+ end
57
+
50
58
  it "should parse the Growl command to use when the user clicks the Growl succeeded message" do
51
59
  Kicker::Options.parse(%w{ --growl-command ls })
52
60
  Kicker::Growl.command.should == 'ls'
@@ -65,4 +73,4 @@ describe "Kicker::Options.parse" do
65
73
  Kicker::Recipes.expects(:recipe).with('jstest')
66
74
  Kicker::Options.parse(%w{ -r rails --recipe jstest })
67
75
  end
68
- end
76
+ end
@@ -1,6 +1,10 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
 
3
- Kicker::Utils.send(:public, :did_execute_command)
3
+ class Kicker
4
+ module Utils
5
+ public :will_execute_command, :did_execute_command
6
+ end
7
+ end
4
8
 
5
9
  describe "A Kicker instance, concerning its utility methods" do
6
10
  before do
@@ -93,6 +97,17 @@ describe "A Kicker instance, concerning its utility methods" do
93
97
  utils.did_execute_command(status)
94
98
  end
95
99
 
100
+ it "should clear the console before running a command" do
101
+ Kicker.clear_console = true
102
+ utils.expects(:puts).with("\e[H\e[2J")
103
+
104
+ Kicker::Growl.stubs(:change_occured)
105
+ status = Kicker::LogStatusHelper.new(nil, 'ls -l')
106
+ status.result("line 1\nline 2", false, 123)
107
+
108
+ utils.will_execute_command(status)
109
+ end
110
+
96
111
  it "should store the last executed command" do
97
112
  Kicker::Growl.use = false
98
113
  utils.stubs(:log)
@@ -101,7 +116,7 @@ describe "A Kicker instance, concerning its utility methods" do
101
116
  utils.last_command.should == 'date'
102
117
  end
103
118
 
104
- it "should call the block given to execute when and yield the log status helper with status success" do
119
+ it "should call the block given to execute and yield the log status helper with status success" do
105
120
  Kicker.silent = true
106
121
  Kicker::Growl.use = false
107
122
  utils.stubs(:last_command_succeeded?).returns(true)
@@ -122,7 +137,7 @@ describe "A Kicker instance, concerning its utility methods" do
122
137
  end
123
138
  end
124
139
 
125
- it "should call the block given to execute when and yield the log status helper with status failed" do
140
+ it "should call the block given to execute and yield the log status helper with status failed" do
126
141
  Kicker.silent = true
127
142
  Kicker::Growl.use = false
128
143
  utils.stubs(:last_command_succeeded?).returns(false)
@@ -175,4 +190,4 @@ describe "Kernel utility methods" do
175
190
  def utils
176
191
  Kicker::Utils
177
192
  end
178
- end
193
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-11 00:00:00 +01:00
12
+ date: 2010-07-27 00:00:00 +02:00
13
13
  default_executable: kicker
14
14
  dependencies: []
15
15