gsmetrics 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Gemfile +2 -1
  2. data/Gemfile.lock +3 -1
  3. data/bin/gsmetrics +12 -0
  4. data/gsmetrics.gemspec +2 -2
  5. metadata +4 -4
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ gem 'httparty'
4
4
  gem 'builder'
5
5
  gem 'thor'
6
6
  gem 'launchy'
7
- gem 'httparty'
7
+ gem 'httparty'
8
+ gem 'crack'
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gsmetrics (0.0.2)
4
+ gsmetrics (0.0.3)
5
5
 
6
6
  GEM
7
7
  specs:
8
8
  addressable (2.2.6)
9
9
  builder (3.0.0)
10
+ crack (0.1.8)
10
11
  httparty (0.8.1)
11
12
  multi_json
12
13
  multi_xml
@@ -21,6 +22,7 @@ PLATFORMS
21
22
 
22
23
  DEPENDENCIES
23
24
  builder
25
+ crack
24
26
  gsmetrics!
25
27
  httparty
26
28
  launchy
data/bin/gsmetrics CHANGED
@@ -3,6 +3,7 @@ require "thor"
3
3
  require 'launchy'
4
4
  require 'httparty'
5
5
  require 'json'
6
+ require 'crack'
6
7
 
7
8
  class GSMetrics < Thor
8
9
  desc "setup", "Helps in Setting up a google Oauth Token"
@@ -47,6 +48,17 @@ class GSMetrics < Thor
47
48
  say " \"#{client_secret}\","
48
49
  say " \"#{refresh_token}\""
49
50
  say ")"
51
+
52
+ say "\n\n"
53
+
54
+ document = ask "Id of Document you want to access:"
55
+
56
+ response = HTTParty.get("https://spreadsheets.google.com/feeds/worksheets/#{document}/private/full", :query => {"access_token" => tokens["access_token"], :v => "3.0"})
57
+ worksheets = Crack::XML.parse(response.body)
58
+ say "Code for creating a Worksheet"
59
+ worksheets["feed"]["entry"].each_with_index do |entry, index|
60
+ say "#{index}. #{entry["title"]} - session.worksheet(\"#{document}\", \"#{entry["id"].split("/").last}\")"
61
+ end
50
62
  end
51
63
  end
52
64
 
data/gsmetrics.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "gsmetrics"
3
- s.version = "0.0.2"
3
+ s.version = "0.0.3"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Florian Motlik"]
6
6
  s.email = ["flo@railsonfire.com"]
7
- s.homepage = "http://github.com/flomotlik/gsmetrics"
7
+ s.homepage = "http://github.com/railsonfire/gsmetrics"
8
8
  s.summary = "Gem for pushing data to Google Docs"
9
9
  s.description = "Simple Way to open a Session with Google Docs and push data into a Google Spreadsheet Worksheet. We use it primarily for metrics, but it can be used for basically anything regarding google spreadsheets."
10
10
  s.rubyforge_project = s.name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gsmetrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2011-11-29 00:00:00.000000000Z
12
+ date: 2011-11-30 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Simple Way to open a Session with Google Docs and push data into a Google
15
15
  Spreadsheet Worksheet. We use it primarily for metrics, but it can be used for basically
@@ -32,7 +32,7 @@ files:
32
32
  - gsmetrics.gemspec
33
33
  - lib/gsmetrics.rb
34
34
  - lib/gsmetrics/gsmetrics.rb
35
- homepage: http://github.com/flomotlik/gsmetrics
35
+ homepage: http://github.com/railsonfire/gsmetrics
36
36
  licenses: []
37
37
  post_install_message:
38
38
  rdoc_options: []
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  segments:
48
48
  - 0
49
- hash: 4362391559656995454
49
+ hash: -1752480396697101011
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements: