time-zone 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/time/zone/timestamp.rb +2 -0
- data/lib/time/zone/version.rb +1 -1
- metadata +18 -27
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -28
- data/Gemfile +0 -15
- data/README.md +0 -96
- data/Rakefile +0 -14
- data/bug14879.rb +0 -13
- data/time-zone.gemspec +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf6bc5cc4a6368caaf67d7ed914f486b36476604fcfd60b9724c0ba94f7d0da
|
4
|
+
data.tar.gz: 237845896fd9225288162f8997764a55d4e9a5e2e52590d216a7c8c5c8aff09e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3787903d9097e9d17577db819af7cde6cf5785f4b3c27f7bd0e448991bc0e0827ec34152ed9fc4c600565bf65a1d586f7fc517e7ae36d84d5b8b519841b116e4
|
7
|
+
data.tar.gz: 3ed87cfdeac630a3b24a2f6c3915a8b21036d4c6e0868ee753adb9ade5f6d7cddab7c970caa40469eb988c2c79e480e3d44af106a672cd7954319ff9373f6fd9
|
data/lib/time/zone/timestamp.rb
CHANGED
data/lib/time/zone/version.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time-zone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bake-bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- samuel.williams@oriontransfer.co.nz
|
@@ -59,18 +59,10 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- ".gitignore"
|
63
|
-
- ".rspec"
|
64
|
-
- ".travis.yml"
|
65
|
-
- Gemfile
|
66
|
-
- README.md
|
67
|
-
- Rakefile
|
68
|
-
- bug14879.rb
|
69
62
|
- lib/time/zone.rb
|
70
63
|
- lib/time/zone/locking.rb
|
71
64
|
- lib/time/zone/timestamp.rb
|
72
65
|
- lib/time/zone/version.rb
|
73
|
-
- time-zone.gemspec
|
74
66
|
homepage: https://github.com/ioquatix/time-zone
|
75
67
|
licenses: []
|
76
68
|
metadata: {}
|
@@ -89,9 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
81
|
- !ruby/object:Gem::Version
|
90
82
|
version: '0'
|
91
83
|
requirements: []
|
92
|
-
|
93
|
-
rubygems_version: 2.7.6
|
84
|
+
rubygems_version: 3.1.2
|
94
85
|
signing_key:
|
95
86
|
specification_version: 4
|
96
|
-
summary:
|
87
|
+
summary: Computes timezones using the system TZ environment variable.
|
97
88
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Setup the environment:
|
2
|
-
language: ruby
|
3
|
-
dist: xenial
|
4
|
-
cache: bundler
|
5
|
-
|
6
|
-
before_script:
|
7
|
-
- gem update --system
|
8
|
-
- gem install bundler
|
9
|
-
|
10
|
-
rvm:
|
11
|
-
- 2.1
|
12
|
-
- 2.2
|
13
|
-
- 2.3
|
14
|
-
- 2.4
|
15
|
-
- 2.5
|
16
|
-
- 2.6
|
17
|
-
- jruby-head
|
18
|
-
- ruby-head
|
19
|
-
|
20
|
-
env:
|
21
|
-
- TZ=UTC
|
22
|
-
- TZ=Pacific/Auckland
|
23
|
-
|
24
|
-
# Setup the compilers:
|
25
|
-
matrix:
|
26
|
-
allow_failures:
|
27
|
-
- rvm: ruby-head
|
28
|
-
- rvm: jruby-head
|
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in time-zone.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
group :development do
|
9
|
-
gem 'pry'
|
10
|
-
end
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem 'simplecov'
|
14
|
-
gem 'coveralls', require: false
|
15
|
-
end
|
data/README.md
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
# Time::Zone
|
2
|
-
|
3
|
-
A very simple time-zone library which works by manipulating the `TZ` environment variable.
|
4
|
-
|
5
|
-
[![Build Status](https://secure.travis-ci.org/ioquatix/time-zone.svg)](http://travis-ci.org/ioquatix/time-zone)
|
6
|
-
[![Code Climate](https://codeclimate.com/github/ioquatix/time-zone.svg)](https://codeclimate.com/github/ioquatix/time-zone)
|
7
|
-
[![Coverage Status](https://coveralls.io/repos/ioquatix/time-zone/badge.svg)](https://coveralls.io/r/ioquatix/time-zone)
|
8
|
-
|
9
|
-
## Motivation
|
10
|
-
|
11
|
-
`tzinfo` has an antiquated view of `Time`. It returns local time values with a UTC time zone which is pretty much wrong.
|
12
|
-
|
13
|
-
[![A brief history of Time.new](https://img.youtube.com/vi/UjdtH5gO_DQ/0.jpg)](https://www.youtube.com/watch?v=UjdtH5gO_DQ)
|
14
|
-
|
15
|
-
## Installation
|
16
|
-
|
17
|
-
Add this line to your application's Gemfile:
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
gem 'time-zone'
|
21
|
-
```
|
22
|
-
|
23
|
-
And then execute:
|
24
|
-
|
25
|
-
$ bundle
|
26
|
-
|
27
|
-
Or install it yourself as:
|
28
|
-
|
29
|
-
$ gem install time-zone
|
30
|
-
|
31
|
-
## Usage
|
32
|
-
|
33
|
-
There are two basic use cases, getting the current time, and converting times.
|
34
|
-
|
35
|
-
### Current Time
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
Time::Zone.now("Pacific/Auckland")
|
39
|
-
=> 2018-05-25 14:09:40 +1200
|
40
|
-
```
|
41
|
-
|
42
|
-
### Convert Time
|
43
|
-
|
44
|
-
```ruby
|
45
|
-
Time::Zone.convert(Time.now.utc, "Pacific/Auckland")
|
46
|
-
=> 2018-05-25 14:14:22 +1200
|
47
|
-
```
|
48
|
-
|
49
|
-
### Multiple Operations
|
50
|
-
|
51
|
-
```ruby
|
52
|
-
Time::Zone.with("US/Pacific") do
|
53
|
-
# Be aware that in some cases Time values are lazy initialized, so you need to use #localtime to force them to evaluate and use the current `TZ`.
|
54
|
-
time = Time.new.localtime
|
55
|
-
puts time.inspect
|
56
|
-
# => 2018-05-24 20:32:29 -0700
|
57
|
-
end
|
58
|
-
```
|
59
|
-
|
60
|
-
### Caveats
|
61
|
-
|
62
|
-
This implementation manipulates the per-process `TZ` environment variable. This means that if you don't put locking around all your usage of `localtime`, you may end up with strange results (i.e. in a timezone other than the system specified `TZ`). In the future, this requirement may go away.
|
63
|
-
|
64
|
-
This library is unlikely to work on Windows because it doesn't correctly handle changes to `TZ`.
|
65
|
-
|
66
|
-
## Contributing
|
67
|
-
|
68
|
-
1. Fork it
|
69
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
-
5. Create new Pull Request
|
73
|
-
|
74
|
-
## License
|
75
|
-
|
76
|
-
Released under the MIT license.
|
77
|
-
|
78
|
-
Copyright, 2012, 2014, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
79
|
-
|
80
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
81
|
-
of this software and associated documentation files (the "Software"), to deal
|
82
|
-
in the Software without restriction, including without limitation the rights
|
83
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
84
|
-
copies of the Software, and to permit persons to whom the Software is
|
85
|
-
furnished to do so, subject to the following conditions:
|
86
|
-
|
87
|
-
The above copyright notice and this permission notice shall be included in
|
88
|
-
all copies or substantial portions of the Software.
|
89
|
-
|
90
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
91
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
92
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
93
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
94
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
95
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
96
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task :default => :spec
|
7
|
-
|
8
|
-
task :console do
|
9
|
-
require 'pry'
|
10
|
-
require_relative 'lib/time/zone'
|
11
|
-
require_relative 'lib/time/zone/timestamp'
|
12
|
-
|
13
|
-
Pry.start
|
14
|
-
end
|
data/bug14879.rb
DELETED
data/time-zone.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative "lib/time/zone/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |spec|
|
5
|
-
spec.name = "time-zone"
|
6
|
-
spec.version = Time::Zone::VERSION
|
7
|
-
spec.authors = ["Samuel Williams"]
|
8
|
-
spec.email = ["samuel.williams@oriontransfer.co.nz"]
|
9
|
-
|
10
|
-
spec.summary = "Use the system `date` command to compute time zones."
|
11
|
-
spec.homepage = "https://github.com/ioquatix/time-zone"
|
12
|
-
|
13
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
14
|
-
f.match(%r{^(test|spec|features)/})
|
15
|
-
end
|
16
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
-
spec.require_paths = ["lib"]
|
18
|
-
|
19
|
-
spec.add_development_dependency "bundler", "~> 1.16"
|
20
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
21
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
22
|
-
end
|