ct 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 +7 -0
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/bin/ct +31 -0
- data/ct.gemspec +20 -0
- data/lib/version.rb +3 -0
- metadata +51 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dacf8596cf9425869358fe8bf12d7b77d4b83542
|
4
|
+
data.tar.gz: 701da3a3340bd0776e7b43753f5b2c298649cdfa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca75f160576ef3f0bf04167b2a9b38346297a449b369fb087046f006fb3b07b18cb10beabddd585cd4be716f93b73cf33cee67b14080271509460f3e39d9ed48
|
7
|
+
data.tar.gz: 90ede1ad08b3c4b346c0f8c6fb4d3af43f75754bf3c1312aad836a789dd5f6c62f42142657c4a5ccd6f248d77d383112afa71cab640443536c84f816f5055cb2
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# CT
|
data/bin/ct
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
|
5
|
+
require 'version'
|
6
|
+
require 'optparse'
|
7
|
+
require 'date'
|
8
|
+
|
9
|
+
def formatWithZone(zone)
|
10
|
+
return "%Y-%m-%d %H:%M:%S #{zone.gsub(':','')}"
|
11
|
+
end
|
12
|
+
|
13
|
+
opt = OptionParser.new
|
14
|
+
opt.version = CT::VERSION
|
15
|
+
|
16
|
+
argv = opt.parse!(ARGV)
|
17
|
+
|
18
|
+
a = argv[0]
|
19
|
+
|
20
|
+
if a.nil?
|
21
|
+
puts Time.now
|
22
|
+
else
|
23
|
+
localHour = a.downcase
|
24
|
+
now = DateTime.now
|
25
|
+
time = DateTime.new(now.year, now.month, now.day, localHour.to_i, now.min, now.sec)
|
26
|
+
strTime = time.strftime(formatWithZone(now.zone))
|
27
|
+
localTime = DateTime.parse(strTime)
|
28
|
+
utcTime = localTime.new_offset(Rational(0, 24))
|
29
|
+
puts localTime.strftime(formatWithZone(localTime.zone))
|
30
|
+
puts utcTime.strftime(formatWithZone(utcTime.zone))
|
31
|
+
end
|
data/ct.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.expand_path('../lib/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.authors = ["Dongri Jin"]
|
5
|
+
gem.email = ["dongriat@gmail.com"]
|
6
|
+
gem.description = %q{Cron UTC Time.}
|
7
|
+
gem.summary = %q{Cron UTC Time.}
|
8
|
+
gem.homepage = "https://github.com/dongri/ct"
|
9
|
+
gem.files = `git ls-files`.split($\)
|
10
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
11
|
+
gem.name = "ct"
|
12
|
+
gem.version = CT::VERSION
|
13
|
+
gem.date = %q{2014-11-24}
|
14
|
+
gem.rdoc_options = ["--charset=UTF-8"]
|
15
|
+
gem.bindir = "bin"
|
16
|
+
gem.required_ruby_version = '>= 1.9.0'
|
17
|
+
gem.extra_rdoc_files = [
|
18
|
+
"README.md"
|
19
|
+
]
|
20
|
+
end
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ct
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dongri Jin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Cron UTC Time.
|
14
|
+
email:
|
15
|
+
- dongriat@gmail.com
|
16
|
+
executables:
|
17
|
+
- ct
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files:
|
20
|
+
- README.md
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- README.md
|
24
|
+
- bin/ct
|
25
|
+
- ct.gemspec
|
26
|
+
- lib/version.rb
|
27
|
+
homepage: https://github.com/dongri/ct
|
28
|
+
licenses: []
|
29
|
+
metadata: {}
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options:
|
32
|
+
- --charset=UTF-8
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.9.0
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.0.14
|
48
|
+
signing_key:
|
49
|
+
specification_version: 4
|
50
|
+
summary: Cron UTC Time.
|
51
|
+
test_files: []
|