att 0.0.0 → 0.0.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.
- checksums.yaml +4 -4
- data/bin/att +7 -0
- data/lib/att.rb +18 -3
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5261c6f8109b26f411db3ef8186c9e86e96154d3
|
4
|
+
data.tar.gz: 9d013ef4d54734d2311458355c714e1991746d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59186b240439c4f18b43bf09073be0f6b5499650afd4c96b712f0f660a7885a5741b328341f717364f4ead31c8b7b1a86891c70a4b93519cb628630d4afb0b19
|
7
|
+
data.tar.gz: ca1868535dad4564bbdd8d13be9990f8d8ae54a045917f1fd3198efd844329ae8d4931140ed505ab9b7e7bb22bcc3e257eba599e0a6a447d13c4d5b7bcb85603
|
data/bin/att
ADDED
data/lib/att.rb
CHANGED
@@ -1,5 +1,20 @@
|
|
1
|
+
require 'chronic'
|
2
|
+
|
1
3
|
class Att
|
2
|
-
def self.
|
3
|
-
|
4
|
+
def self.new_task(scheduled_time, command)
|
5
|
+
frozen_scheduled_time = Chronic.parse(scheduled_time)
|
6
|
+
while true do
|
7
|
+
puts "scheduled time is #{frozen_scheduled_time}"
|
8
|
+
puts "current time is #{Time.now}"
|
9
|
+
# binding.pry
|
10
|
+
if Time.now >= frozen_scheduled_time
|
11
|
+
puts "about to execute command '#{command}'"
|
12
|
+
output = `#{command}`
|
13
|
+
STDOUT.puts output
|
14
|
+
break
|
15
|
+
end
|
16
|
+
sleep(5)
|
17
|
+
STDOUT.puts "sleeping for 5 seconds..."
|
18
|
+
end
|
4
19
|
end
|
5
|
-
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: att
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Liu
|
@@ -9,13 +9,29 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-09-08 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: chronic
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.10.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.10.2
|
13
27
|
description: run terminal commands 'att' a specific time
|
14
28
|
email: yuningalexliu@gmail.com
|
15
|
-
executables:
|
29
|
+
executables:
|
30
|
+
- att
|
16
31
|
extensions: []
|
17
32
|
extra_rdoc_files: []
|
18
33
|
files:
|
34
|
+
- bin/att
|
19
35
|
- lib/att.rb
|
20
36
|
homepage: http://rubygems.org/gems/att
|
21
37
|
licenses:
|