vagrant-timezone 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/README.md +4 -0
- data/lib/vagrant-timezone/config.rb +16 -1
- data/lib/vagrant-timezone/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f5e50694d3d8b0660f8948191821fbe71f9467d
|
4
|
+
data.tar.gz: 3cf304ddc2e8acef5a127dac46ebd91f70ca1654
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19d1dc0c714ae91508fa2019ff37675365978d5eea4a9f84ef026529f2ff8e7e62cbb16b929fc54b7c4b98ce1962c75d2bff3b44d2b1d079dcca3c900225fd96
|
7
|
+
data.tar.gz: 825960e499203d008277a5c1ec1fa5622c8691d833577c97fb156a4a1b0b07b9ff9d618563ee701559c118238430252a069c1f180e9d4f81c809286ac54e4f26
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 1.1.0 / 2015-10-01
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Add option (`config.timezone.value = :host`) to synchronize the guest timezone with the host ([GH-2][])
|
6
|
+
|
7
|
+
[GH-2]: https://github.com/tmatilai/vagrant-proxyconf/issues/2 "Issue 2"
|
8
|
+
|
1
9
|
# 1.0.0 / 2014-10-27
|
2
10
|
|
3
11
|
Features:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,10 @@ end
|
|
31
31
|
|
32
32
|
The value can be anything that the [tz database supports](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (the "TZ" column). For example "UTC" or "Europe/Helsinki".
|
33
33
|
|
34
|
+
### Matching the Host Timezone
|
35
|
+
|
36
|
+
If the special symbol `:host` is passed at the parameter (`config.timezone.value = :host`), the plugin will attempt to set the guest timezone offset to match the current offset of the host. Because of limitations in Ruby's ability to get the named timezone from the host, it will instead convert the host's timezone offset to a calculated offset from UTC. So for example, on the west coast of the USA the calculated timezone might be `Etc/GMT+8`. After a change in the host's timezone (including a change due to Daylight Savings Time taking effect), the next time the Vagrantfile is run the guest clock will be updated to match. Note that this functionality has only been tested with an OS X host and Linux guest.
|
37
|
+
|
34
38
|
## Compatibility
|
35
39
|
|
36
40
|
This plugin requires Vagrant 1.2 or newer ([downloads](https://www.vagrantup.com/downloads)).
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vagrant'
|
2
|
+
require 'time'
|
2
3
|
|
3
4
|
module VagrantPlugins
|
4
5
|
module TimeZone
|
@@ -6,7 +7,7 @@ module VagrantPlugins
|
|
6
7
|
#
|
7
8
|
# @!parse class Config < Vagrant::Plugin::V2::Config; end
|
8
9
|
class Config < Vagrant.plugin('2', :config)
|
9
|
-
|
10
|
+
attr_reader :value
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
super
|
@@ -14,6 +15,20 @@ module VagrantPlugins
|
|
14
15
|
@value = UNSET_VALUE
|
15
16
|
end
|
16
17
|
|
18
|
+
def value= value
|
19
|
+
if value == :host
|
20
|
+
# Get the offset of the current timezone of the host. Ruby doesn't reliably
|
21
|
+
# detect the named timezone, so we have to use the hour offset. Note that when
|
22
|
+
# DST changes, etc, this offset will change.
|
23
|
+
|
24
|
+
# We set timezone offset negative to match POSIX standards
|
25
|
+
# https://github.com/eggert/tz/blob/master/etcetera
|
26
|
+
@value = sprintf("Etc/GMT%+d", -((Time.zone_offset(Time.now.zone)/60)/60))
|
27
|
+
else
|
28
|
+
@value = value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
17
32
|
def finalize!
|
18
33
|
super
|
19
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-timezone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teemu Matilainen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Vagrant plugin that configures the time zone of a virtual machine
|
14
14
|
email:
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.4.5.1
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: A Vagrant plugin that configures the time zone of a virtual machine
|