fusion_tables_api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6535c59c29b723d30f3d724554b419edb37355a3
4
- data.tar.gz: 7d5d43b0346b487ac7350e45b6e6dc03867c57e4
3
+ metadata.gz: 9c71467be21a143e7c19b44f806a535de32fd489
4
+ data.tar.gz: 3b22aca19619b5c4fbc5411a9a3d60538e8be892
5
5
  SHA512:
6
- metadata.gz: cac9e478a44ff75087134019e3cbb05cd7bc64a3f0818f92515b99a1db28a3089f791b2be06709e4c88e3a135cb30ed73e65fb9ac93037dd39e0ef646da06e22
7
- data.tar.gz: 5a886e78e9acf7a6a19907e2ad1ac054ab267fe9c08fb855ad233a63751a1cd573d2bc44a58614629bd64fb9f27897134aa3f9588c90b12ff4dbcaa564c4a4fc
6
+ metadata.gz: 9974f795a50164306daaff149005cd3a392f6ab9e3f894a412022c921d913f0ea5a49922e0de2ac225c08f087658ee7435f025115a852212d0000973e7407fea
7
+ data.tar.gz: 7899818a89b308a9c406e1ac91b9c3aae59b89a16946d01bc19cbec18fb9c6da53427e40a73a80a17eabbe5ac71076a9aba6b63799ce289720791c3225eaa35d
data/HISTORY.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Version 0.0.5 (05-01-2013)
2
+ * Initial authorization method for when you need to retrieve access token for the first time
3
+
4
+ ## Version 0.0.4 (05-01-2013)
5
+ * Written some basic tests
6
+ * Fixes fixes and more fixes
7
+ * Some documentation
8
+
1
9
  ## Version 0.0.3 (04-30-2013)
2
10
  * Basic functionality
3
11
  * Can create table
data/README.md CHANGED
@@ -44,7 +44,17 @@ OR
44
44
 
45
45
  Generating a table:
46
46
 
47
- ft.generate_table("the_name_of_csv_file.csv")
47
+ jj ft.generate_table("the_name_of_csv_file.csv")
48
+
49
+ If you need to retrieve your access token and refresh token for the first time utilize the method:
50
+ ft.initial_authorization
51
+
52
+ Customize the GoogleAPIClient by accessing the property `ft.client` for e.g.
53
+ ft.client.authorization.access_token
54
+ ft.client.authorization.access_token = "12345"
55
+ ft.client.authorization.redirect_uri = "http://www.example.com"
56
+
57
+ See http://rubydoc.info/github/google/google-api-ruby-client/frames for more info.
48
58
 
49
59
  **TODO: Finish this....**
50
60
 
@@ -10,9 +10,11 @@ class FusionTablesAPI
10
10
  @client.authorization.refresh_token = refresh_token
11
11
  end
12
12
 
13
+ # TODO Why not rewrite the oauth tokens file that may be given?
13
14
  def store_new_access_token
14
15
  @authorization_tokens['access_token'] = @client.authorization.access_token
15
16
  File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(@authorization_tokens.to_yaml)}
17
+ true
16
18
  end
17
19
 
18
20
  # Takes hash or file and loads oauth credentials
@@ -43,11 +45,10 @@ class FusionTablesAPI
43
45
  end
44
46
 
45
47
  # Authorization
46
- # TODO Need to test this out
47
48
  def initial_authorization
48
49
  puts "1) Copy and paste the url below into your browser:"
49
- authorize = @client.authorization.authorization_uri
50
- puts authorize
50
+ authorize_uri = @client.authorization.authorization_uri
51
+ puts authorize_uri
51
52
  # Launchy.open authorize
52
53
  puts ""
53
54
 
@@ -60,7 +61,7 @@ class FusionTablesAPI
60
61
  # TODO Need to test this one below
61
62
  @authorization_tokens ||= @client.authorization.fetch_access_token!
62
63
 
63
- File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(oauth_authorization.to_yaml)}
64
+ File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(@authorization_tokens.to_yaml)}
64
65
  puts "Google OAuth Tokens written to #{GOOGLE_OAUTH_TOKEN_FILE}"
65
66
  true
66
67
  end
@@ -41,7 +41,7 @@ class FusionTablesAPI
41
41
  params = {
42
42
  tableId: table_id,
43
43
  startLine: start_line,
44
- isStrict: false # May need to set isStrict to false
44
+ isStrict: false
45
45
  }
46
46
  request_body = File.read(filename)
47
47
  import_row_url = "https://www.googleapis.com/upload/fusiontables/v1/tables/tableId/import"
@@ -1,3 +1,3 @@
1
1
  class FusionTablesAPI
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusion_tables_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Villena