sixarm_ruby_time_terse 1.1.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +6 -4
- data/lib/sixarm_ruby_time_terse.rb +1 -31
- data/lib/sixarm_ruby_time_terse/time.rb +38 -0
- data/test/sixarm_ruby_time_terse_test.rb +9 -20
- data/test/sixarm_ruby_time_terse_test/time_test.rb +18 -0
- metadata +135 -42
- metadata.gz.sig +0 -0
- data/.gemtest +0 -0
- data/README.md +0 -83
- data/VERSION +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7103af532506f5b1d40c3b78e8a5bbf270d8ffac
|
4
|
+
data.tar.gz: 6d9cd86980b35c5e75f2595870ef74049e86c294
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5bc21c2d617adc286736caf1458052b516e403ceb31559afe31bf6f7efc142d95c2da0f8cf7ef172777ab37355cd3aa302c21f0c5b2c62a38828769e0790b8e9
|
7
|
+
data.tar.gz: eafa273c48cd2112a6a24cefa9657d2f29353a5430642cd1d3b83345b589e4c7aff24703c737d3d600f8045e2aa3026d081e9566ed98e685a35b72f60733eab2
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "rake"
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs
|
7
|
-
t.pattern =
|
6
|
+
t.libs.push("lib", "test")
|
7
|
+
t.pattern = "test/**/*.rb"
|
8
8
|
end
|
9
|
+
|
10
|
+
task :default => [:test]
|
@@ -3,34 +3,4 @@
|
|
3
3
|
Please see README
|
4
4
|
=end
|
5
5
|
|
6
|
-
|
7
|
-
class Time
|
8
|
-
|
9
|
-
|
10
|
-
# @return [String] time packed into a short string: "YYYYMMDDHHMMSS"
|
11
|
-
#
|
12
|
-
# The time is converted to UTC.
|
13
|
-
#
|
14
|
-
# @example
|
15
|
-
# Time.now.terse
|
16
|
-
# => "20101231125959"
|
17
|
-
|
18
|
-
def terse
|
19
|
-
getutc.strftime('%Y%m%d%H%M%S')
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
# Shorthand for Time.now.terse
|
24
|
-
#
|
25
|
-
# @example
|
26
|
-
# Time.terse
|
27
|
-
# => "20101231125959"
|
28
|
-
#
|
29
|
-
# @return [String] Time.now.terse
|
30
|
-
|
31
|
-
def self.terse
|
32
|
-
now.terse
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
end
|
6
|
+
require_relative "sixarm_ruby_time_terse/time.rb"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin rdoc
|
3
|
+
Time class extensions.
|
4
|
+
=end
|
5
|
+
|
6
|
+
class Time
|
7
|
+
|
8
|
+
# The time, in UTC, using a terse format "YYYYMMDDHHMMSS".
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
#
|
12
|
+
# Time.now.terse
|
13
|
+
# => "20151231125959"
|
14
|
+
#
|
15
|
+
# Return:
|
16
|
+
#
|
17
|
+
# * [String] time formatted as "YYYYMMDDHHMMSS"
|
18
|
+
#
|
19
|
+
def terse
|
20
|
+
getutc.strftime('%Y%m%d%H%M%S')
|
21
|
+
end
|
22
|
+
|
23
|
+
# The time now, in UTC, using a terse format "YYYYMMDDHHMMSS".
|
24
|
+
#
|
25
|
+
# Example:
|
26
|
+
#
|
27
|
+
# Time.terse
|
28
|
+
# => "20151231125959"
|
29
|
+
#
|
30
|
+
# Return:
|
31
|
+
#
|
32
|
+
# * [String] Time.now formatted as "YYYYMMDDHHMMSS"
|
33
|
+
#
|
34
|
+
def self.terse
|
35
|
+
now.terse
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -1,22 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "coveralls"
|
4
|
+
require "simplecov"
|
5
|
+
Coveralls.wear!
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
8
|
+
Coveralls::SimpleCov::Formatter
|
9
|
+
]
|
4
10
|
SimpleCov.start
|
5
|
-
require
|
6
|
-
|
7
|
-
describe Time do
|
8
|
-
|
9
|
-
describe "#terse" do
|
10
|
-
|
11
|
-
it "with class method" do
|
12
|
-
Time.terse.must_match /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/
|
13
|
-
end
|
14
|
-
|
15
|
-
it "with instance method" do
|
16
|
-
Time.now.terse.must_match /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
11
|
+
require "sixarm_ruby_time_terse"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "sixarm_ruby_time_terse_test"
|
3
|
+
|
4
|
+
describe Time do
|
5
|
+
|
6
|
+
describe "#terse" do
|
7
|
+
|
8
|
+
it "with class method" do
|
9
|
+
Time.terse.must_match /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/
|
10
|
+
end
|
11
|
+
|
12
|
+
it "with instance method" do
|
13
|
+
Time.now.terse.must_match /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,78 +1,171 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_time_terse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- SixArm
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain:
|
12
|
-
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIGCTCCA/GgAwIBAgIJAK3igyLv2hNNMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
|
14
|
+
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
|
15
|
+
c2NvMQ8wDQYDVQQKEwZTaXhBcm0xEzARBgNVBAMTCnNpeGFybS5jb20wHhcNMTUw
|
16
|
+
MzE0MjA0MTE5WhcNMTcxMjA4MjA0MTE5WjBgMQswCQYDVQQGEwJVUzETMBEGA1UE
|
17
|
+
CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEPMA0GA1UEChMG
|
18
|
+
U2l4QXJtMRMwEQYDVQQDEwpzaXhhcm0uY29tMIICIjANBgkqhkiG9w0BAQEFAAOC
|
19
|
+
Ag8AMIICCgKCAgEA4et7SlePzuE46eK5BAVVGg+yWt6FkX7xcLt3Uun9RntKPSuR
|
20
|
+
TbS/+KBqbja5reZD64hdQ9npxpQPKafxUm+RlCd9F5KFxwi8G9usKzCTPOwUeDI2
|
21
|
+
TNEfC+1eRU19QuEW58ZC0pC/bx5Zmp6/DTD6VV+qxKEE9U1M5P85LNkwnxqmRIMR
|
22
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IvhZaAnra/1JPZItoge64GS+lM
|
37
|
+
PJJbVrtSati++s39wnss1QlMy9TXoesmR8vqsOU0XdCnK5hOun5RA8SYDWLffsfG
|
38
|
+
E3hvCg4C5viEkPY0YdC0KMSqs5kIA2nCUiqpkwIOa36rVEwiKiU7OCfE3u3baDpL
|
39
|
+
FlfMBznZKOdxDFAmNaxvXBe2XeTzrZPvJtnNLWL6K4LaBHhq3bBdh1Hge0iMkpQ7
|
40
|
+
RTIGlfhlIFkMV3wT0LTsNznUPsoo6e+IW/tDrk23mrNRY6QynTETb+QVIevuzD9m
|
41
|
+
Drcxp/zlVhud+a0ezdnyNvF520arJWvqA4GrOo8F+TT2vVrjscgYjiVGdSq+8wQv
|
42
|
+
Efa5jhe8QwG7R1rdpMMP5yBSAqWuFBczMveX5j4rp9Ifw5/XsZbgwcmdm26bjhzh
|
43
|
+
w2grAHIhvR9mztm6uXQlZhv1fu3P+RWHDSYhnZSCJSCdxPzQJ1mG5T5ahiL3HvCZ
|
44
|
+
2AC9FOGkybW6DJEFSFFMlNk0IILsa/gNp8ufGuTVLWF9FUUdMNK+TMbghnifT8/1
|
45
|
+
n+ES/gQPOnvmVkLDGw==
|
46
|
+
-----END CERTIFICATE-----
|
47
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
48
|
+
dependencies:
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: minitest
|
51
|
+
requirement: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.7.0
|
56
|
+
- - "<"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '6'
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 5.7.0
|
66
|
+
- - "<"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 10.4.2
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '11'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 10.4.2
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '11'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: simplecov
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.10.0
|
96
|
+
- - "<"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.10.0
|
106
|
+
- - "<"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '2'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: coveralls
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 0.8.2
|
116
|
+
- - "<"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.8.2
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '2'
|
129
|
+
description: Time.terse method to generate a string formatted with YYYYMMDDHHMMSS
|
41
130
|
email: sixarm@sixarm.com
|
42
131
|
executables: []
|
43
132
|
extensions: []
|
44
133
|
extra_rdoc_files: []
|
45
134
|
files:
|
46
|
-
- .gemtest
|
47
135
|
- Rakefile
|
48
|
-
- README.md
|
49
|
-
- VERSION
|
50
136
|
- lib/sixarm_ruby_time_terse.rb
|
137
|
+
- lib/sixarm_ruby_time_terse/time.rb
|
51
138
|
- test/sixarm_ruby_time_terse_test.rb
|
139
|
+
- test/sixarm_ruby_time_terse_test/time_test.rb
|
52
140
|
homepage: http://sixarm.com/
|
53
|
-
licenses:
|
141
|
+
licenses:
|
142
|
+
- BSD
|
143
|
+
- GPL
|
144
|
+
- MIT
|
145
|
+
- PAL
|
146
|
+
- Various
|
147
|
+
metadata: {}
|
54
148
|
post_install_message:
|
55
149
|
rdoc_options: []
|
56
150
|
require_paths:
|
57
151
|
- lib
|
58
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
153
|
requirements:
|
61
|
-
- -
|
154
|
+
- - ">="
|
62
155
|
- !ruby/object:Gem::Version
|
63
156
|
version: '0'
|
64
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
158
|
requirements:
|
67
|
-
- -
|
159
|
+
- - ">="
|
68
160
|
- !ruby/object:Gem::Version
|
69
161
|
version: '0'
|
70
162
|
requirements: []
|
71
163
|
rubyforge_project:
|
72
|
-
rubygems_version:
|
164
|
+
rubygems_version: 2.4.8
|
73
165
|
signing_key:
|
74
|
-
specification_version:
|
75
|
-
summary: SixArm.com » Ruby » Time.terse method
|
166
|
+
specification_version: 4
|
167
|
+
summary: SixArm.com » Ruby » Time.terse method
|
76
168
|
test_files:
|
77
169
|
- test/sixarm_ruby_time_terse_test.rb
|
170
|
+
- test/sixarm_ruby_time_terse_test/time_test.rb
|
78
171
|
has_rdoc: true
|
metadata.gz.sig
CHANGED
Binary file
|
data/.gemtest
DELETED
File without changes
|
data/README.md
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# SixArm.com » Ruby » <br> Time.terse method for ISO RFC date and time terse
|
2
|
-
|
3
|
-
* Docs: <http://sixarm.com/sixarm_ruby_time_terse/doc>
|
4
|
-
* Repo: <http://github.com/sixarm/sixarm_ruby_time_terse>
|
5
|
-
* Email: Joel Parker Henderson, <joel@sixarm.com>
|
6
|
-
|
7
|
-
|
8
|
-
## Introduction
|
9
|
-
|
10
|
-
Provides timestamp methods Time.terse and Time#terse
|
11
|
-
|
12
|
-
For docs go to <http://sixarm.com/sixarm_ruby_time_terse/doc>
|
13
|
-
|
14
|
-
Want to help? We're happy to get pull requests.
|
15
|
-
|
16
|
-
|
17
|
-
## Quickstart
|
18
|
-
|
19
|
-
Install:
|
20
|
-
|
21
|
-
gem install sixarm_ruby_time_terse
|
22
|
-
|
23
|
-
Bundler:
|
24
|
-
|
25
|
-
gem "sixarm_ruby_time_terse", "=1.1.0"
|
26
|
-
|
27
|
-
Require:
|
28
|
-
|
29
|
-
require "sixarm_ruby_time_terse"
|
30
|
-
|
31
|
-
|
32
|
-
## High Security (Optional)
|
33
|
-
|
34
|
-
To enable high security for all our gems:
|
35
|
-
|
36
|
-
wget http://sixarm.com/sixarm.pem
|
37
|
-
gem cert --add sixarm.pem
|
38
|
-
gem sources --add http://sixarm.com
|
39
|
-
|
40
|
-
To install with high security:
|
41
|
-
|
42
|
-
gem install sixarm_ruby_time_terse --test --trust-policy HighSecurity
|
43
|
-
|
44
|
-
|
45
|
-
## Examples
|
46
|
-
|
47
|
-
puts Time.terse #=> "20101231125959"
|
48
|
-
puts Time.now.terse #=> "20101231125959"
|
49
|
-
|
50
|
-
|
51
|
-
## Changes
|
52
|
-
|
53
|
-
* 2012-03-16 1.1.0 Upgrade for Ruby 1.9.3, minitest/spec, and improved docs.
|
54
|
-
* 2011-11-07 1.0.0 Copied from sixarm_ruby_ramp to this independent gem
|
55
|
-
|
56
|
-
|
57
|
-
## License
|
58
|
-
|
59
|
-
You may choose any of these open source licenses:
|
60
|
-
|
61
|
-
* Apache License
|
62
|
-
* BSD License
|
63
|
-
* CreativeCommons License, Non-commercial Share Alike
|
64
|
-
* GNU General Public License Version 2 (GPL 2)
|
65
|
-
* GNU Lesser General Public License (LGPL)
|
66
|
-
* MIT License
|
67
|
-
* Perl Artistic License
|
68
|
-
* Ruby License
|
69
|
-
|
70
|
-
The software is provided "as is", without warranty of any kind,
|
71
|
-
express or implied, including but not limited to the warranties of
|
72
|
-
merchantability, fitness for a particular purpose and noninfringement.
|
73
|
-
|
74
|
-
In no event shall the authors or copyright holders be liable for any
|
75
|
-
claim, damages or other liability, whether in an action of contract,
|
76
|
-
tort or otherwise, arising from, out of or in connection with the
|
77
|
-
software or the use or other dealings in the software.
|
78
|
-
|
79
|
-
This license is for the included software that is created by SixArm;
|
80
|
-
some of the included software may have its own licenses, copyrights,
|
81
|
-
authors, etc. and these do take precedence over the SixArm license.
|
82
|
-
|
83
|
-
Copyright (c) 2005-2013 Joel Parker Henderson
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.0
|