ical2gcal 0.5.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b15751f45dc2db6d9c0a261ccceccfd608980fe0d93ed8f8a3f2a00a7c0eec78
4
+ data.tar.gz: b148860065fb884108e5aad44c106a7b8f51313c98a5aeca2027b8448e3932ea
5
+ SHA512:
6
+ metadata.gz: 971f3d099771b3c987de9fdc34038ce37ad981278d1189b380701218ac7d8ea8585aaf78cdab46d32035e53c2730ae402b9409a91875b423b207bb58a75eaf6c
7
+ data.tar.gz: ff67b850ddcc3e04412b1ae7afd1423e70da6fdb0ca5aac45906e0e8debc9d5e96324b5cddda91d27eeea8464bc582def034c77050bb60c113a3330483b42fa8
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --color
2
+ -f d
data/Gemfile CHANGED
@@ -1,24 +1,12 @@
1
1
  # -*- mode: ruby -*-
2
2
 
3
3
  source "http://rubygems.org"
4
- # Add dependencies required to use your gem here.
5
- # Example:
6
- # gem "activesupport", ">= 2.3.5"
4
+
5
+ gemspec
7
6
 
8
7
  # Add dependencies to develop your gem here.
9
8
  # Include everything needed to run rake, tests, features, etc.
10
- gem 'ri_cal'
11
- gem 'google-api-client'
12
9
 
13
- group :development do
14
- gem "rspec"
15
- gem "bundler"
16
- gem "jeweler"
17
- if RUBY_VERSION < '1.9'
18
- gem "ruby-debug"
19
- gem "rcov", ">= 0"
20
- else
21
- gem "debugger"
22
- gem 'simplecov'
23
- end
24
- end
10
+ gem "rake", "~> 13.0"
11
+ gem "rspec"
12
+ gem "pry-byebug"
data/HISTORY.md ADDED
@@ -0,0 +1,14 @@
1
+ ## v0.7 ( 2022-01-09 )
2
+
3
+ * support Ruby version only 2.5, 2.6, 2.7
4
+ * drop Jeweler for simlifying dependencies and packaging gem
5
+
6
+ ## v0.6 ( unreleased )
7
+
8
+ * drop support ruby 1.8 & 1.9
9
+
10
+ ## v0.5 ( 2014-12-07 )
11
+
12
+ * change that how to specify calendar from name to ID
13
+ * change that how to save the authentication information from Pit to Credential
14
+ * change that how to access google api from v2 to v3 ( from gcalapi gem to google-api-client gem )
data/README.rdoc CHANGED
@@ -12,7 +12,7 @@ sync ics(es) to google calendar
12
12
  == Requirements
13
13
 
14
14
  * PC :-)
15
- * Ruby ( tested with CRuby 1.9.3)
15
+ * Ruby ( tested with CRuby 2.5, 2.6, 2.7 )
16
16
  * ri_cal http://ri-cal.rubyforge.org/
17
17
  * google-api-ruby-client https://github.com/google/google-api-ruby-client
18
18
 
data/Rakefile CHANGED
@@ -1,63 +1,10 @@
1
1
  # -*- mode: ruby -*-
2
2
 
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "ical2gcal"
18
- gem.homepage = "http://github.com/wtnabe/ical2gcal"
19
- gem.license = "two-clause BSD"
20
- gem.summary = %Q{sync ics(es) to google calendar}
21
- gem.description = %Q{You can sync local and remote ics file(s) to google calendar}
22
- gem.email = "wtnabe@gmail.com"
23
- gem.authors = ["wtnabe"]
24
- gem.executables = %w( ical2gcal )
25
- # Include your dependencies below. Runtime dependencies are required when using your gem,
26
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
27
-
28
- gem.add_runtime_dependency 'ri_cal'
29
- gem.add_runtime_dependency 'google-api-client'
30
-
31
- # gem.add_development_dependency 'rspec', '> 1.2.3'
32
- end
33
- Jeweler::RubygemsDotOrgTasks.new
34
-
35
- require 'rspec/core'
3
+ require 'bundler/gem_tasks'
36
4
  require 'rspec/core/rake_task'
5
+
37
6
  RSpec::Core::RakeTask.new(:spec) do |spec|
38
7
  spec.pattern = FileList['spec/**/*_spec.rb']
39
8
  end
40
9
 
41
- RSpec::Core::RakeTask.new(:rcov) do |spec|
42
- spec.pattern = 'spec/**/*_spec.rb'
43
- spec.rcov = true
44
- end
45
-
46
- task :default => :spec
47
-
48
- require 'rdoc/task'
49
- Rake::RDocTask.new do |rdoc|
50
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
51
-
52
- rdoc.rdoc_dir = 'rdoc'
53
- rdoc.title = "ical2gcal #{version}"
54
- rdoc.rdoc_files.include('README*')
55
- rdoc.rdoc_files.include('lib/**/*.rb')
56
- end
57
-
58
- namespace :git do
59
- desc 'git ls-files -o'
60
- task :untracked do
61
- sh 'git ls-files -o -X .gitignore'
62
- end
63
- end
10
+ task default: :spec
File without changes
data/ical2gcal.gemspec CHANGED
@@ -1,85 +1,35 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # frozen_string_literal: true
5
2
 
6
- Gem::Specification.new do |s|
7
- s.name = "ical2gcal"
8
- s.version = "0.5.2"
3
+ require_relative "lib/ical2gcal/version"
9
4
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["wtnabe"]
12
- s.date = "2014-12-08"
13
- s.description = "You can sync local and remote ics file(s) to google calendar"
14
- s.email = "wtnabe@gmail.com"
15
- s.executables = ["ical2gcal"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".document",
22
- ".rspec",
23
- ".travis.yml",
24
- "Gemfile",
25
- "LICENSE.txt",
26
- "README.rdoc",
27
- "Rakefile",
28
- "VERSION",
29
- "bin/ical2gcal",
30
- "ical2gcal.gemspec",
31
- "lib/google.rb",
32
- "lib/ical2gcal.rb",
33
- "lib/ics.rb",
34
- "lib/ics/events.rb",
35
- "lib/ics/list.rb",
36
- "spec/ical2gcal_spec.rb",
37
- "spec/ics/events_spec.rb",
38
- "spec/ics/list_spec.rb",
39
- "spec/spec_helper.rb",
40
- "spec/support/ics_list.txt",
41
- "spec/support/japanese_holidays.ics"
42
- ]
43
- s.homepage = "http://github.com/wtnabe/ical2gcal"
44
- s.licenses = ["two-clause BSD"]
45
- s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.23.2"
47
- s.summary = "sync ics(es) to google calendar"
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "ical2gcal"
7
+ spec.version = Ical2gcal::VERSION
8
+ spec.authors = ["wtnabe"]
9
+ spec.email = ["18510+wtnabe@userspec.noreply.github.com"]
48
10
 
49
- if s.respond_to? :specification_version then
50
- s.specification_version = 3
11
+ spec.summary = "sync ics(es) to google calendar"
12
+ spec.description = "You can sync local and remote ics file(s) to google calendar"
13
+ spec.homepage = "http://github.com/wtnabe/ical2gcal"
14
+ spec.required_ruby_version = ">= 2.5.0"
15
+ spec.licenses = ["BSD-2-Clause"]
51
16
 
52
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
- s.add_runtime_dependency(%q<ri_cal>, [">= 0"])
54
- s.add_runtime_dependency(%q<google-api-client>, [">= 0"])
55
- s.add_development_dependency(%q<rspec>, [">= 0"])
56
- s.add_development_dependency(%q<bundler>, [">= 0"])
57
- s.add_development_dependency(%q<jeweler>, [">= 0"])
58
- s.add_development_dependency(%q<debugger>, [">= 0"])
59
- s.add_development_dependency(%q<simplecov>, [">= 0"])
60
- s.add_runtime_dependency(%q<ri_cal>, [">= 0"])
61
- s.add_runtime_dependency(%q<google-api-client>, [">= 0"])
62
- else
63
- s.add_dependency(%q<ri_cal>, [">= 0"])
64
- s.add_dependency(%q<google-api-client>, [">= 0"])
65
- s.add_dependency(%q<rspec>, [">= 0"])
66
- s.add_dependency(%q<bundler>, [">= 0"])
67
- s.add_dependency(%q<jeweler>, [">= 0"])
68
- s.add_dependency(%q<debugger>, [">= 0"])
69
- s.add_dependency(%q<simplecov>, [">= 0"])
70
- s.add_dependency(%q<ri_cal>, [">= 0"])
71
- s.add_dependency(%q<google-api-client>, [">= 0"])
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = spec.homepage
20
+
21
+ spec.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
72
24
  end
73
- else
74
- s.add_dependency(%q<ri_cal>, [">= 0"])
75
- s.add_dependency(%q<google-api-client>, [">= 0"])
76
- s.add_dependency(%q<rspec>, [">= 0"])
77
- s.add_dependency(%q<bundler>, [">= 0"])
78
- s.add_dependency(%q<jeweler>, [">= 0"])
79
- s.add_dependency(%q<debugger>, [">= 0"])
80
- s.add_dependency(%q<simplecov>, [">= 0"])
81
- s.add_dependency(%q<ri_cal>, [">= 0"])
82
- s.add_dependency(%q<google-api-client>, [">= 0"])
83
25
  end
84
- end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
85
29
 
30
+ spec.add_dependency "ri_cal", ">= 0"
31
+ spec.add_dependency "google-api-client", "< 0.8"
32
+ spec.add_dependency "faraday", "< 1"
33
+ spec.add_dependency "retriable", "< 3"
34
+ spec.add_dependency "launchy"
35
+ end
data/lib/google.rb CHANGED
@@ -4,6 +4,7 @@ require 'google/api_client'
4
4
  require 'google/api_client/client_secrets'
5
5
  require 'google/api_client/auth/installed_app'
6
6
  require 'google/api_client/auth/file_storage'
7
+ require_relative '../monkey_patches/multi_json'
7
8
 
8
9
  module Ical2gcal
9
10
  class Google
@@ -34,7 +35,9 @@ module Ical2gcal
34
35
  def init_and_auth_calendar(calendar_id, store)
35
36
  @client = ::Google::APIClient.new(
36
37
  :application_name => :ical2gcal,
37
- :application_version => Version)
38
+ :application_version => Ical2gcal::VERSION,
39
+ :user_agent => "ical2gcal-#{Ical2gcal::VERSION} (#{RUBY_PLATFORM})"
40
+ )
38
41
 
39
42
  credential = ::Google::APIClient::FileStorage.new(store)
40
43
  secrets = ::Google::APIClient::ClientSecrets.load(File.dirname(store))
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ical2gcal
4
+ VERSION = "0.7.0"
5
+ end
data/lib/ical2gcal.rb CHANGED
@@ -1,10 +1,10 @@
1
- require 'rubygems' unless defined? ::Gem
2
1
  require File.dirname( __FILE__ ) + '/ics'
3
2
  require File.dirname( __FILE__ ) + '/google'
4
3
 
5
4
  require 'optparse'
6
5
 
7
- Version = open(File.dirname(__FILE__) + '/../VERSION').read
6
+ require_relative './ical2gcal/version'
7
+ Version = Ical2gcal::VERSION
8
8
 
9
9
  module Ical2gcal
10
10
  class App
@@ -0,0 +1,24 @@
1
+ module MultiJson
2
+ alias_method :orig_load, :load
3
+
4
+ #
5
+ # google-api-client の credentials の読み取りの部分で ActiveSupport
6
+ # の String でも Symbol でもいい具合に扱っている機能に依存していたが
7
+ # MultiJson が ActiveSupport を drop して動かなくなった問題へのパッチ
8
+ #
9
+ # 他の項目は Symbol と String の両方で読み取りを試みるが :flow だけ
10
+ # Symbol しか試みていないので詰め直している
11
+ #
12
+ # @param [String] json_string
13
+ # @return [Object]
14
+ #
15
+ def self.load(json_string)
16
+ json = orig_load(json_string)
17
+
18
+ if json && json.has_key?("flow")
19
+ json[:flow] = json["flow"]
20
+ end
21
+
22
+ json
23
+ end
24
+ end
metadata CHANGED
@@ -1,216 +1,133 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ical2gcal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
5
- prerelease:
4
+ version: 0.7.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - wtnabe
9
8
  autorequire:
10
- bindir: bin
9
+ bindir: exe
11
10
  cert_chain: []
12
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ri_cal
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: google-api-client
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - "<"
36
32
  - !ruby/object:Gem::Version
37
- version: '0'
33
+ version: '0.8'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: rspec
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :development
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
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: jeweler
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- - !ruby/object:Gem::Dependency
95
- name: debugger
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
37
  requirements:
107
- - - ! '>='
38
+ - - "<"
108
39
  - !ruby/object:Gem::Version
109
- version: '0'
40
+ version: '0.8'
110
41
  - !ruby/object:Gem::Dependency
111
- name: simplecov
42
+ name: faraday
112
43
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
44
  requirements:
115
- - - ! '>='
45
+ - - "<"
116
46
  - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
47
+ version: '1'
48
+ type: :runtime
119
49
  prerelease: false
120
50
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
51
  requirements:
123
- - - ! '>='
52
+ - - "<"
124
53
  - !ruby/object:Gem::Version
125
- version: '0'
54
+ version: '1'
126
55
  - !ruby/object:Gem::Dependency
127
- name: ri_cal
56
+ name: retriable
128
57
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
58
  requirements:
131
- - - ! '>='
59
+ - - "<"
132
60
  - !ruby/object:Gem::Version
133
- version: '0'
61
+ version: '3'
134
62
  type: :runtime
135
63
  prerelease: false
136
64
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
65
  requirements:
139
- - - ! '>='
66
+ - - "<"
140
67
  - !ruby/object:Gem::Version
141
- version: '0'
68
+ version: '3'
142
69
  - !ruby/object:Gem::Dependency
143
- name: google-api-client
70
+ name: launchy
144
71
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
72
  requirements:
147
- - - ! '>='
73
+ - - ">="
148
74
  - !ruby/object:Gem::Version
149
75
  version: '0'
150
76
  type: :runtime
151
77
  prerelease: false
152
78
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
79
  requirements:
155
- - - ! '>='
80
+ - - ">="
156
81
  - !ruby/object:Gem::Version
157
82
  version: '0'
158
83
  description: You can sync local and remote ics file(s) to google calendar
159
- email: wtnabe@gmail.com
84
+ email:
85
+ - 18510+wtnabe@userspec.noreply.github.com
160
86
  executables:
161
87
  - ical2gcal
162
88
  extensions: []
163
- extra_rdoc_files:
164
- - LICENSE.txt
165
- - README.rdoc
89
+ extra_rdoc_files: []
166
90
  files:
167
- - .document
168
- - .rspec
169
- - .travis.yml
91
+ - ".document"
92
+ - ".rspec"
170
93
  - Gemfile
94
+ - HISTORY.md
171
95
  - LICENSE.txt
172
96
  - README.rdoc
173
97
  - Rakefile
174
- - VERSION
175
- - bin/ical2gcal
98
+ - exe/ical2gcal
176
99
  - ical2gcal.gemspec
177
100
  - lib/google.rb
178
101
  - lib/ical2gcal.rb
102
+ - lib/ical2gcal/version.rb
179
103
  - lib/ics.rb
180
104
  - lib/ics/events.rb
181
105
  - lib/ics/list.rb
182
- - spec/ical2gcal_spec.rb
183
- - spec/ics/events_spec.rb
184
- - spec/ics/list_spec.rb
185
- - spec/spec_helper.rb
186
- - spec/support/ics_list.txt
187
- - spec/support/japanese_holidays.ics
106
+ - monkey_patches/multi_json.rb
188
107
  homepage: http://github.com/wtnabe/ical2gcal
189
108
  licenses:
190
- - two-clause BSD
109
+ - BSD-2-Clause
110
+ metadata:
111
+ allowed_push_host: https://rubygems.org
112
+ homepage_uri: http://github.com/wtnabe/ical2gcal
113
+ source_code_uri: http://github.com/wtnabe/ical2gcal
191
114
  post_install_message:
192
115
  rdoc_options: []
193
116
  require_paths:
194
117
  - lib
195
118
  required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
119
  requirements:
198
- - - ! '>='
120
+ - - ">="
199
121
  - !ruby/object:Gem::Version
200
- version: '0'
201
- segments:
202
- - 0
203
- hash: 2105286359183255494
122
+ version: 2.5.0
204
123
  required_rubygems_version: !ruby/object:Gem::Requirement
205
- none: false
206
124
  requirements:
207
- - - ! '>='
125
+ - - ">="
208
126
  - !ruby/object:Gem::Version
209
127
  version: '0'
210
128
  requirements: []
211
- rubyforge_project:
212
- rubygems_version: 1.8.23.2
129
+ rubygems_version: 3.1.6
213
130
  signing_key:
214
- specification_version: 3
131
+ specification_version: 4
215
132
  summary: sync ics(es) to google calendar
216
133
  test_files: []
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - ree
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.5.2
@@ -1,4 +0,0 @@
1
- require File.dirname(__FILE__) + "/spec_helper"
2
-
3
- describe Ical2gcal::App do
4
- end
@@ -1,27 +0,0 @@
1
- require File.dirname( __FILE__ ) + '/../spec_helper'
2
-
3
- HOLIDAYS = File.dirname( __FILE__ ) + '/../support/japanese_holidays.ics'
4
-
5
- describe Ical2gcal::Ics::Events do
6
- describe 'get' do
7
- it {
8
- events = Ical2gcal::Ics::Events.new( HOLIDAYS ).get
9
- events.class.should be Array
10
- events.size.should > 0
11
- events.each { |e|
12
- e.class.should be RiCal::Component::Event
13
- }
14
- }
15
- end
16
-
17
- describe 'each' do
18
- it {
19
- count = 0
20
- Ical2gcal::Ics::Events.new( HOLIDAYS ).each { |e|
21
- e.class.should be RiCal::Component::Event
22
- count += 1
23
- }
24
- count.should > 0
25
- }
26
- end
27
- end
@@ -1,60 +0,0 @@
1
- require File.dirname( __FILE__ ) + '/../spec_helper'
2
-
3
- ICS_FILE = File.dirname( __FILE__ ) + '/../support/ics_list.txt'
4
- JAPANESE_HOLIDAYS = 'https://www.google.com/calendar/ical/japanese%40holiday.calendar.google.com/public/basic.ics'
5
-
6
- describe Ical2gcal::Ics::List do
7
- describe 'import' do
8
- context 'localfile' do
9
- it {
10
- Ical2gcal::Ics::List.new( ICS_FILE ).import.class.should be Array
11
- }
12
- end
13
- context 'uri' do
14
- it {
15
- Ical2gcal::Ics::List.new( JAPANESE_HOLIDAYS ).import.class.should be Array
16
- }
17
- end
18
- context 'with uri' do
19
- it {
20
- Ical2gcal::Ics::List.new.import( ICS_FILE ).class.should be Array
21
- }
22
- end
23
- context 'no data given' do
24
- it {
25
- Ical2gcal::Ics::List.new.import.should be_nil
26
- }
27
- end
28
- end
29
-
30
- describe 'list' do
31
- context 'localfile' do
32
- it {
33
- ics = Ical2gcal::Ics::List.new( ICS_FILE )
34
- ics.import
35
- ics.list.class.should be Array
36
- }
37
- end
38
- context 'no data given' do
39
- it {
40
- ics = Ical2gcal::Ics::List.new
41
- ics.import
42
- ics.list.class.should be Array
43
- ics.list.size == 0
44
- }
45
- end
46
- end
47
-
48
- describe 'with_scheme?' do
49
- context 'localfile' do
50
- it {
51
- Ical2gcal::Ics::List.new( ICS_FILE ).with_scheme?.should == false
52
- }
53
- end
54
- context 'uri' do
55
- it {
56
- Ical2gcal::Ics::List.new( JAPANESE_HOLIDAYS ).with_scheme?.should == true
57
- }
58
- end
59
- end
60
- end