flycal-cli 1.5.2 → 1.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/lib/flycal/calendar_query.rb +18 -3
- data/lib/flycal.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bd7c3e89b9ceaa93038ba97903be917fdea6b6519042ee950d1bdbed5569e63
|
|
4
|
+
data.tar.gz: 785ee2cf0e112fc3dc586ca8e20e282c8dac34c2c23611b629f528cea3e81130
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe4dc5a070fdbd7f0a6de1a4512dd8fd3ef1a51366d274f97444124a5fd8a5e68f6fb1a9fa48f304123ad5b64814cccf37ee9abb4892c5d7439c71e7797f8752
|
|
7
|
+
data.tar.gz: ef9159719e4ca1009906b1d59e46ab7e638689abf25ee18da100b0affce86eb4b013b4461396d8bbd98a45d77febca296d762b27faee316e0443280e0bd52083
|
|
@@ -45,16 +45,31 @@ module Flycal
|
|
|
45
45
|
|
|
46
46
|
def calendar_id(cal)
|
|
47
47
|
return nil if cal.nil?
|
|
48
|
+
|
|
49
|
+
# Rails Calendar rows store the Google id in calendar_id; #id is the PK.
|
|
50
|
+
if cal.respond_to?(:calendar_id)
|
|
51
|
+
google_id = cal.calendar_id
|
|
52
|
+
return google_id unless google_id.nil? || google_id.to_s.empty?
|
|
53
|
+
end
|
|
54
|
+
|
|
48
55
|
return cal.id if cal.respond_to?(:id)
|
|
56
|
+
return unless cal.respond_to?(:[])
|
|
49
57
|
|
|
50
|
-
cal[:id] || cal["id"]
|
|
58
|
+
cal[:id] || cal["id"] || cal[:calendar_id] || cal["calendar_id"]
|
|
51
59
|
end
|
|
52
60
|
|
|
53
61
|
def calendar_summary(cal)
|
|
54
62
|
return nil if cal.nil?
|
|
55
|
-
return cal.summary if cal.respond_to?(:summary)
|
|
63
|
+
return cal.summary if cal.respond_to?(:summary) && !cal.is_a?(Hash)
|
|
64
|
+
|
|
65
|
+
if cal.respond_to?(:name) && !cal.is_a?(Hash)
|
|
66
|
+
name = cal.name
|
|
67
|
+
return name if name.present?
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
return cal[:summary] || cal["summary"] || cal[:name] || cal["name"] if cal.respond_to?(:[])
|
|
56
71
|
|
|
57
|
-
|
|
72
|
+
nil
|
|
58
73
|
end
|
|
59
74
|
end
|
|
60
75
|
end
|
data/lib/flycal.rb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Under Rails, Zeitwerk autoloads lib/flycal/*.
|
|
5
5
|
# The CLI gem entrypoint (flycal_cli/lib/flycal_cli.rb) eager-requires what it needs.
|
|
6
6
|
module Flycal
|
|
7
|
-
VERSION = "1.5.
|
|
7
|
+
VERSION = "1.5.3"
|
|
8
8
|
|
|
9
9
|
def self.connect(credentials:)
|
|
10
10
|
Client.new(credentials: credentials)
|