google_calendar 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/google_calendar.gemspec +8 -8
- data/lib/google/event.rb +20 -9
- metadata +115 -123
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/google_calendar.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.2.
|
7
|
+
s.name = "google_calendar"
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Steve Zich"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-12-14"
|
13
|
+
s.description = "A minimal wrapper around the google calendar API, which uses nokogiri for fast parsing."
|
14
|
+
s.email = "steve.zich@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -41,11 +41,11 @@ Gem::Specification.new do |s|
|
|
41
41
|
"test/mocks/successful_login.txt",
|
42
42
|
"test/test_google_calendar.rb"
|
43
43
|
]
|
44
|
-
s.homepage =
|
44
|
+
s.homepage = "http://github.com/northworld/google_calendar"
|
45
45
|
s.licenses = ["MIT"]
|
46
46
|
s.require_paths = ["lib"]
|
47
|
-
s.rubygems_version =
|
48
|
-
s.summary =
|
47
|
+
s.rubygems_version = "1.8.24"
|
48
|
+
s.summary = "A lightweight google calendar API wrapper"
|
49
49
|
s.test_files = [
|
50
50
|
"test/helper.rb",
|
51
51
|
"test/test_google_calendar.rb"
|
data/lib/google/event.rb
CHANGED
@@ -17,7 +17,7 @@ module Google
|
|
17
17
|
#
|
18
18
|
class Event
|
19
19
|
attr_reader :id, :raw_xml
|
20
|
-
attr_accessor :title, :content, :where, :calendar, :quickadd
|
20
|
+
attr_accessor :title, :content, :where, :calendar, :quickadd, :transparency
|
21
21
|
|
22
22
|
# Create a new event, and optionally set it's attributes.
|
23
23
|
#
|
@@ -40,6 +40,7 @@ module Google
|
|
40
40
|
@calendar = params[:calendar]
|
41
41
|
@raw_xml = params[:raw_xml]
|
42
42
|
@quickadd = params[:quickadd]
|
43
|
+
@transparency = params[:transparency]
|
43
44
|
end
|
44
45
|
|
45
46
|
# Sets the start time of the Event. Must be a Time object or a parsable string representation of a time.
|
@@ -93,6 +94,14 @@ module Google
|
|
93
94
|
Time.parse(end_time) - Time.parse(start_time)
|
94
95
|
end
|
95
96
|
|
97
|
+
def transparent?
|
98
|
+
transparency == "transparent"
|
99
|
+
end
|
100
|
+
|
101
|
+
def opaque?
|
102
|
+
transparency == "opaque"
|
103
|
+
end
|
104
|
+
|
96
105
|
#
|
97
106
|
def self.build_from_google_feed(xml, calendar)
|
98
107
|
Nokogiri::XML(xml).xpath("//xmlns:entry").collect {|e| new_from_xml(e, calendar)}
|
@@ -106,7 +115,7 @@ module Google
|
|
106
115
|
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>
|
107
116
|
<title type='text'>#{title}</title>
|
108
117
|
<content type='text'>#{content}</content>
|
109
|
-
<gd:transparency value='http://schemas.google.com/g/2005#event
|
118
|
+
<gd:transparency value='http://schemas.google.com/g/2005#event.#{transparency}'></gd:transparency>
|
110
119
|
<gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'></gd:eventStatus>
|
111
120
|
<gd:where valueString=\"#{where}\"></gd:where>
|
112
121
|
<gd:when startTime=\"#{start_time}\" endTime=\"#{end_time}\"></gd:when>
|
@@ -149,13 +158,14 @@ module Google
|
|
149
158
|
# Create a new event from a google 'entry' xml block.
|
150
159
|
#
|
151
160
|
def self.new_from_xml(xml, calendar) #:nodoc:
|
152
|
-
id
|
153
|
-
title
|
154
|
-
content
|
155
|
-
where
|
156
|
-
start_time
|
157
|
-
end_time
|
158
|
-
|
161
|
+
id = xml.at_xpath("gCal:uid")['value'].split('@').first
|
162
|
+
title = xml.at_xpath("xmlns:title").content
|
163
|
+
content = xml.at_xpath("xmlns:content").content
|
164
|
+
where = xml.at_xpath("gd:where")['valueString']
|
165
|
+
start_time = xml.at_xpath("gd:when")['startTime']
|
166
|
+
end_time = xml.at_xpath("gd:when")['endTime']
|
167
|
+
transparency = xml.at_xpath("gd:transparency")['value'].split('.').last
|
168
|
+
quickadd = xml.at_xpath("gCal:quickadd") ? xml.at_xpath("gCal:quickadd")['quickadd'] : nil
|
159
169
|
|
160
170
|
Event.new(:id => id,
|
161
171
|
:title => title,
|
@@ -165,6 +175,7 @@ module Google
|
|
165
175
|
:end_time => end_time,
|
166
176
|
:calendar => calendar,
|
167
177
|
:raw_xml => xml,
|
178
|
+
:transparency => transparency,
|
168
179
|
:quickadd => quickadd)
|
169
180
|
end
|
170
181
|
|
metadata
CHANGED
@@ -1,139 +1,137 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_calendar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 2
|
10
|
-
version: 0.2.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Steve Zich
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
type: :runtime
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 15
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 4
|
32
|
-
- 4
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 1.4.4
|
34
|
-
name: nokogiri
|
35
|
-
version_requirements: *id001
|
36
|
-
prerelease: false
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
22
|
type: :runtime
|
39
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
25
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
|
46
|
-
- 2
|
47
|
-
- 2
|
48
|
-
- 2
|
49
|
-
version: 2.2.2
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.4
|
30
|
+
- !ruby/object:Gem::Dependency
|
50
31
|
name: addressable
|
51
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.2.2
|
38
|
+
type: :runtime
|
52
39
|
prerelease: false
|
53
|
-
|
54
|
-
type: :development
|
55
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
41
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
62
|
-
- 0
|
63
|
-
version: "0"
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.2.2
|
46
|
+
- !ruby/object:Gem::Dependency
|
64
47
|
name: shoulda
|
65
|
-
|
66
|
-
|
67
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
68
54
|
type: :development
|
69
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
70
65
|
none: false
|
71
|
-
requirements:
|
66
|
+
requirements:
|
72
67
|
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 23
|
75
|
-
segments:
|
76
|
-
- 1
|
77
|
-
- 0
|
78
|
-
- 0
|
68
|
+
- !ruby/object:Gem::Version
|
79
69
|
version: 1.0.0
|
80
|
-
name: bundler
|
81
|
-
version_requirements: *id004
|
82
|
-
prerelease: false
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
70
|
type: :development
|
85
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
73
|
none: false
|
87
|
-
requirements:
|
74
|
+
requirements:
|
88
75
|
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
|
92
|
-
- 1
|
93
|
-
- 5
|
94
|
-
- 1
|
95
|
-
version: 1.5.1
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.0.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
96
79
|
name: jeweler
|
97
|
-
|
98
|
-
|
99
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.5.1
|
100
86
|
type: :development
|
101
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
89
|
none: false
|
103
|
-
requirements:
|
104
|
-
- -
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
|
107
|
-
|
108
|
-
- 0
|
109
|
-
version: "0"
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.5.1
|
94
|
+
- !ruby/object:Gem::Dependency
|
110
95
|
name: rcov
|
111
|
-
|
112
|
-
|
113
|
-
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
114
102
|
type: :development
|
115
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
105
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
121
|
-
|
122
|
-
- 0
|
123
|
-
version: "0"
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
124
111
|
name: mocha
|
125
|
-
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
126
119
|
prerelease: false
|
127
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
description: A minimal wrapper around the google calendar API, which uses nokogiri
|
127
|
+
for fast parsing.
|
128
128
|
email: steve.zich@gmail.com
|
129
129
|
executables: []
|
130
|
-
|
131
130
|
extensions: []
|
132
|
-
|
133
|
-
extra_rdoc_files:
|
131
|
+
extra_rdoc_files:
|
134
132
|
- LICENSE.txt
|
135
133
|
- README.rdoc
|
136
|
-
files:
|
134
|
+
files:
|
137
135
|
- .document
|
138
136
|
- Gemfile
|
139
137
|
- Gemfile.lock
|
@@ -157,40 +155,34 @@ files:
|
|
157
155
|
- test/mocks/query_events.xml
|
158
156
|
- test/mocks/successful_login.txt
|
159
157
|
- test/test_google_calendar.rb
|
160
|
-
has_rdoc: true
|
161
158
|
homepage: http://github.com/northworld/google_calendar
|
162
|
-
licenses:
|
159
|
+
licenses:
|
163
160
|
- MIT
|
164
161
|
post_install_message:
|
165
162
|
rdoc_options: []
|
166
|
-
|
167
|
-
require_paths:
|
163
|
+
require_paths:
|
168
164
|
- lib
|
169
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
166
|
none: false
|
171
|
-
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
|
175
|
-
segments:
|
167
|
+
requirements:
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
segments:
|
176
172
|
- 0
|
177
|
-
|
178
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
+
hash: -762147376305803347
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
175
|
none: false
|
180
|
-
requirements:
|
181
|
-
- -
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
segments:
|
185
|
-
- 0
|
186
|
-
version: "0"
|
176
|
+
requirements:
|
177
|
+
- - ! '>='
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
187
180
|
requirements: []
|
188
|
-
|
189
181
|
rubyforge_project:
|
190
|
-
rubygems_version: 1.
|
182
|
+
rubygems_version: 1.8.24
|
191
183
|
signing_key:
|
192
184
|
specification_version: 3
|
193
185
|
summary: A lightweight google calendar API wrapper
|
194
|
-
test_files:
|
186
|
+
test_files:
|
195
187
|
- test/helper.rb
|
196
188
|
- test/test_google_calendar.rb
|