ruby-clock 0.8.0.rc2 → 0.8.0.rc3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +0 -6
- data/README.md +9 -6
- data/example-app/Clockfile +8 -0
- data/example-app/Gemfile +2 -0
- data/example-app/Gemfile.lock +1 -7
- data/lib/ruby-clock/version.rb +1 -1
- data/lib/ruby-clock.rb +34 -1
- data/release.md +1 -0
- data/ruby-clock.gemspec +0 -2
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8d972bb2c2468f53d943f233e4e799df71a449b6f7b8c00a1ddbea33c54c92
|
4
|
+
data.tar.gz: fc97259d0575bd220f79dd25206128001eece56ec51eda06d95f28d718b65080
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dcf79cbebb137a9f04e920b8d6ff0f910bd61536e3e666297217aef8d9942c656fca0d67d794c753ab42a9e035be364bcf3d3b6e465058ebfe7e8683fa94fea
|
7
|
+
data.tar.gz: a3ca20e788af53d77d5526aaacb3b7ff4b07e8852e7586fe181e1681985b32b5bce3a9f0a305507be335dfeee7399567a6cd31afe8262b6e0b84db9cd2d9a75a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,14 +3,11 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
ruby-clock (0.8.0.rc2)
|
5
5
|
method_source
|
6
|
-
posix-spawn (~> 0.3.15)
|
7
6
|
rufus-scheduler (~> 3.8)
|
8
|
-
terrapin (~> 0.6)
|
9
7
|
|
10
8
|
GEM
|
11
9
|
remote: https://rubygems.org/
|
12
10
|
specs:
|
13
|
-
climate_control (0.2.0)
|
14
11
|
concurrent-ruby (1.1.9)
|
15
12
|
et-orbi (1.2.5)
|
16
13
|
tzinfo
|
@@ -18,13 +15,10 @@ GEM
|
|
18
15
|
et-orbi (~> 1.1, >= 1.1.8)
|
19
16
|
raabro (~> 1.4)
|
20
17
|
method_source (1.0.0)
|
21
|
-
posix-spawn (0.3.15)
|
22
18
|
raabro (1.4.0)
|
23
19
|
rake (12.3.3)
|
24
20
|
rufus-scheduler (3.8.0)
|
25
21
|
fugit (~> 1.1, >= 1.1.6)
|
26
|
-
terrapin (0.6.0)
|
27
|
-
climate_control (>= 0.0.3, < 1.0)
|
28
22
|
tzinfo (2.0.4)
|
29
23
|
concurrent-ruby (~> 1.0)
|
30
24
|
|
data/README.md
CHANGED
@@ -138,9 +138,7 @@ to learn how to do this. Where the documentation references `s`, you should use
|
|
138
138
|
|
139
139
|
### Shell commands
|
140
140
|
|
141
|
-
You can run shell commands in your jobs.
|
142
|
-
[posix-spawn](https://github.com/rtomayko/posix-spawn), which means
|
143
|
-
the ruby process is not forked.
|
141
|
+
You can run shell commands in your jobs.
|
144
142
|
|
145
143
|
```ruby
|
146
144
|
schedule.every '1 day' do
|
@@ -148,9 +146,14 @@ schedule.every '1 day' do
|
|
148
146
|
end
|
149
147
|
```
|
150
148
|
|
151
|
-
|
152
|
-
[
|
153
|
-
|
149
|
+
By default they will be run with
|
150
|
+
[ruby backticks](https://livebook.manning.com/concept/ruby/backtick).
|
151
|
+
For better performance, install the [terrapin](https://github.com/thoughtbot/terrapin)
|
152
|
+
and [posix-spawn](https://github.com/rtomayko/posix-spawn) gems.
|
153
|
+
|
154
|
+
`shell` is a convenience method which just passes the string on.
|
155
|
+
If you want to use other terrapin features, you can skip the `shell` command
|
156
|
+
and use terrapin directly:
|
154
157
|
|
155
158
|
```ruby
|
156
159
|
schedule.every '1 day' do
|
data/example-app/Clockfile
CHANGED
data/example-app/Gemfile
CHANGED
data/example-app/Gemfile.lock
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
ruby-clock (0.8.0.
|
4
|
+
ruby-clock (0.8.0.rc2)
|
5
5
|
method_source
|
6
|
-
posix-spawn (~> 0.3.15)
|
7
6
|
rufus-scheduler (~> 3.8)
|
8
|
-
terrapin (~> 0.6)
|
9
7
|
|
10
8
|
GEM
|
11
9
|
remote: https://rubygems.org/
|
12
10
|
specs:
|
13
|
-
climate_control (0.2.0)
|
14
11
|
concurrent-ruby (1.1.9)
|
15
12
|
et-orbi (1.2.5)
|
16
13
|
tzinfo
|
@@ -18,12 +15,9 @@ GEM
|
|
18
15
|
et-orbi (~> 1.1, >= 1.1.8)
|
19
16
|
raabro (~> 1.4)
|
20
17
|
method_source (1.0.0)
|
21
|
-
posix-spawn (0.3.15)
|
22
18
|
raabro (1.4.0)
|
23
19
|
rufus-scheduler (3.8.0)
|
24
20
|
fugit (~> 1.1, >= 1.1.6)
|
25
|
-
terrapin (0.6.0)
|
26
|
-
climate_control (>= 0.0.3, < 1.0)
|
27
21
|
tzinfo (2.0.4)
|
28
22
|
concurrent-ruby (~> 1.0)
|
29
23
|
|
data/lib/ruby-clock/version.rb
CHANGED
data/lib/ruby-clock.rb
CHANGED
@@ -69,8 +69,41 @@ module RubyClock
|
|
69
69
|
@rake_mutex.synchronize { rake_async(task) }
|
70
70
|
end
|
71
71
|
|
72
|
+
def shell_runner
|
73
|
+
@shell_runner ||= begin
|
74
|
+
require 'terrapin'
|
75
|
+
require 'posix-spawn'
|
76
|
+
|
77
|
+
unless Terrapin::CommandLine.runner.class == Terrapin::CommandLine::PosixRunner
|
78
|
+
puts <<~MESSAGE
|
79
|
+
|
80
|
+
🤷 terrapin and posix-spawn are installed, but for some reason terrapin is
|
81
|
+
not using posix-spawn as its runner.
|
82
|
+
|
83
|
+
MESSAGE
|
84
|
+
end
|
85
|
+
|
86
|
+
puts '🐆 Using terrapin for shell commands.'
|
87
|
+
:terrapin
|
88
|
+
rescue LoadError
|
89
|
+
puts <<~MESSAGE
|
90
|
+
|
91
|
+
🦥 Using ruby backticks for shell commands.
|
92
|
+
For better performance, install the terrapin and posix-spawn gems.
|
93
|
+
See README.md for more info.
|
94
|
+
|
95
|
+
MESSAGE
|
96
|
+
:backticks
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
72
100
|
def shell(command)
|
73
|
-
|
101
|
+
case shell_runner
|
102
|
+
when :terrapin
|
103
|
+
Terrapin::CommandLine.new(command).run
|
104
|
+
when :backticks
|
105
|
+
`#{command}`
|
106
|
+
end
|
74
107
|
end
|
75
108
|
|
76
109
|
end
|
data/release.md
CHANGED
data/ruby-clock.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-clock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.0.
|
4
|
+
version: 0.8.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bachir
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rufus-scheduler
|
@@ -38,34 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: terrapin
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.6'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.6'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: posix-spawn
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.3.15
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.3.15
|
69
41
|
description:
|
70
42
|
email:
|
71
43
|
- j@jjb.cc
|