one_inch_punch 0.4.0 → 0.4.1
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/History.txt +6 -0
- data/bin/punch +3 -3
- data/lib/punch/version.rb +1 -1
- data/spec/punch_command_spec.rb +20 -1
- metadata +2 -2
data/History.txt
CHANGED
data/bin/punch
CHANGED
@@ -30,9 +30,9 @@ BANNER
|
|
30
30
|
opts.on('--before [TIME]', String,
|
31
31
|
"Restrict command to only before the given time") { |time| OPTIONS[:before] = Time.parse(time) }
|
32
32
|
opts.on('--at [TIME]', '--time [TIME]', String,
|
33
|
-
"Use the given time
|
33
|
+
"Use the given time") { |time| OPTIONS[:time] = Time.parse(time) }
|
34
34
|
opts.on('-m', '--message [MESSAGE]', String,
|
35
|
-
"
|
35
|
+
"Use the given log message") { |message| OPTIONS[:message] = message }
|
36
36
|
opts.on('--full',
|
37
37
|
"Show full output for the command") { |full| OPTIONS[:full] = true }
|
38
38
|
opts.on('--short',
|
@@ -104,7 +104,7 @@ commands = {
|
|
104
104
|
end,
|
105
105
|
'log' => lambda do |project|
|
106
106
|
if project
|
107
|
-
if message = ARGV[2]
|
107
|
+
if message = OPTIONS.delete(:message) || ARGV[2]
|
108
108
|
if Punch.log(project, message, OPTIONS)
|
109
109
|
Punch.write
|
110
110
|
else
|
data/lib/punch/version.rb
CHANGED
data/spec/punch_command_spec.rb
CHANGED
@@ -535,6 +535,25 @@ describe 'punch command' do
|
|
535
535
|
run_command('log', @project, @message)
|
536
536
|
end
|
537
537
|
|
538
|
+
it 'should accept a message specified with --message' do
|
539
|
+
Punch.stub!(:write)
|
540
|
+
Punch.should.receive(:log).with(@project, @message, {})
|
541
|
+
run_command('log', @project, '--message', @message)
|
542
|
+
end
|
543
|
+
|
544
|
+
it 'should accept a message specified with -m' do
|
545
|
+
Punch.stub!(:write)
|
546
|
+
Punch.should.receive(:log).with(@project, @message, {})
|
547
|
+
run_command('log', @project, '-m', @message)
|
548
|
+
end
|
549
|
+
|
550
|
+
it 'should use the message option specified with --message over the command-line argument' do
|
551
|
+
other_message = 'some other message'
|
552
|
+
Punch.stub!(:write)
|
553
|
+
Punch.should.receive(:log).with(@project, other_message, {})
|
554
|
+
run_command('log', @project, @message, '-m', other_message)
|
555
|
+
end
|
556
|
+
|
538
557
|
it 'should pass a time if specified on the command line (with --time)' do
|
539
558
|
time_option = '2008-08-23 15:39'
|
540
559
|
time = Time.local(2008, 8, 23, 15, 39)
|
@@ -822,7 +841,7 @@ describe 'punch command' do
|
|
822
841
|
end
|
823
842
|
|
824
843
|
it 'should not run any punch command' do
|
825
|
-
[:in, :out, :delete, :status, :total, :log, :list].each do |command|
|
844
|
+
[:in, :out, :delete, :status, :total, :log, :list, :summary].each do |command|
|
826
845
|
Punch.should.receive(command).never
|
827
846
|
end
|
828
847
|
run_command('bunk')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: one_inch_punch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yossef Mendelssohn
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-26 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|