lazier 3.5.5 → 3.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/doc/Lazier.html +2 -2
- data/doc/Lazier/Boolean.html +2 -2
- data/doc/Lazier/Configuration.html +2 -2
- data/doc/Lazier/DateTime.html +2 -2
- data/doc/Lazier/DateTime/ClassMethods.html +2 -2
- data/doc/Lazier/Exceptions.html +2 -2
- data/doc/Lazier/Exceptions/Debug.html +2 -2
- data/doc/Lazier/Exceptions/MissingTranslation.html +2 -2
- data/doc/Lazier/Hash.html +2 -2
- data/doc/Lazier/I18n.html +2 -2
- data/doc/Lazier/Localizer.html +2 -2
- data/doc/Lazier/Math.html +2 -2
- data/doc/Lazier/Math/ClassMethods.html +2 -2
- data/doc/Lazier/Object.html +2 -2
- data/doc/Lazier/Pathname.html +2 -2
- data/doc/Lazier/Settings.html +2 -2
- data/doc/Lazier/String.html +2 -2
- data/doc/Lazier/TimeZone.html +153 -63
- data/doc/Lazier/TimeZone/ClassMethods.html +2 -2
- data/doc/Lazier/Version.html +3 -3
- data/doc/_index.html +2 -2
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/method_list.html +104 -98
- data/doc/top-level-namespace.html +2 -2
- data/lib/lazier/timezone.rb +17 -6
- data/lib/lazier/version.rb +1 -1
- data/spec/lazier/timezone_spec.rb +8 -0
- metadata +2 -2
@@ -103,9 +103,9 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Thu Jun 19 11:34:23 2014 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
|
-
0.8.7.4 (ruby-2.1.
|
108
|
+
0.8.7.4 (ruby-2.1.2).
|
109
109
|
</div>
|
110
110
|
|
111
111
|
</body>
|
data/lib/lazier/timezone.rb
CHANGED
@@ -164,17 +164,28 @@ module Lazier
|
|
164
164
|
#
|
165
165
|
# @return [String] The current alias or the first alias of the current timezone.
|
166
166
|
def current_alias
|
167
|
-
|
167
|
+
if @current_alias
|
168
|
+
@current_alias
|
169
|
+
else
|
170
|
+
identifier = tzinfo.identifier
|
168
171
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
172
|
+
catch(:alias) do
|
173
|
+
aliases.each do |a|
|
174
|
+
throw(:alias, a) if a == identifier
|
175
|
+
end
|
173
176
|
|
174
|
-
|
177
|
+
aliases.first
|
178
|
+
end
|
175
179
|
end
|
176
180
|
end
|
177
181
|
|
182
|
+
# Sets the current alias.
|
183
|
+
#
|
184
|
+
# @param new_alias [String] The new current alias.
|
185
|
+
def current_alias=(new_alias)
|
186
|
+
@current_alias = new_alias.ensure_string
|
187
|
+
end
|
188
|
+
|
178
189
|
# Returns the standard offset for this timezone.
|
179
190
|
#
|
180
191
|
# @param rational [Boolean] If to return the offset as a Rational.
|
data/lib/lazier/version.rb
CHANGED
@@ -89,6 +89,14 @@ describe Lazier::TimeZone do
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
describe "#current_alias=" do
|
93
|
+
it "should set the current alias alias" do
|
94
|
+
zone = ActiveSupport::TimeZone["America/Halifax"]
|
95
|
+
zone.current_alias = "ALIAS"
|
96
|
+
expect(zone.current_alias).to eq("ALIAS")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
92
100
|
describe "#dst_period" do
|
93
101
|
it "should correctly return zone offset" do
|
94
102
|
expect(subject_zone.dst_period).to be_a(::TZInfo::TimezonePeriod)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shogun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|