et-orbi 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/et-orbi.rb +18 -25
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b59057ba3391277520b52cedaaca8c8beca1805f
|
4
|
+
data.tar.gz: 8c2100802014372e3b7cf7c8a1ca9a4c4baff5fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573c6898345ba811080c7975045ddd87ca8ddc5a65d0c2893475d15eb829c60e343ced79dc20823ea676bc440999c61b6d8e395d5c10aa9ee35f085a73ecfda0
|
7
|
+
data.tar.gz: c48b752e6e0ccc717d9a1103b63f075f2e80cd0837d3494fb1e03d3083c6c3db637919cda3d85ae3b05b72a10f30d266ec97bc7fef78fb6c16b3acfb1d84fc1f
|
data/CHANGELOG.md
CHANGED
data/lib/et-orbi.rb
CHANGED
@@ -7,7 +7,7 @@ require 'tzinfo'
|
|
7
7
|
|
8
8
|
module EtOrbi
|
9
9
|
|
10
|
-
VERSION = '1.0.
|
10
|
+
VERSION = '1.0.1'
|
11
11
|
|
12
12
|
class EoTime
|
13
13
|
|
@@ -239,6 +239,20 @@ module EtOrbi
|
|
239
239
|
}x)
|
240
240
|
end
|
241
241
|
|
242
|
+
#def in_zone(&block)
|
243
|
+
#
|
244
|
+
# current_timezone = ENV['TZ']
|
245
|
+
# ENV['TZ'] = @zone
|
246
|
+
#
|
247
|
+
# block.call
|
248
|
+
#
|
249
|
+
#ensure
|
250
|
+
#
|
251
|
+
# ENV['TZ'] = current_timezone
|
252
|
+
#end
|
253
|
+
#
|
254
|
+
# kept around as a (thread-unsafe) relic
|
255
|
+
|
242
256
|
def self.platform_info
|
243
257
|
|
244
258
|
etos = Proc.new { |k, v| "#{k}:#{v.inspect}" }
|
@@ -251,25 +265,14 @@ module EtOrbi
|
|
251
265
|
'rv' => RUBY_VERSION,
|
252
266
|
'rp' => RUBY_PLATFORM,
|
253
267
|
'eov' => EtOrbi::VERSION,
|
268
|
+
'rorv' => (Rails::VERSION::STRING rescue nil),
|
269
|
+
'astz' => Time.respond_to?(:zone) ? Time.zone.name : nil,
|
270
|
+
# Active Support Time.zone
|
254
271
|
}.collect(&etos).join(',') + ',' +
|
255
272
|
gather_tzs.collect(&etos).join(',') +
|
256
273
|
')'
|
257
274
|
end
|
258
275
|
|
259
|
-
#def in_zone(&block)
|
260
|
-
#
|
261
|
-
# current_timezone = ENV['TZ']
|
262
|
-
# ENV['TZ'] = @zone
|
263
|
-
#
|
264
|
-
# block.call
|
265
|
-
#
|
266
|
-
#ensure
|
267
|
-
#
|
268
|
-
# ENV['TZ'] = current_timezone
|
269
|
-
#end
|
270
|
-
#
|
271
|
-
# kept around as a (thread-unsafe) relic
|
272
|
-
|
273
276
|
#
|
274
277
|
# instance methods
|
275
278
|
|
@@ -281,16 +284,6 @@ module EtOrbi
|
|
281
284
|
@seconds = s.to_f
|
282
285
|
@zone = self.class.get_tzone(zone || :local)
|
283
286
|
|
284
|
-
#fail ArgumentError.new(
|
285
|
-
# "cannot determine timezone from #{zone.inspect}" +
|
286
|
-
# " (etz:#{ENV['TZ'].inspect},tnz:#{Time.now.zone.inspect}," +
|
287
|
-
# "tzid:#{defined?(TZInfo::Data).inspect}," +
|
288
|
-
# "rv:#{RUBY_VERSION.inspect},rp:#{RUBY_PLATFORM.inspect}," +
|
289
|
-
# "stz:(#{self.class.gather_tzs.map { |k, v| "#{k}:#{v.inspect}"}.join(',')})) \n" +
|
290
|
-
# "Try setting `ENV['TZ'] = 'Continent/City'` in your script " +
|
291
|
-
# "(see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)" +
|
292
|
-
# (defined?(TZInfo::Data) ? '' : " and adding 'tzinfo-data' to your gems")
|
293
|
-
#) unless @zone
|
294
287
|
fail ArgumentError.new(
|
295
288
|
"cannot determine timezone from #{zone.inspect}" +
|
296
289
|
"\n#{self.class.platform_info}" +
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: et-orbi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|