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 CHANGED
@@ -1,3 +1,9 @@
1
+ == Version 0.3.23 (tzdata v2010l) - 19-Aug-2010
2
+
3
+ * Updated to tzdata version 2010l
4
+ (http://article.gmane.org/gmane.comp.time.tz/3354).
5
+
6
+
1
7
  == Version 0.3.22 (tzdata v2010j) - 29-May-2010
2
8
 
3
9
  * Corrected file permissions issue with 0.3.21 release.
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
- PKG_VERSION = "0.3.22"
20
- PKG_FILES = FileList[
21
- 'CHANGES',
22
- 'LICENSE',
23
- 'Rakefile',
24
- 'README',
25
- 'bin/**/*',
26
- 'lib/**/*'
27
- ].delete_if {|f| f.include?('.svn')}
28
- PKG_TEST_FILES = FileList['test/**/*'].delete_if {|f| f.include?('.svn')}
29
-
30
- RDOC_OPTIONS = %w[--exclude definitions --exclude indexes]
31
- RDOC_EXTRA_FILES = %w[README CHANGES]
32
-
33
- BUILD_TZ_CLASSES_DIR = 'lib/tzinfo.build_tz_classes'
34
-
35
- SPEC = Gem::Specification.new do |s|
36
- s.name = "tzinfo"
37
- s.version = PKG_VERSION
38
- s.author = "Philip Ross"
39
- s.email = "phil.ross@gmail.com"
40
- s.homepage = "http://tzinfo.rubyforge.org/"
41
- s.platform = Gem::Platform::RUBY
42
- s.summary = "Daylight-savings aware timezone library"
43
- 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."
44
- s.files = PKG_FILES
45
- s.test_files = PKG_TEST_FILES
46
- s.require_path = "lib"
47
- s.has_rdoc = true
48
- s.extra_rdoc_files = RDOC_EXTRA_FILES
49
- s.rdoc_options = RDOC_OPTIONS
50
- s.rubyforge_project = "tzinfo"
51
- end
52
-
53
- Rake::GemPackageTask.new(SPEC) do |pkg|
54
- pkg.need_zip = true
55
- pkg.need_tar_gz = true
56
- end
57
-
58
-
59
- Rake::TestTask.new('test') do |t|
60
- # Force a particular timezone to be local (helps find issues when local
61
- # timezone isn't GMT). This won't work on Windows.
62
- ENV['TZ'] = 'America/Los_Angeles'
63
-
64
- t.libs << '.'
65
- t.pattern = 'test/tc_*.rb'
66
- t.verbose = true
67
- end
68
-
69
-
70
- Rake::RDocTask.new do |rdoc|
71
- rdoc.rdoc_dir = 'doc'
72
- rdoc.title = "TZInfo"
73
- rdoc.options << '--inline-source'
74
- rdoc.options.concat RDOC_OPTIONS
75
- rdoc.rdoc_files.include(*RDOC_EXTRA_FILES)
76
- rdoc.rdoc_files.include('lib')
77
- end
78
-
79
- task :build_tz_modules do
80
- require 'lib/tzinfo/tzdataparser'
81
-
82
- FileUtils.mkdir_p(BUILD_TZ_CLASSES_DIR)
83
- begin
84
- p = TZInfo::TZDataParser.new('../data', BUILD_TZ_CLASSES_DIR)
85
- p.execute
86
-
87
- ['indexes', 'definitions'].each {|dir|
88
- sync_svn("#{BUILD_TZ_CLASSES_DIR}/#{dir}", "lib/tzinfo/#{dir}")
89
- }
90
- ensure
91
- FileUtils.rm_rf(BUILD_TZ_CLASSES_DIR)
92
- end
93
- end
94
-
95
- def sync_svn(source_dir, target_dir)
96
- puts "SVN Sync from #{source_dir} to #{target_dir}"
97
-
98
- # Assumes a directory will never turn into a file and vice-versa
99
- # (files will all end in .rb, directories won't).
100
- # SVN wouldn't allow the change in a single commit anyway.
101
-
102
- source_entries, target_entries = [source_dir, target_dir].collect {|dir|
103
- Dir.entries(dir).delete_if {|entry| entry =~ /^\.(\.?|svn)$/}.sort
104
- }
105
-
106
- until source_entries.empty? || target_entries.empty?
107
- if source_entries.last == target_entries.last
108
- source_file = "#{source_dir}/#{source_entries.last}"
109
- target_file = "#{target_dir}/#{target_entries.last}"
110
-
111
- if File.directory?(source_file)
112
- sync_svn(source_file, target_file)
113
- else
114
- FileUtils.cp(source_file, target_file)
115
- end
116
-
117
- source_entries.pop
118
- target_entries.pop
119
- elsif source_entries.last < target_entries.last
120
- sync_svn_only_in_target(target_dir, target_entries)
121
- else
122
- sync_svn_only_in_source(source_dir, target_dir, source_entries)
123
- end
124
- end
125
-
126
- until target_entries.empty?
127
- sync_svn_only_in_target(target_dir, target_entries)
128
- end
129
-
130
- until source_entries.empty?
131
- sync_svn_only_in_source(source_dir, target_dir, source_entries)
132
- end
133
- end
134
-
135
- def sync_svn_only_in_target(target_dir, target_entries)
136
- target_file = "#{target_dir}/#{target_entries.last}"
137
- exec_svn "delete \"#{target_file}\""
138
- target_entries.pop
139
- end
140
-
141
- def sync_svn_only_in_source(source_dir, target_dir, source_entries)
142
- source_file = "#{source_dir}/#{source_entries.last}"
143
- target_file = "#{target_dir}/#{source_entries.last}"
144
-
145
- if File.directory?(source_file)
146
- Dir.mkdir(target_file)
147
- exec_svn "add \"#{target_file}\""
148
- sync_svn(source_file, target_file)
149
- else
150
- FileUtils.cp(source_file, target_file)
151
- exec_svn "add \"#{target_file}\""
152
- end
153
-
154
- source_entries.pop
155
- end
156
-
157
- def exec_svn(params)
158
- puts "svn #{params}"
159
- `svn #{params}`
160
- raise "SVN exited with status #$?" if $? != 0
161
- end
162
-
163
- task :build_tz_module do
164
- require 'lib/tzinfo/tzdataparser'
165
- p = TZInfo::TZDataParser.new('../data', 'lib/tzinfo')
166
- p.generate_countries = false
167
- p.only_zones = [ENV['zone']]
168
- p.execute
169
- end
170
-
171
- task :build_countries do
172
- require 'lib/tzinfo/tzdataparser'
173
- p = TZInfo::TZDataParser.new('../data', 'lib/tzinfo')
174
- p.generate_countries = true
175
- p.generate_zones = false
176
- p.execute
177
- end
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, :o2, 1270364400
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, 9, :o1, 1283468400
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