gcal-ruby 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.1.3 fix own calendars
1
2
  v0.1.2 added options for events list
2
3
  v0.1.1 added calendar events
3
4
  v0.1.0 first release
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('gcal-ruby', '0.1.2') do |p|
6
+ Echoe.new('gcal-ruby', '0.1.3') do |p|
7
7
  p.description = "Ruby library for Google Calendar API."
8
8
  p.url = "http://github.com/23ninja/gcal-ruby"
9
9
  p.author = "Iskander Haziev"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{gcal-ruby}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [%q{Iskander Haziev}]
@@ -17,12 +17,13 @@ module GCal
17
17
  end
18
18
 
19
19
  class << self
20
- def parse(entry)
20
+ def parse(entry, path)
21
+ calendar_home_url = 'http://www.google.com/calendar/feeds'
21
22
  parse_time = Time.respond_to?(:parse)
22
23
  calendar = self.new
23
-
24
+
24
25
  # common info
25
- calendar.id = entry['id'][0].gsub('http://www.google.com/calendar/feeds/default/allcalendars/full/', '')
26
+ calendar.id = entry['id'][0].gsub(calendar_home_url + path, '')
26
27
  calendar.title = entry['title'][0]['content']
27
28
  calendar.link = entry['link'][0]['href']
28
29
  calendar.access_level = entry['accesslevel'][0]['value']
@@ -25,19 +25,21 @@ module GCal
25
25
  end
26
26
 
27
27
  def all_calendars
28
- xml = call("/default/allcalendars/full")
28
+ path = "/default/allcalendars/full/"
29
+ xml = call(path)
29
30
  calendars = []
30
31
  xml['entry'].each do |entry|
31
- calendars << GCal::Calendar.parse(entry)
32
+ calendars << GCal::Calendar.parse(entry, path)
32
33
  end if xml['entry']
33
34
  calendars
34
35
  end
35
36
 
36
37
  def own_calendars
37
- xml = call("/default/owncalendars/full")
38
+ path = "/default/owncalendars/full/"
39
+ xml = call(path)
38
40
  calendars = []
39
41
  xml['entry'].each do |entry|
40
- calendars << GCal::Calendar.parse(entry)
42
+ calendars << GCal::Calendar.parse(entry, path)
41
43
  end if xml['entry']
42
44
  calendars
43
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcal-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth
16
- requirement: &2165531020 !ruby/object:Gem::Requirement
16
+ requirement: &2164822020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2165531020
24
+ version_requirements: *2164822020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: typhoeus
27
- requirement: &2165530020 !ruby/object:Gem::Requirement
27
+ requirement: &2164820860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2165530020
35
+ version_requirements: *2164820860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: xml-simple
38
- requirement: &2165528780 !ruby/object:Gem::Requirement
38
+ requirement: &2164819700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2165528780
46
+ version_requirements: *2164819700
47
47
  description: Ruby library for Google Calendar API.
48
48
  email: gvalmon@gmail.com
49
49
  executables: []