google_drive 1.0.0.pre1 → 1.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +9 -2
  3. data/lib/google_drive/api_client_fetcher.rb +3 -0
  4. data/lib/google_drive/authentication_error.rb +2 -2
  5. data/lib/google_drive/error.rb +1 -1
  6. data/lib/google_drive/response_code_error.rb +24 -0
  7. data/lib/google_drive/session.rb +4 -5
  8. data/lib/google_drive/worksheet.rb +39 -45
  9. data/lib/{google_drive_v1.rb → google_drive_v0.rb} +9 -9
  10. data/lib/{google_drive_v1 → google_drive_v0}/acl.rb +7 -7
  11. data/lib/{google_drive_v1 → google_drive_v0}/acl_entry.rb +3 -3
  12. data/lib/{google_drive_v1 → google_drive_v0}/api_client_fetcher.rb +1 -1
  13. data/lib/google_drive_v0/authentication_error.rb +14 -0
  14. data/lib/{google_drive_v1 → google_drive_v0}/basic_fetcher.rb +1 -1
  15. data/lib/{google_drive_v1 → google_drive_v0}/client_login_fetcher.rb +2 -2
  16. data/lib/{google_drive_v1 → google_drive_v0}/collection.rb +12 -12
  17. data/lib/{google_drive_v1 → google_drive_v0}/error.rb +1 -1
  18. data/lib/{google_drive_v1 → google_drive_v0}/file.rb +9 -9
  19. data/lib/{google_drive_v1 → google_drive_v0}/list.rb +15 -15
  20. data/lib/{google_drive_v1 → google_drive_v0}/list_row.rb +4 -4
  21. data/lib/{google_drive_v1 → google_drive_v0}/oauth1_fetcher.rb +1 -1
  22. data/lib/{google_drive_v1 → google_drive_v0}/oauth2_fetcher.rb +2 -2
  23. data/lib/{google_drive_v1 → google_drive_v0}/record.rb +4 -4
  24. data/lib/{google_drive_v1 → google_drive_v0}/session.rb +45 -45
  25. data/lib/{google_drive_v1 → google_drive_v0}/spreadsheet.rb +17 -17
  26. data/lib/{google_drive_v1 → google_drive_v0}/table.rb +6 -6
  27. data/lib/{google_drive_v1 → google_drive_v0}/util.rb +1 -1
  28. data/lib/{google_drive_v1 → google_drive_v0}/worksheet.rb +13 -13
  29. metadata +23 -22
  30. data/lib/google_drive_v1/authentication_error.rb +0 -14
@@ -2,7 +2,7 @@
2
2
  # The license of this source is "New BSD Licence"
3
3
 
4
4
 
5
- module GoogleDriveV1
5
+ module GoogleDriveV0
6
6
 
7
7
  # Raised when spreadsheets.google.com has returned error.
8
8
  class Error < RuntimeError
@@ -4,15 +4,15 @@
4
4
  require "cgi"
5
5
  require "stringio"
6
6
 
7
- require "google_drive_v1/util"
8
- require "google_drive_v1/acl"
7
+ require "google_drive_v0/util"
8
+ require "google_drive_v0/acl"
9
9
 
10
10
 
11
- module GoogleDriveV1
11
+ module GoogleDriveV0
12
12
 
13
13
  # A file in Google Drive, including Google Docs document/spreadsheet/presentation.
14
14
  #
15
- # Use GoogleDriveV1::Session#files or GoogleDriveV1::Session#file_by_title to
15
+ # Use GoogleDriveV0::Session#files or GoogleDriveV0::Session#file_by_title to
16
16
  # get this object.
17
17
  class File
18
18
 
@@ -47,7 +47,7 @@ module GoogleDriveV1
47
47
  # Set <tt>params[:reload]</tt> to true to force reloading the feed.
48
48
  def document_feed_entry(params = {})
49
49
  warn(
50
- "WARNING: GoogleDriveV1::file\#document_feed_entry is deprecated and will be removed " +
50
+ "WARNING: GoogleDriveV0::file\#document_feed_entry is deprecated and will be removed " +
51
51
  "in the next version.")
52
52
  return self.document_feed_entry_internal(params)
53
53
  end
@@ -95,7 +95,7 @@ module GoogleDriveV1
95
95
  # URL of old API version. Converts to v3 URL.
96
96
  return "#{DOCS_BASE_URL}/#{$1}/acl"
97
97
  else
98
- raise(GoogleDriveV1::Error,
98
+ raise(GoogleDriveV0::Error,
99
99
  "ACL feed URL is in unknown format: #{orig_acl_feed_url}")
100
100
  end
101
101
  end
@@ -145,12 +145,12 @@ module GoogleDriveV1
145
145
  url = contents[0]["src"]
146
146
  else
147
147
  if contents.empty?
148
- raise(GoogleDriveV1::Error,
148
+ raise(GoogleDriveV0::Error,
149
149
  ("Downloading with content type %p not supported for this file. " +
150
150
  "Specify one of these to content_type: %p") %
151
151
  [params[:content_type], self.available_content_types])
152
152
  else
153
- raise(GoogleDriveV1::Error,
153
+ raise(GoogleDriveV0::Error,
154
154
  ("Multiple content types are available for this file. " +
155
155
  "Specify one of these to content_type: %p") %
156
156
  [self.available_content_types])
@@ -214,7 +214,7 @@ module GoogleDriveV1
214
214
 
215
215
  alias title= rename
216
216
 
217
- # Returns GoogleDriveV1::Acl object for the file.
217
+ # Returns GoogleDriveV0::Acl object for the file.
218
218
  #
219
219
  # With the object, you can see and modify people who can access the file.
220
220
  # Modifications take effect immediately.
@@ -1,19 +1,19 @@
1
1
  # Author: Hiroshi Ichikawa <http://gimite.net/>
2
2
  # The license of this source is "New BSD Licence"
3
3
 
4
- require "google_drive_v1/util"
5
- require "google_drive_v1/error"
6
- require "google_drive_v1/list_row"
4
+ require "google_drive_v0/util"
5
+ require "google_drive_v0/error"
6
+ require "google_drive_v0/list_row"
7
7
 
8
8
 
9
- module GoogleDriveV1
9
+ module GoogleDriveV0
10
10
 
11
11
  # Provides access to cells using column names.
12
- # Use GoogleDriveV1::Worksheet#list to get GoogleDriveV1::List object.
12
+ # Use GoogleDriveV0::Worksheet#list to get GoogleDriveV0::List object.
13
13
  #--
14
- # This is implemented as wrapper of GoogleDriveV1::Worksheet i.e. using cells
14
+ # This is implemented as wrapper of GoogleDriveV0::Worksheet i.e. using cells
15
15
  # feed, not list feed. In this way, we can easily provide consistent API as
16
- # GoogleDriveV1::Worksheet using save()/reload().
16
+ # GoogleDriveV0::Worksheet using save()/reload().
17
17
  class List
18
18
 
19
19
  include(Enumerable)
@@ -27,12 +27,12 @@ module GoogleDriveV1
27
27
  return @worksheet.num_rows - 1
28
28
  end
29
29
 
30
- # Returns Hash-like object (GoogleDriveV1::ListRow) for the row with the
30
+ # Returns Hash-like object (GoogleDriveV0::ListRow) for the row with the
31
31
  # index. Keys of the object are colum names (the first row).
32
32
  # The second row has index 0.
33
33
  #
34
34
  # Note that updates to the returned object are not sent to the server until
35
- # you call GoogleDriveV1::Worksheet#save().
35
+ # you call GoogleDriveV0::Worksheet#save().
36
36
  def [](index)
37
37
  return ListRow.new(self, index)
38
38
  end
@@ -42,12 +42,12 @@ module GoogleDriveV1
42
42
  # The second row has index 0.
43
43
  #
44
44
  # Note that update is not sent to the server until
45
- # you call GoogleDriveV1::Worksheet#save().
45
+ # you call GoogleDriveV0::Worksheet#save().
46
46
  def []=(index, hash)
47
47
  self[index].replace(hash)
48
48
  end
49
49
 
50
- # Iterates over Hash-like object (GoogleDriveV1::ListRow) for each row
50
+ # Iterates over Hash-like object (GoogleDriveV0::ListRow) for each row
51
51
  # (except for the first row).
52
52
  # Keys of the object are colum names (the first row).
53
53
  def each(&block)
@@ -65,7 +65,7 @@ module GoogleDriveV1
65
65
  # Updates column names i.e. the contents of the first row.
66
66
  #
67
67
  # Note that update is not sent to the server until
68
- # you call GoogleDriveV1::Worksheet#save().
68
+ # you call GoogleDriveV0::Worksheet#save().
69
69
  def keys=(ary)
70
70
  for i in 1..ary.size
71
71
  @worksheet[1, i] = ary[i - 1]
@@ -77,10 +77,10 @@ module GoogleDriveV1
77
77
 
78
78
  # Adds a new row to the bottom.
79
79
  # Keys of +hash+ are colum names (the first row).
80
- # Returns GoogleDriveV1::ListRow for the new row.
80
+ # Returns GoogleDriveV0::ListRow for the new row.
81
81
  #
82
82
  # Note that update is not sent to the server until
83
- # you call GoogleDriveV1::Worksheet#save().
83
+ # you call GoogleDriveV0::Worksheet#save().
84
84
  def push(hash)
85
85
  row = self[self.size]
86
86
  row.update(hash)
@@ -110,7 +110,7 @@ module GoogleDriveV1
110
110
  def key_to_col(key)
111
111
  key = key.to_s()
112
112
  col = (1..@worksheet.num_cols).find(){ |c| @worksheet[1, c] == key }
113
- raise(GoogleDriveV1::Error, "Column doesn't exist: %p" % key) if !col
113
+ raise(GoogleDriveV0::Error, "Column doesn't exist: %p" % key) if !col
114
114
  return col
115
115
  end
116
116
 
@@ -3,13 +3,13 @@
3
3
 
4
4
  require "forwardable"
5
5
 
6
- require "google_drive_v1/util"
7
- require "google_drive_v1/error"
6
+ require "google_drive_v0/util"
7
+ require "google_drive_v0/error"
8
8
 
9
9
 
10
- module GoogleDriveV1
10
+ module GoogleDriveV0
11
11
 
12
- # Hash-like object returned by GoogleDriveV1::List#[].
12
+ # Hash-like object returned by GoogleDriveV0::List#[].
13
13
  class ListRow
14
14
 
15
15
  include(Enumerable)
@@ -5,7 +5,7 @@ require "rubygems"
5
5
  require "oauth"
6
6
 
7
7
 
8
- module GoogleDriveV1
8
+ module GoogleDriveV0
9
9
 
10
10
  class OAuth1Fetcher #:nodoc:
11
11
 
@@ -1,10 +1,10 @@
1
1
  # Author: Hiroshi Ichikawa <http://gimite.net/>
2
2
  # The license of this source is "New BSD Licence"
3
3
 
4
- require "google_drive_v1/basic_fetcher"
4
+ require "google_drive_v0/basic_fetcher"
5
5
 
6
6
 
7
- module GoogleDriveV1
7
+ module GoogleDriveV0
8
8
 
9
9
  class OAuth2Fetcher < BasicFetcher #:nodoc:
10
10
 
@@ -1,16 +1,16 @@
1
1
  # Author: Hiroshi Ichikawa <http://gimite.net/>
2
2
  # The license of this source is "New BSD Licence"
3
3
 
4
- require "google_drive_v1/util"
5
- require "google_drive_v1/error"
4
+ require "google_drive_v0/util"
5
+ require "google_drive_v0/error"
6
6
 
7
7
 
8
- module GoogleDriveV1
8
+ module GoogleDriveV0
9
9
 
10
10
  # DEPRECATED: Table and Record feeds are deprecated and they will not be available after
11
11
  # March 2012.
12
12
  #
13
- # Use GoogleDriveV1::Table#records to get GoogleDriveV1::Record objects.
13
+ # Use GoogleDriveV0::Table#records to get GoogleDriveV0::Record objects.
14
14
  class Record < Hash
15
15
  include(Util)
16
16
 
@@ -9,22 +9,22 @@ require "nokogiri"
9
9
  require "oauth"
10
10
  require "oauth2"
11
11
 
12
- require "google_drive_v1/util"
13
- require "google_drive_v1/client_login_fetcher"
14
- require "google_drive_v1/oauth1_fetcher"
15
- require "google_drive_v1/oauth2_fetcher"
16
- require "google_drive_v1/error"
17
- require "google_drive_v1/authentication_error"
18
- require "google_drive_v1/spreadsheet"
19
- require "google_drive_v1/worksheet"
20
- require "google_drive_v1/collection"
21
- require "google_drive_v1/file"
12
+ require "google_drive_v0/util"
13
+ require "google_drive_v0/client_login_fetcher"
14
+ require "google_drive_v0/oauth1_fetcher"
15
+ require "google_drive_v0/oauth2_fetcher"
16
+ require "google_drive_v0/error"
17
+ require "google_drive_v0/authentication_error"
18
+ require "google_drive_v0/spreadsheet"
19
+ require "google_drive_v0/worksheet"
20
+ require "google_drive_v0/collection"
21
+ require "google_drive_v0/file"
22
22
 
23
23
 
24
- module GoogleDriveV1
24
+ module GoogleDriveV0
25
25
 
26
- # Use GoogleDriveV1.login or GoogleDriveV1.saved_session to get
27
- # GoogleDriveV1::Session object.
26
+ # Use GoogleDriveV0.login or GoogleDriveV0.saved_session to get
27
+ # GoogleDriveV0::Session object.
28
28
  class Session
29
29
 
30
30
  include(Util)
@@ -34,17 +34,17 @@ module GoogleDriveV1
34
34
 
35
35
  # DEPRECATED: Will be removed in the next version.
36
36
  #
37
- # The same as GoogleDriveV1.login.
37
+ # The same as GoogleDriveV0.login.
38
38
  def self.login(mail, password, proxy = nil)
39
39
  warn(
40
- "WARNING: GoogleDriveV1.login is deprecated and will be removed in the next version. " +
41
- "Use GoogleDriveV1.login_with_oauth instead.")
40
+ "WARNING: GoogleDriveV0.login is deprecated and will be removed in the next version. " +
41
+ "Use GoogleDriveV0.login_with_oauth instead.")
42
42
  session = Session.new(nil, ClientLoginFetcher.new({}, proxy))
43
43
  session.login(mail, password)
44
44
  return session
45
45
  end
46
46
 
47
- # The same as GoogleDriveV1.login_with_oauth.
47
+ # The same as GoogleDriveV0.login_with_oauth.
48
48
  def self.login_with_oauth(access_token, proxy = nil)
49
49
  if proxy
50
50
  warn(
@@ -56,33 +56,33 @@ module GoogleDriveV1
56
56
  warn(
57
57
  "WARNING: Authorization with OAuth1 is deprecated and will not work in the next version. " +
58
58
  "Use OAuth2 instead.")
59
- raise(GoogleDriveV1::Error, "proxy is not supported with OAuth1.") if proxy
59
+ raise(GoogleDriveV0::Error, "proxy is not supported with OAuth1.") if proxy
60
60
  fetcher = OAuth1Fetcher.new(access_token)
61
61
  when OAuth2::AccessToken
62
62
  fetcher = OAuth2Fetcher.new(access_token.token, proxy)
63
63
  when String
64
64
  fetcher = OAuth2Fetcher.new(access_token, proxy)
65
65
  else
66
- raise(GoogleDriveV1::Error,
66
+ raise(GoogleDriveV0::Error,
67
67
  "access_token is neither String, OAuth2::Token nor OAuth::Token: %p" % access_token)
68
68
  end
69
69
  return Session.new(nil, fetcher)
70
70
  end
71
71
 
72
- # The same as GoogleDriveV1.restore_session.
72
+ # The same as GoogleDriveV0.restore_session.
73
73
  def self.restore_session(auth_tokens, proxy = nil)
74
74
  warn(
75
- "WARNING: GoogleDriveV1.restore_session is deprecated and will be removed in the next version. " +
76
- "Use GoogleDriveV1.login_with_oauth instead.")
75
+ "WARNING: GoogleDriveV0.restore_session is deprecated and will be removed in the next version. " +
76
+ "Use GoogleDriveV0.login_with_oauth instead.")
77
77
  return Session.new(auth_tokens, nil, proxy)
78
78
  end
79
79
 
80
- # Creates a dummy GoogleDriveV1::Session object for testing.
80
+ # Creates a dummy GoogleDriveV0::Session object for testing.
81
81
  def self.new_dummy()
82
82
  return Session.new(nil, Object.new())
83
83
  end
84
84
 
85
- # DEPRECATED: Use GoogleDriveV1.restore_session instead.
85
+ # DEPRECATED: Use GoogleDriveV0.restore_session instead.
86
86
  def initialize(auth_tokens = nil, fetcher = nil, proxy = nil)
87
87
  if fetcher
88
88
  @fetcher = fetcher
@@ -92,11 +92,11 @@ module GoogleDriveV1
92
92
  end
93
93
 
94
94
  # Authenticates with given +mail+ and +password+, and updates current session object
95
- # if succeeds. Raises GoogleDriveV1::AuthenticationError if fails.
95
+ # if succeeds. Raises GoogleDriveV0::AuthenticationError if fails.
96
96
  # Google Apps account is supported.
97
97
  def login(mail, password)
98
98
  if !@fetcher.is_a?(ClientLoginFetcher)
99
- raise(GoogleDriveV1::Error,
99
+ raise(GoogleDriveV0::Error,
100
100
  "Cannot call login for session created by login_with_oauth.")
101
101
  end
102
102
  begin
@@ -104,7 +104,7 @@ module GoogleDriveV1
104
104
  :wise => authenticate(mail, password, :wise),
105
105
  :writely => authenticate(mail, password, :writely),
106
106
  }
107
- rescue GoogleDriveV1::Error => ex
107
+ rescue GoogleDriveV0::Error => ex
108
108
  return true if @on_auth_fail && @on_auth_fail.call()
109
109
  raise(AuthenticationError, "Authentication failed for #{mail}: #{ex.message}")
110
110
  end
@@ -113,9 +113,9 @@ module GoogleDriveV1
113
113
  # Authentication tokens.
114
114
  def auth_tokens
115
115
  warn(
116
- "WARNING: GoogleDriveV1::Session\#auth_tokens is deprecated and will be removed in the next version.")
116
+ "WARNING: GoogleDriveV0::Session\#auth_tokens is deprecated and will be removed in the next version.")
117
117
  if !@fetcher.is_a?(ClientLoginFetcher)
118
- raise(GoogleDriveV1::Error,
118
+ raise(GoogleDriveV0::Error,
119
119
  "Cannot call auth_tokens for session created by " +
120
120
  "login_with_oauth.")
121
121
  end
@@ -125,7 +125,7 @@ module GoogleDriveV1
125
125
  # Authentication token.
126
126
  def auth_token(auth = :wise)
127
127
  warn(
128
- "WARNING: GoogleDriveV1::Session\#auth_token is deprecated and will be removed in the next version.")
128
+ "WARNING: GoogleDriveV0::Session\#auth_token is deprecated and will be removed in the next version.")
129
129
  return self.auth_tokens[auth]
130
130
  end
131
131
 
@@ -133,17 +133,17 @@ module GoogleDriveV1
133
133
  # When this function returns +true+, it tries again.
134
134
  def on_auth_fail
135
135
  warn(
136
- "WARNING: GoogleDriveV1::Session\#on_auth_fail is deprecated and will be removed in the next version.")
136
+ "WARNING: GoogleDriveV0::Session\#on_auth_fail is deprecated and will be removed in the next version.")
137
137
  return @on_auth_fail
138
138
  end
139
139
 
140
140
  def on_auth_fail=(func)
141
141
  warn(
142
- "WARNING: GoogleDriveV1::Session\#on_auth_fail is deprecated and will be removed in the next version.")
142
+ "WARNING: GoogleDriveV0::Session\#on_auth_fail is deprecated and will be removed in the next version.")
143
143
  @on_auth_fail = func
144
144
  end
145
145
 
146
- # Returns list of files for the user as array of GoogleDriveV1::File or its subclass.
146
+ # Returns list of files for the user as array of GoogleDriveV0::File or its subclass.
147
147
  # You can specify query parameters described at
148
148
  # https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files
149
149
  #
@@ -159,7 +159,7 @@ module GoogleDriveV1
159
159
  return doc.css("feed > entry").map(){ |e| entry_element_to_file(e) }
160
160
  end
161
161
 
162
- # Returns GoogleDriveV1::File or its subclass whose title exactly matches +title+.
162
+ # Returns GoogleDriveV0::File or its subclass whose title exactly matches +title+.
163
163
  # Returns nil if not found. If multiple files with the +title+ are found, returns
164
164
  # one of them.
165
165
  #
@@ -173,7 +173,7 @@ module GoogleDriveV1
173
173
  end
174
174
  end
175
175
 
176
- # Returns list of spreadsheets for the user as array of GoogleDriveV1::Spreadsheet.
176
+ # Returns list of spreadsheets for the user as array of GoogleDriveV0::Spreadsheet.
177
177
  # You can specify query parameters e.g. "title", "title-exact".
178
178
  #
179
179
  # e.g.
@@ -191,7 +191,7 @@ module GoogleDriveV1
191
191
  select(){ |f| f.is_a?(Spreadsheet) }
192
192
  end
193
193
 
194
- # Returns GoogleDriveV1::Spreadsheet with given +key+.
194
+ # Returns GoogleDriveV0::Spreadsheet with given +key+.
195
195
  #
196
196
  # e.g.
197
197
  # # http://spreadsheets.google.com/ccc?key=pz7XtlQC-PYx-jrVMJErTcg&hl=ja
@@ -201,7 +201,7 @@ module GoogleDriveV1
201
201
  return Spreadsheet.new(self, url)
202
202
  end
203
203
 
204
- # Returns GoogleDriveV1::Spreadsheet with given +url+. You must specify either of:
204
+ # Returns GoogleDriveV0::Spreadsheet with given +url+. You must specify either of:
205
205
  # - URL of the page you open to access the spreadsheet in your browser
206
206
  # - URL of worksheet-based feed of the spreadseet
207
207
  #
@@ -228,14 +228,14 @@ module GoogleDriveV1
228
228
  return Spreadsheet.new(self, url)
229
229
  end
230
230
 
231
- # Returns GoogleDriveV1::Spreadsheet with given +title+.
231
+ # Returns GoogleDriveV0::Spreadsheet with given +title+.
232
232
  # Returns nil if not found. If multiple spreadsheets with the +title+ are found, returns
233
233
  # one of them.
234
234
  def spreadsheet_by_title(title)
235
235
  return spreadsheets({"title" => title, "title-exact" => "true"})[0]
236
236
  end
237
237
 
238
- # Returns GoogleDriveV1::Worksheet with given +url+.
238
+ # Returns GoogleDriveV0::Worksheet with given +url+.
239
239
  # You must specify URL of cell-based feed of the worksheet.
240
240
  #
241
241
  # e.g.
@@ -257,14 +257,14 @@ module GoogleDriveV1
257
257
  end
258
258
 
259
259
  # Returns a top-level collection whose title exactly matches +title+ as
260
- # GoogleDriveV1::Collection.
260
+ # GoogleDriveV0::Collection.
261
261
  # Returns nil if not found. If multiple collections with the +title+ are found, returns
262
262
  # one of them.
263
263
  def collection_by_title(title)
264
264
  return self.root_collection.subcollection_by_title(title)
265
265
  end
266
266
 
267
- # Returns GoogleDriveV1::Collection with given +url+.
267
+ # Returns GoogleDriveV0::Collection with given +url+.
268
268
  # You must specify either of:
269
269
  # - URL of the page you get when you go to https://docs.google.com/ with your browser and
270
270
  # open a collection
@@ -287,7 +287,7 @@ module GoogleDriveV1
287
287
  return Collection.new(self, to_v3_url(url))
288
288
  end
289
289
 
290
- # Creates new spreadsheet and returns the new GoogleDriveV1::Spreadsheet.
290
+ # Creates new spreadsheet and returns the new GoogleDriveV0::Spreadsheet.
291
291
  #
292
292
  # e.g.
293
293
  # session.create_spreadsheet("My new sheet")
@@ -444,7 +444,7 @@ module GoogleDriveV1
444
444
  "link[rel='http://schemas.google.com/spreadsheets/2006#worksheetsfeed']")[0]
445
445
  return Spreadsheet.new(self, worksheets_feed_link["href"], title)
446
446
  else
447
- return GoogleDriveV1::File.new(self, entry)
447
+ return GoogleDriveV0::File.new(self, entry)
448
448
  end
449
449
  end
450
450
 
@@ -470,7 +470,7 @@ module GoogleDriveV1
470
470
  end
471
471
  if !(response.code =~ /^[23]/)
472
472
  raise(
473
- response.code == "401" ? AuthenticationError : GoogleDriveV1::Error,
473
+ response.code == "401" ? AuthenticationError : GoogleDriveV0::Error,
474
474
  "Response code #{response.code} for #{method} #{url}: " +
475
475
  CGI.unescapeHTML(response.body))
476
476
  end
@@ -494,7 +494,7 @@ module GoogleDriveV1
494
494
  when :response
495
495
  return response
496
496
  else
497
- raise(GoogleDriveV1::Error,
497
+ raise(GoogleDriveV0::Error,
498
498
  "Unknown params[:response_type]: %s" % response_type)
499
499
  end
500
500
  end