time_zone_ext 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -5,4 +5,8 @@
5
5
  ## v.0.0.2
6
6
 
7
7
  * Configured TravisCI
8
- * Added support for Ruby 1.8
8
+ * Added support for Ruby 1.8
9
+
10
+ ## v.0.0.3
11
+
12
+ * Fixed bug for named time zones
data/lib/time_zone_ext.rb CHANGED
@@ -7,7 +7,7 @@ module TimeZoneExt
7
7
  if format =~ /%z/i
8
8
  DateTime.strptime(date, format).in_time_zone
9
9
  else
10
- DateTime.strptime("#{date} zone#{name}", "#{format} zone%z").in_time_zone
10
+ DateTime.strptime("#{date} zone#{formatted_offset}", "#{format} zone%z").in_time_zone
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module TimeZoneExt
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -16,4 +16,9 @@ describe TimeZoneExt do
16
16
  it "parses time without explicitly specified timezone" do
17
17
  Time.zone.strptime("2012-06-02 00:00", "%Y-%m-%d %H:%M").to_s.should == "2012-06-02 00:00:00 -0500"
18
18
  end
19
+
20
+ it "parses time with named time zone" do
21
+ Time.zone = "Moscow"
22
+ Time.zone.strptime("2012-06-02 00:00", "%Y-%m-%d %H:%M").to_s.should == "2012-06-02 00:00:00 +0400"
23
+ end
19
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_zone_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-28 00:00:00.000000000 Z
12
+ date: 2012-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: 1624769155559177289
112
+ hash: -635974733064479003
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements:
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  segments:
120
120
  - 0
121
- hash: 1624769155559177289
121
+ hash: -635974733064479003
122
122
  requirements: []
123
123
  rubyforge_project:
124
124
  rubygems_version: 1.8.24