google_url_shortener 0.0.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -4
- data/Gemfile.lock +8 -7
- data/google_url_shortener.gemspec +3 -0
- data/lib/google/url_shortener/request.rb +6 -1
- data/lib/google/url_shortener/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e693d729a1c38168b11ac491d139f4cd8efe335
|
4
|
+
data.tar.gz: f4768070ba1e107ba617633751987012ebf86982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46263d288b88a6908440cd5bac278cd6845d78b86b4cf31526f8c700f99fb5fed374220ff50b25cc5cea6f80db4cbc7c78199b389779d3f2a67b4ae336de590f
|
7
|
+
data.tar.gz: e23f39138c0bd85ab1ed4319af91b8faed54f68ead536a9edfb78b27e304582e7e64dc87d59995f5ebacacda2cabbe0532a5cffba27385629eed6c29994a3bda
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google_url_shortener (0.0
|
4
|
+
google_url_shortener (1.0.0)
|
5
5
|
json (>= 1.4.6)
|
6
6
|
rest-client (>= 1.6.7)
|
7
7
|
trollop (= 1.16.2)
|
8
8
|
|
9
9
|
GEM
|
10
|
-
remote:
|
10
|
+
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
diff-lcs (1.1.3)
|
13
13
|
fakeweb (1.3.0)
|
14
|
-
json (1.
|
15
|
-
mime-types (
|
16
|
-
|
17
|
-
|
14
|
+
json (1.8.2)
|
15
|
+
mime-types (2.4.3)
|
16
|
+
netrc (0.10.3)
|
17
|
+
rest-client (1.7.3)
|
18
|
+
mime-types (>= 1.16, < 3.0)
|
19
|
+
netrc (~> 0.7)
|
18
20
|
rspec (2.8.0)
|
19
21
|
rspec-core (~> 2.8.0)
|
20
22
|
rspec-expectations (~> 2.8.0)
|
@@ -32,6 +34,5 @@ DEPENDENCIES
|
|
32
34
|
bundler (>= 1.0.0)
|
33
35
|
fakeweb
|
34
36
|
google_url_shortener!
|
35
|
-
json (>= 1.4.6)
|
36
37
|
rest-client (>= 1.6.7)
|
37
38
|
rspec (= 2.8.0)
|
@@ -14,11 +14,14 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.required_rubygems_version = ">= 1.3.6"
|
16
16
|
s.rubyforge_project = "google_url_shortener"
|
17
|
+
|
17
18
|
s.add_dependency "json", ">= 1.4.6"
|
18
19
|
s.add_dependency "rest-client", ">= 1.6.7"
|
19
20
|
s.add_dependency 'trollop', '1.16.2'
|
21
|
+
|
20
22
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
21
23
|
s.add_development_dependency "rspec", "2.8.0"
|
24
|
+
s.add_development_dependency "fakeweb"
|
22
25
|
|
23
26
|
s.files = `git ls-files`.split("\n")
|
24
27
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
@@ -7,15 +7,20 @@ module Google
|
|
7
7
|
def post(params={})
|
8
8
|
response = RestClient.post(format_url, format_post_params(params), REQUEST_HEADERS)
|
9
9
|
parse(response)
|
10
|
+
rescue => e
|
11
|
+
puts e.inspect
|
10
12
|
end
|
11
13
|
|
12
14
|
def get(params={})
|
13
15
|
full_url = [format_url, "&", format_get_params(params)].join
|
14
16
|
response = RestClient.get(full_url)
|
15
17
|
parse(response)
|
18
|
+
rescue => e
|
19
|
+
puts e.inspect
|
16
20
|
end
|
17
21
|
|
18
|
-
|
22
|
+
private
|
23
|
+
|
19
24
|
def parse(response)
|
20
25
|
JSON.parse(response)
|
21
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_url_shortener
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: fakeweb
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: Google URL Shortener is a library to compress and expand goo.gl URL's.
|
84
98
|
It also provides an interface to review the analytics of a short URL.
|
85
99
|
email:
|