cronofy 0.5.2 → 0.5.3
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/README.md +9 -0
- data/lib/cronofy/types.rb +8 -1
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/event_spec.rb +4 -0
- 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: 2b042634f429bc12cf929f77ab3736bea099b155
|
|
4
|
+
data.tar.gz: 46301a97a1d85dd7477d3d63a43c8be5ec675051
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d3ecec788a50f3195af14120ff3e23c157903d721f68fa3fdbf435357516ea779d5cf08443c0e86de91169f0297697a561319efbb69b648b5fd6778b286c0f8
|
|
7
|
+
data.tar.gz: 1ed2f31caf7e1f5670c5e24ee5dc58a5af46738622b240ac0e886e2af6286fe41f712a8e6f3c03ea536cb1ade3fcde3c5664b3b27e7bd611d0556af0fbeadebf
|
data/README.md
CHANGED
|
@@ -90,6 +90,15 @@ calendar.calendar_id
|
|
|
90
90
|
# => "cal_YYYYYYYY-UNIQUE_CAL_ID_HERE-YYYYYYYY"
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
### Read events
|
|
94
|
+
|
|
95
|
+
```ruby
|
|
96
|
+
events = cronofy.read_events
|
|
97
|
+
events.first
|
|
98
|
+
# => {"calendar_id" => ....}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
|
|
93
102
|
### Create or update events
|
|
94
103
|
|
|
95
104
|
To create/update an event in the user's calendar:
|
data/lib/cronofy/types.rb
CHANGED
|
@@ -31,7 +31,14 @@ module Cronofy
|
|
|
31
31
|
|
|
32
32
|
module ISO8601Time
|
|
33
33
|
def self.coerce(value)
|
|
34
|
-
|
|
34
|
+
case value
|
|
35
|
+
when Time
|
|
36
|
+
value
|
|
37
|
+
when String
|
|
38
|
+
Time.iso8601(value)
|
|
39
|
+
else
|
|
40
|
+
raise ArgumentError, "Cannot coerce #{value.inspect} to Time"
|
|
41
|
+
end
|
|
35
42
|
end
|
|
36
43
|
end
|
|
37
44
|
|
data/lib/cronofy/version.rb
CHANGED
|
@@ -53,6 +53,10 @@ describe Cronofy::Event do
|
|
|
53
53
|
it "coerces the updated time" do
|
|
54
54
|
expect(subject.updated).to eq(Time.parse("2014-09-01T09:24:16Z"))
|
|
55
55
|
end
|
|
56
|
+
|
|
57
|
+
it "can be inspected" do
|
|
58
|
+
expect(subject.inspect).to_not be_nil
|
|
59
|
+
end
|
|
56
60
|
end
|
|
57
61
|
|
|
58
62
|
context "localized times" do
|
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.5.
|
|
4
|
+
version: 0.5.3
|
|
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-
|
|
12
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: oauth2
|