cronofy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cronofy/types.rb +2 -1
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +0 -1
- data/spec/lib/cronofy/date_or_time_spec.rb +12 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f76631baac972077d554c5fff801c154f8900a8
|
4
|
+
data.tar.gz: 37b92d85fd99a99f3c1dd3f3415c1a710e9068bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
44
|
+
time = Time.iso8601(value)
|
44
45
|
rescue
|
45
46
|
begin
|
46
47
|
date = Date.strptime(value, '%Y-%m-%d')
|
data/lib/cronofy/version.rb
CHANGED
@@ -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.
|
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-
|
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
|