google_calendar 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -2,6 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  google_calendar (0.4.3)
5
+ json (~> 1.8)
5
6
  signet (~> 0.5)
6
7
 
7
8
  GEM
@@ -12,7 +13,7 @@ GEM
12
13
  builder (3.2.2)
13
14
  celluloid (0.16.0)
14
15
  timers (~> 4.0.0)
15
- codeclimate-test-reporter (0.4.1)
16
+ codeclimate-test-reporter (0.4.2)
16
17
  simplecov (>= 0.7.1, < 1.0.0)
17
18
  coderay (1.1.0)
18
19
  docile (1.1.5)
@@ -20,7 +21,7 @@ GEM
20
21
  multipart-post (>= 1.2, < 3)
21
22
  ffi (1.9.6)
22
23
  formatador (0.2.5)
23
- guard (2.8.2)
24
+ guard (2.10.1)
24
25
  formatador (>= 0.2.4)
25
26
  listen (~> 2.7)
26
27
  lumberjack (~> 1.0)
@@ -32,7 +33,7 @@ GEM
32
33
  hitimes (1.2.2)
33
34
  json (1.8.1)
34
35
  jwt (1.2.0)
35
- listen (2.8.0)
36
+ listen (2.8.3)
36
37
  celluloid (>= 0.15.2)
37
38
  rb-fsevent (>= 0.9.3)
38
39
  rb-inotify (>= 0.9)
@@ -40,7 +41,7 @@ GEM
40
41
  metaclass (0.0.4)
41
42
  method_source (0.8.2)
42
43
  minitest (5.4.3)
43
- minitest-reporters (1.0.7)
44
+ minitest-reporters (1.0.8)
44
45
  ansi
45
46
  builder
46
47
  minitest (>= 5.0)
@@ -53,7 +54,7 @@ GEM
53
54
  coderay (~> 1.1.0)
54
55
  method_source (~> 0.8.1)
55
56
  slop (~> 3.4)
56
- rake (10.3.2)
57
+ rake (10.4.2)
57
58
  rb-fsevent (0.9.4)
58
59
  rb-inotify (0.9.5)
59
60
  ffi (>= 0.5.0)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "google_calendar"
5
- s.version = "0.4.3"
5
+ s.version = "0.4.4"
6
6
  s.date = "2014-11-30"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.rubygems_version = "2.2.2"
28
28
 
29
29
  s.add_runtime_dependency(%q<signet>, ["~> 0.5"])
30
+ s.add_runtime_dependency(%q<json>, ["~> 1.8"])
30
31
 
31
32
  s.add_development_dependency(%q<terminal-notifier-guard>, ["~> 1.6"])
32
33
  s.add_development_dependency(%q<rb-fsevent>, ["~> 0.9"])
data/lib/google/event.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'time'
2
+ require 'json'
2
3
 
3
4
  module Google
4
5
 
@@ -8,6 +9,7 @@ module Google
8
9
  # === Attributes
9
10
  #
10
11
  # * +id+ - The google assigned id of the event (nil until saved). Read only.
12
+ # * +status+ - The status of the event (confirmed, tentative or cancelled). Read only.
11
13
  # * +title+ - The title of the event. Read Write.
12
14
  # * +description+ - The content of the event. Read Write.
13
15
  # * +location+ - The location of the event. Read Write.
@@ -24,7 +26,7 @@ module Google
24
26
  # * +raw+ - The full google json representation of the event. Read only.
25
27
  #
26
28
  class Event
27
- attr_reader :id, :raw, :html_link
29
+ attr_reader :id, :raw, :html_link, :status
28
30
  attr_accessor :title, :location, :calendar, :quickadd, :transparency, :attendees, :description, :reminders
29
31
 
30
32
  #
@@ -47,7 +49,7 @@ module Google
47
49
  # ]
48
50
  #
49
51
  def initialize(params = {})
50
- [:id, :raw, :html_link, :title, :location, :calendar, :quickadd, :attendees, :description, :reminders, :start_time, :end_time, ].each do |attribute|
52
+ [:id, :status, :raw, :html_link, :title, :location, :calendar, :quickadd, :attendees, :description, :reminders, :start_time, :end_time, ].each do |attribute|
51
53
  instance_variable_set("@#{attribute}", params[attribute])
52
54
  end
53
55
 
@@ -231,7 +233,7 @@ module Google
231
233
  # String representation of an event object.
232
234
  #
233
235
  def to_s
234
- "Event Id '#{self.id}'\n\tTitle: #{title}\n\tStarts: #{start_time}\n\tEnds: #{end_time}\n\tLocation: #{location}\n\tDescription: #{description}\n\n"
236
+ "Event Id '#{self.id}'\n\tStatus: #{status}\n\tTitle: #{title}\n\tStarts: #{start_time}\n\tEnds: #{end_time}\n\tLocation: #{location}\n\tDescription: #{description}\n\n"
235
237
  end
236
238
 
237
239
  #
@@ -274,6 +276,7 @@ module Google
274
276
  def self.new_from_feed(e, calendar) #:nodoc:
275
277
  Event.new(:id => e['id'],
276
278
  :calendar => calendar,
279
+ :status => e['status'],
277
280
  :raw => e,
278
281
  :title => e['summary'],
279
282
  :description => e['description'],
@@ -190,7 +190,7 @@ class TestGoogleCalendar < Minitest::Test
190
190
  @client_mock.stubs(:body).returns( get_mock_body("query_events.json") )
191
191
  event = @calendar.find_events('Test')
192
192
  e = event[0]
193
- assert_equal e.to_s, "Event Id '#{e.id}'\n\tTitle: #{e.title}\n\tStarts: #{e.start_time}\n\tEnds: #{e.end_time}\n\tLocation: #{e.location}\n\tDescription: #{e.description}\n\n"
193
+ assert_equal e.to_s, "Event Id '#{e.id}'\n\tStatus: #{e.status}\n\tTitle: #{e.title}\n\tStarts: #{e.start_time}\n\tEnds: #{e.end_time}\n\tLocation: #{e.location}\n\tDescription: #{e.description}\n\n"
194
194
  end
195
195
 
196
196
  should "update an event by id" do
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.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.5'
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.8'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.8'
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: terminal-notifier-guard
32
48
  requirement: !ruby/object:Gem::Requirement