tzinfo 0.3.22 → 0.3.23
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of tzinfo might be problematic. Click here for more details.
- data/CHANGES +6 -0
- data/Rakefile +241 -177
- data/lib/tzinfo/definitions/Africa/Cairo.rb +2 -0
- data/lib/tzinfo/definitions/America/Bahia_Banderas.rb +1 -2
- data/lib/tzinfo/definitions/Asia/Gaza.rb +1 -1
- data/lib/tzinfo/definitions/Europe/Helsinki.rb +4 -4
- data/lib/tzinfo/definitions/Pacific/Chuuk.rb +16 -0
- data/lib/tzinfo/definitions/Pacific/Pohnpei.rb +16 -0
- data/lib/tzinfo/definitions/Pacific/Ponape.rb +1 -6
- data/lib/tzinfo/definitions/Pacific/Truk.rb +1 -6
- data/lib/tzinfo/definitions/Pacific/Yap.rb +1 -1
- data/lib/tzinfo/indexes/countries.rb +2 -2
- data/lib/tzinfo/indexes/timezones.rb +4 -2
- metadata +572 -570
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -1,177 +1,241 @@
|
|
1
|
-
# Available options:
|
2
|
-
#
|
3
|
-
# rake test - Runs all test cases.
|
4
|
-
# rake package - Runs test cases and builds packages for distribution.
|
5
|
-
# rake rdoc - Builds API documentation in doc dir.
|
6
|
-
# rake build_tz_modules - Builds Timezone modules and the Country index.
|
7
|
-
# Expects to find source data in ../data.
|
8
|
-
# rake build_tz_module zone=Zone/Name - Builds a single Timezone module.
|
9
|
-
# Expects to find source data in ../data.
|
10
|
-
# rake build_countries - Builds the Country index.
|
11
|
-
# Expects to find source data in ../data.
|
12
|
-
|
13
|
-
require 'rake'
|
14
|
-
require 'rake/testtask'
|
15
|
-
require 'rake/rdoctask'
|
16
|
-
require 'rake/gempackagetask'
|
17
|
-
require 'fileutils'
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
1
|
+
# Available options:
|
2
|
+
#
|
3
|
+
# rake test - Runs all test cases.
|
4
|
+
# rake package - Runs test cases and builds packages for distribution.
|
5
|
+
# rake rdoc - Builds API documentation in doc dir.
|
6
|
+
# rake build_tz_modules - Builds Timezone modules and the Country index.
|
7
|
+
# Expects to find source data in ../data.
|
8
|
+
# rake build_tz_module zone=Zone/Name - Builds a single Timezone module.
|
9
|
+
# Expects to find source data in ../data.
|
10
|
+
# rake build_countries - Builds the Country index.
|
11
|
+
# Expects to find source data in ../data.
|
12
|
+
|
13
|
+
require 'rake'
|
14
|
+
require 'rake/testtask'
|
15
|
+
require 'rake/rdoctask'
|
16
|
+
require 'rake/gempackagetask'
|
17
|
+
require 'fileutils'
|
18
|
+
|
19
|
+
Rake::TaskManager.class_eval do
|
20
|
+
def remove_task(task_name)
|
21
|
+
@tasks.delete(task_name.to_s)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def remove_task(task_name)
|
26
|
+
Rake.application.remove_task(task_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
self.class.class_eval { alias_method :orig_sh, :sh }
|
30
|
+
private :orig_sh
|
31
|
+
|
32
|
+
def sh(*cmd, &block)
|
33
|
+
if cmd.first =~ /\A__tar_with_owner__ -?([zjcvf]+)(.*)\z/
|
34
|
+
opts = $1
|
35
|
+
args = $2
|
36
|
+
cmd[0] = "tar c --owner 0 --group 0 -#{opts.gsub('c', '')}#{args}"
|
37
|
+
end
|
38
|
+
|
39
|
+
orig_sh(*cmd, &block)
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
PKG_VERSION = "0.3.23"
|
44
|
+
PKG_FILES = FileList[
|
45
|
+
'CHANGES',
|
46
|
+
'LICENSE',
|
47
|
+
'Rakefile',
|
48
|
+
'README',
|
49
|
+
'lib',
|
50
|
+
'lib/**/*'
|
51
|
+
].delete_if {|f| f.include?('.svn')}
|
52
|
+
PKG_TEST_FILES = FileList['test', 'test/**/*'].delete_if {|f| f.include?('.svn')}
|
53
|
+
|
54
|
+
RDOC_OPTIONS = %w[--exclude definitions --exclude indexes]
|
55
|
+
RDOC_EXTRA_FILES = %w[README CHANGES]
|
56
|
+
|
57
|
+
BUILD_TZ_CLASSES_DIR = 'lib/tzinfo.build_tz_classes'
|
58
|
+
|
59
|
+
SPEC = Gem::Specification.new do |s|
|
60
|
+
s.name = "tzinfo"
|
61
|
+
s.version = PKG_VERSION
|
62
|
+
s.author = "Philip Ross"
|
63
|
+
s.email = "phil.ross@gmail.com"
|
64
|
+
s.homepage = "http://tzinfo.rubyforge.org/"
|
65
|
+
s.platform = Gem::Platform::RUBY
|
66
|
+
s.summary = "Daylight-savings aware timezone library"
|
67
|
+
s.description = "TZInfo is a Ruby library that uses the standard tz (Olson) database to provide daylight savings aware transformations between times in different time zones."
|
68
|
+
s.files = PKG_FILES
|
69
|
+
s.test_files = PKG_TEST_FILES
|
70
|
+
s.require_path = "lib"
|
71
|
+
s.has_rdoc = true
|
72
|
+
s.extra_rdoc_files = RDOC_EXTRA_FILES
|
73
|
+
s.rdoc_options = RDOC_OPTIONS
|
74
|
+
s.rubyforge_project = "tzinfo"
|
75
|
+
end
|
76
|
+
|
77
|
+
package_task = Rake::GemPackageTask.new(SPEC) do |pkg|
|
78
|
+
pkg.need_zip = true
|
79
|
+
pkg.need_tar_gz = true
|
80
|
+
pkg.tar_command = '__tar_with_owner__'
|
81
|
+
end
|
82
|
+
|
83
|
+
# Replace the Rake::PackageTask task that prepares the files to package with
|
84
|
+
# a version that ensures the permissions are correct for the package.
|
85
|
+
# Also just copy rather than link the files so that old versions are maintained.
|
86
|
+
remove_task package_task.package_dir_path
|
87
|
+
file package_task.package_dir_path => [package_task.package_dir] + package_task.package_files do
|
88
|
+
mkdir_p package_task.package_dir_path rescue nil
|
89
|
+
chmod(0755, package_task.package_dir_path)
|
90
|
+
package_task.package_files.each do |fn|
|
91
|
+
f = File.join(package_task.package_dir_path, fn)
|
92
|
+
fdir = File.dirname(f)
|
93
|
+
mkdir_p(fdir) if !File.exist?(fdir)
|
94
|
+
if File.directory?(fn)
|
95
|
+
mkdir_p(f)
|
96
|
+
chmod(0755, f)
|
97
|
+
else
|
98
|
+
rm_f f
|
99
|
+
cp(fn, f)
|
100
|
+
chmod(0644, f)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
# Replace the Rake::GemPackageTask task that builds the gem with a version that
|
107
|
+
# changes to the copied package directory first. This allows the gem builder
|
108
|
+
# to pick up the correct file permissions.
|
109
|
+
remove_task "#{package_task.package_dir}/#{package_task.gem_file}"
|
110
|
+
file "#{package_task.package_dir}/#{package_task.gem_file}" => [package_task.package_dir] + package_task.gem_spec.files do
|
111
|
+
when_writing("Creating GEM") do
|
112
|
+
chdir(package_task.package_dir_path) do
|
113
|
+
Gem::Builder.new(package_task.gem_spec).build
|
114
|
+
end
|
115
|
+
|
116
|
+
verbose(true) do
|
117
|
+
mv File.join(package_task.package_dir_path, package_task.gem_file), "#{package_task.package_dir}/#{package_task.gem_file}"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
Rake::TestTask.new('test') do |t|
|
124
|
+
# Force a particular timezone to be local (helps find issues when local
|
125
|
+
# timezone isn't GMT). This won't work on Windows.
|
126
|
+
ENV['TZ'] = 'America/Los_Angeles'
|
127
|
+
|
128
|
+
t.libs << '.'
|
129
|
+
t.pattern = 'test/tc_*.rb'
|
130
|
+
t.verbose = true
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
Rake::RDocTask.new do |rdoc|
|
135
|
+
rdoc.rdoc_dir = 'doc'
|
136
|
+
rdoc.title = "TZInfo"
|
137
|
+
rdoc.options << '--inline-source'
|
138
|
+
rdoc.options.concat RDOC_OPTIONS
|
139
|
+
rdoc.rdoc_files.include(*RDOC_EXTRA_FILES)
|
140
|
+
rdoc.rdoc_files.include('lib')
|
141
|
+
end
|
142
|
+
|
143
|
+
task :build_tz_modules do
|
144
|
+
require 'lib/tzinfo/tzdataparser'
|
145
|
+
|
146
|
+
FileUtils.mkdir_p(BUILD_TZ_CLASSES_DIR)
|
147
|
+
begin
|
148
|
+
p = TZInfo::TZDataParser.new('../data', BUILD_TZ_CLASSES_DIR)
|
149
|
+
p.execute
|
150
|
+
|
151
|
+
['indexes', 'definitions'].each {|dir|
|
152
|
+
sync_svn("#{BUILD_TZ_CLASSES_DIR}/#{dir}", "lib/tzinfo/#{dir}")
|
153
|
+
}
|
154
|
+
ensure
|
155
|
+
FileUtils.rm_rf(BUILD_TZ_CLASSES_DIR)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def sync_svn(source_dir, target_dir)
|
160
|
+
puts "SVN Sync from #{source_dir} to #{target_dir}"
|
161
|
+
|
162
|
+
# Assumes a directory will never turn into a file and vice-versa
|
163
|
+
# (files will all end in .rb, directories won't).
|
164
|
+
# SVN wouldn't allow the change in a single commit anyway.
|
165
|
+
|
166
|
+
source_entries, target_entries = [source_dir, target_dir].collect {|dir|
|
167
|
+
Dir.entries(dir).delete_if {|entry| entry =~ /^\.(\.?|svn)$/}.sort
|
168
|
+
}
|
169
|
+
|
170
|
+
until source_entries.empty? || target_entries.empty?
|
171
|
+
if source_entries.last == target_entries.last
|
172
|
+
source_file = "#{source_dir}/#{source_entries.last}"
|
173
|
+
target_file = "#{target_dir}/#{target_entries.last}"
|
174
|
+
|
175
|
+
if File.directory?(source_file)
|
176
|
+
sync_svn(source_file, target_file)
|
177
|
+
else
|
178
|
+
FileUtils.cp(source_file, target_file)
|
179
|
+
end
|
180
|
+
|
181
|
+
source_entries.pop
|
182
|
+
target_entries.pop
|
183
|
+
elsif source_entries.last < target_entries.last
|
184
|
+
sync_svn_only_in_target(target_dir, target_entries)
|
185
|
+
else
|
186
|
+
sync_svn_only_in_source(source_dir, target_dir, source_entries)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
until target_entries.empty?
|
191
|
+
sync_svn_only_in_target(target_dir, target_entries)
|
192
|
+
end
|
193
|
+
|
194
|
+
until source_entries.empty?
|
195
|
+
sync_svn_only_in_source(source_dir, target_dir, source_entries)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def sync_svn_only_in_target(target_dir, target_entries)
|
200
|
+
target_file = "#{target_dir}/#{target_entries.last}"
|
201
|
+
exec_svn "delete \"#{target_file}\""
|
202
|
+
target_entries.pop
|
203
|
+
end
|
204
|
+
|
205
|
+
def sync_svn_only_in_source(source_dir, target_dir, source_entries)
|
206
|
+
source_file = "#{source_dir}/#{source_entries.last}"
|
207
|
+
target_file = "#{target_dir}/#{source_entries.last}"
|
208
|
+
|
209
|
+
if File.directory?(source_file)
|
210
|
+
Dir.mkdir(target_file)
|
211
|
+
exec_svn "add \"#{target_file}\""
|
212
|
+
sync_svn(source_file, target_file)
|
213
|
+
else
|
214
|
+
FileUtils.cp(source_file, target_file)
|
215
|
+
exec_svn "add \"#{target_file}\""
|
216
|
+
end
|
217
|
+
|
218
|
+
source_entries.pop
|
219
|
+
end
|
220
|
+
|
221
|
+
def exec_svn(params)
|
222
|
+
puts "svn #{params}"
|
223
|
+
`svn #{params}`
|
224
|
+
raise "SVN exited with status #$?" if $? != 0
|
225
|
+
end
|
226
|
+
|
227
|
+
task :build_tz_module do
|
228
|
+
require 'lib/tzinfo/tzdataparser'
|
229
|
+
p = TZInfo::TZDataParser.new('../data', 'lib/tzinfo')
|
230
|
+
p.generate_countries = false
|
231
|
+
p.only_zones = [ENV['zone']]
|
232
|
+
p.execute
|
233
|
+
end
|
234
|
+
|
235
|
+
task :build_countries do
|
236
|
+
require 'lib/tzinfo/tzdataparser'
|
237
|
+
p = TZInfo::TZDataParser.new('../data', 'lib/tzinfo')
|
238
|
+
p.generate_countries = true
|
239
|
+
p.generate_zones = false
|
240
|
+
p.execute
|
241
|
+
end
|
@@ -129,6 +129,8 @@ module TZInfo
|
|
129
129
|
tz.transition 2009, 4, :o2, 1240524000
|
130
130
|
tz.transition 2009, 8, :o1, 1250802000
|
131
131
|
tz.transition 2010, 4, :o2, 1272578400
|
132
|
+
tz.transition 2010, 8, :o1, 1281474000
|
133
|
+
tz.transition 2010, 9, :o2, 1284069600
|
132
134
|
tz.transition 2010, 9, :o1, 1285880400
|
133
135
|
tz.transition 2011, 4, :o2, 1304028000
|
134
136
|
tz.transition 2011, 9, :o1, 1317330000
|
@@ -49,8 +49,7 @@ module TZInfo
|
|
49
49
|
tz.transition 2008, 10, :o1, 1225008000
|
50
50
|
tz.transition 2009, 4, :o4, 1238922000
|
51
51
|
tz.transition 2009, 10, :o1, 1256457600
|
52
|
-
tz.transition 2010, 4, :
|
53
|
-
tz.transition 2010, 4, :o5, 1270368000
|
52
|
+
tz.transition 2010, 4, :o5, 1270371600
|
54
53
|
tz.transition 2010, 10, :o2, 1288508400
|
55
54
|
tz.transition 2011, 4, :o5, 1301817600
|
56
55
|
tz.transition 2011, 10, :o2, 1319958000
|
@@ -101,7 +101,7 @@ module TZInfo
|
|
101
101
|
tz.transition 2009, 3, :o3, 1238104800
|
102
102
|
tz.transition 2009, 9, :o1, 1252018800
|
103
103
|
tz.transition 2010, 3, :o3, 1269640860
|
104
|
-
tz.transition 2010,
|
104
|
+
tz.transition 2010, 8, :o1, 1281474000
|
105
105
|
tz.transition 2011, 3, :o3, 1301090460
|
106
106
|
tz.transition 2011, 9, :o1, 1314918000
|
107
107
|
tz.transition 2012, 3, :o3, 1333144860
|