ical2gcal 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/ical2gcal.gemspec +3 -3
  3. data/lib/google.rb +8 -7
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ical2gcal"
8
- s.version = "0.5.0"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["wtnabe"]
12
- s.date = "2014-12-07"
12
+ s.date = "2014-12-08"
13
13
  s.description = "You can sync local and remote ics file(s) to google calendar"
14
14
  s.email = "wtnabe@gmail.com"
15
15
  s.executables = ["ical2gcal"]
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.homepage = "http://github.com/wtnabe/ical2gcal"
44
44
  s.licenses = ["two-clause BSD"]
45
45
  s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.23"
46
+ s.rubygems_version = "1.8.23.2"
47
47
  s.summary = "sync ics(es) to google calendar"
48
48
 
49
49
  if s.respond_to? :specification_version then
@@ -59,16 +59,17 @@ module Ical2gcal
59
59
  # [return] String
60
60
  #
61
61
  def create_event( event )
62
- body = {
63
- :summary => event.summary,
64
- :description => event.description,
65
- :location => event.location
66
- }
62
+ body = {:summary => event.summary.force_encoding('UTF-8')}
63
+ body.merge!(:description => event.description.force_encoding('UTF-8')) if event.description
64
+ body.merge!(:location => event.location.force_encoding('UTF-8')) if event.location
67
65
 
68
66
  if all_day?(event)
67
+ start_date = event.dtstart.to_s
68
+ end_date = event.dtend.to_s
69
+
69
70
  body.merge!(
70
- :start => {:date => event.dtstart.to_s},
71
- :end => {:date => event.dtend.to_s})
71
+ :start => {:date => start_date},
72
+ :end => {:date => end_date.size > 0 ? end_date : (Date.parse(start_date) + 1).to_s})
72
73
  else
73
74
  body.merge!(
74
75
  :start => {:dateTime => localtime(event.start_time)},
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ical2gcal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
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: 2014-12-07 00:00:00.000000000 Z
12
+ date: 2014-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ri_cal
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  segments:
202
202
  - 0
203
- hash: 3072721261050515473
203
+ hash: 2105286359183255494
204
204
  required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 1.8.23
212
+ rubygems_version: 1.8.23.2
213
213
  signing_key:
214
214
  specification_version: 3
215
215
  summary: sync ics(es) to google calendar