google_calendar 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "google_calendar"
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
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 = "2012-12-14"
12
+ s.date = "2012-12-15"
13
13
  s.description = "A minimal wrapper around the google calendar API, which uses nokogiri for fast parsing."
14
14
  s.email = "steve.zich@gmail.com"
15
15
  s.extra_rdoc_files = [
data/lib/google/event.rb CHANGED
@@ -14,9 +14,10 @@ module Google
14
14
  # * +end_time+ - The end time of the event (Time object, defaults to one hour from now), read/write.
15
15
  # * +calendar+ - What calendar the event belongs to, read/write.
16
16
  # * +raw_xml+ - The full google xml representation of the event.
17
+ # * +html_link+ - An absolute link to this event in the Google Calendar Web UI. Read-only.
17
18
  #
18
19
  class Event
19
- attr_reader :id, :raw_xml
20
+ attr_reader :id, :raw_xml, :html_link
20
21
  attr_accessor :title, :content, :where, :calendar, :quickadd, :transparency
21
22
 
22
23
  # Create a new event, and optionally set it's attributes.
@@ -30,6 +31,7 @@ module Google
30
31
  # :calendar => calendar_object)
31
32
  #
32
33
  def initialize(params = {})
34
+
33
35
  @id = params[:id]
34
36
  @title = params[:title]
35
37
  @content = params[:content]
@@ -41,6 +43,8 @@ module Google
41
43
  @raw_xml = params[:raw_xml]
42
44
  @quickadd = params[:quickadd]
43
45
  @transparency = params[:transparency]
46
+ @html_link = params[:html_link]
47
+
44
48
  end
45
49
 
46
50
  # Sets the start time of the Event. Must be a Time object or a parsable string representation of a time.
@@ -166,6 +170,7 @@ module Google
166
170
  end_time = xml.at_xpath("gd:when")['endTime']
167
171
  transparency = xml.at_xpath("gd:transparency")['value'].split('.').last
168
172
  quickadd = xml.at_xpath("gCal:quickadd") ? xml.at_xpath("gCal:quickadd")['quickadd'] : nil
173
+ html_link = xml.at_xpath('//xmlns:link[@title="alternate" and @rel="alternate" and @type="text/html"]')['href']
169
174
 
170
175
  Event.new(:id => id,
171
176
  :title => title,
@@ -176,7 +181,8 @@ module Google
176
181
  :calendar => calendar,
177
182
  :raw_xml => xml,
178
183
  :transparency => transparency,
179
- :quickadd => quickadd)
184
+ :quickadd => quickadd,
185
+ :html_link => html_link)
180
186
  end
181
187
 
182
188
  # Set the ID after google assigns it (only necessary when we are creating a new event)
@@ -190,4 +196,4 @@ module Google
190
196
  end
191
197
 
192
198
  end
193
- end
199
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
12
+ date: 2012-12-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  segments:
172
172
  - 0
173
- hash: -762147376305803347
173
+ hash: 1294707943498499425
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  none: false
176
176
  requirements: