cronofy 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfa7415b5d284a6c099d6c2247430cb63a4e6241
4
- data.tar.gz: 83c8cfe7ed6decaef9e78fce9c2eab83560434a1
3
+ metadata.gz: 4f76631baac972077d554c5fff801c154f8900a8
4
+ data.tar.gz: 37b92d85fd99a99f3c1dd3f3415c1a710e9068bf
5
5
  SHA512:
6
- metadata.gz: 9d86d15864c20933b9ed7e992e020d104163cbff810b8aded419eff2b4cc6f81b266af138b272dec5baa043d8dc5cefc976d4e04d11c94893bf450a104419b53
7
- data.tar.gz: ae77c0ca26eec4bb3838ae014746f6ad90a0e018f07f4a8a6d349e818befa682d59556045e571195af21f469308a8b64d8cbcef704d057dcaa15ad36d30e069c
6
+ metadata.gz: 4772a5a044101e1bd461ca0c72b893faa0a5b32f19f0a6f1c1291fb1f5f205f6831aee20f4aca2dab175b4dfa942e2d5e11e66668b0be0a4079c1cf75e86ac06
7
+ data.tar.gz: 7b0c9c0e2b33f13c99526a325546f25a0f0735bba2a739f3b827e7a3655a1d17b7d756f72c0a08df4be9a973a4bab3c3fe6849f6e7bedd72258d9038ca2cd675
data/lib/cronofy/types.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "date"
2
2
  require "hashie"
3
+ require "time"
3
4
 
4
5
  module Cronofy
5
6
  class Credentials
@@ -40,7 +41,7 @@ module Cronofy
40
41
 
41
42
  def self.coerce(value)
42
43
  begin
43
- time = Time.strptime(value, '%Y-%m-%dT%H:%M:%SZ')
44
+ time = Time.iso8601(value)
44
45
  rescue
45
46
  begin
46
47
  date = Date.strptime(value, '%Y-%m-%d')
@@ -1,3 +1,3 @@
1
1
  module Cronofy
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -1,4 +1,3 @@
1
-
2
1
  require_relative '../../spec_helper'
3
2
 
4
3
  describe Cronofy::Client do
@@ -0,0 +1,12 @@
1
+ require_relative '../../spec_helper'
2
+
3
+ describe Cronofy::DateOrTime do
4
+ context ".coerce" do
5
+ it "takes offset into account" do
6
+ utc = Cronofy::DateOrTime.coerce("2015-04-20T06:00:00Z")
7
+ local = Cronofy::DateOrTime.coerce("2015-04-20T07:00:00+01:00")
8
+
9
+ expect(utc).to eq(local)
10
+ end
11
+ end
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Paryzhskyi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-11 00:00:00.000000000 Z
12
+ date: 2015-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -117,6 +117,7 @@ files:
117
117
  - lib/cronofy/version.rb
118
118
  - spec/lib/cronofy/auth_spec.rb
119
119
  - spec/lib/cronofy/client_spec.rb
120
+ - spec/lib/cronofy/date_or_time_spec.rb
120
121
  - spec/response_parser_spec.rb
121
122
  - spec/spec_helper.rb
122
123
  homepage: https://github.com/cronofy/cronofy-ruby
@@ -146,5 +147,6 @@ summary: Cronofy - one API for all the calendars
146
147
  test_files:
147
148
  - spec/lib/cronofy/auth_spec.rb
148
149
  - spec/lib/cronofy/client_spec.rb
150
+ - spec/lib/cronofy/date_or_time_spec.rb
149
151
  - spec/response_parser_spec.rb
150
152
  - spec/spec_helper.rb