at-random 1.0.0 → 1.1.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.
@@ -13,12 +13,12 @@ module AtRandom
13
13
  raise InvalidTime, "Timespec #{timespec} is earlier than now"
14
14
  end
15
15
 
16
- @exec_args = ['at', timespec, args].flatten
16
+ @exec_args = ['at', args, timespec].flatten
17
17
  end
18
18
  end
19
19
 
20
20
  def exec
21
- Process.exec(*@exec_args)
21
+ Kernel.exec(*@exec_args)
22
22
  end
23
23
  end
24
24
  end
@@ -28,7 +28,7 @@ module AtRandom
28
28
 
29
29
  private
30
30
  def parse_time(time_s)
31
- time_s.split(':').map(&:to_i)
31
+ time_s.split(':').map {|s| s.to_i }
32
32
  end
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module AtRandom
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -6,7 +6,7 @@ describe AtRandom::AtCmd do
6
6
  let!(:frozen_now) { Time.local(2015, 05, 25) }
7
7
  before do
8
8
  Time.stubs(:now).returns(frozen_now)
9
- Process.stubs(:exec)
9
+ Kernel.stubs(:exec)
10
10
  end
11
11
 
12
12
  let(:timespec) { '12:30' }
@@ -61,7 +61,7 @@ describe AtRandom::AtCmd do
61
61
  subject { at_with_args.exec }
62
62
 
63
63
  it 'execs `at`' do
64
- Process.expects(:exec).with('at', any_parameters)
64
+ Kernel.expects(:exec).with('at', any_parameters)
65
65
  subject
66
66
  end
67
67
 
@@ -69,14 +69,14 @@ describe AtRandom::AtCmd do
69
69
  let(:at_args) { ['-f', 'foo'] }
70
70
 
71
71
  it 'passes arguments to `at`' do
72
- Process.expects(:exec).with('at', anything, '-f', 'foo')
72
+ Kernel.expects(:exec).with('at', '-f', 'foo', anything)
73
73
  subject
74
74
  end
75
75
  end
76
76
 
77
77
  describe '`at` timespec' do
78
- it 'is the first argument to AtCmd.new' do
79
- Process.expects(:exec).with('at', timespec, any_parameters)
78
+ it 'is the last argument to AtCmd.new' do
79
+ Kernel.expects(:exec).with('at', timespec)
80
80
  subject
81
81
  end
82
82
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: at-random
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: