googl 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,8 @@
1
1
  language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
2
6
  branches:
3
7
  only:
4
8
  - master
data/Gemfile CHANGED
@@ -1,12 +1,12 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "httparty", ">= 0.6.1"
3
+ gem "httparty", "~> 0.8.3"
4
4
  gem "json", ">= 1.4.6"
5
5
 
6
6
  group :development do
7
- gem "rspec", "~> 2.3.0"
8
- gem "bundler", "~> 1.0.0"
9
- gem "jeweler", "~> 1.5.2"
7
+ gem "rspec", "~> 2.10.0"
8
+ gem "bundler", "~> 1.1.3"
9
+ gem "jeweler", "~> 1.8.3"
10
10
  gem "rcov", ">= 0"
11
- gem "webmock", "~> 1.6.2"
11
+ gem "webmock", "~> 1.8.6"
12
12
  end
@@ -1,39 +1,45 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.2.2)
4
+ addressable (2.2.8)
5
5
  crack (0.1.8)
6
- diff-lcs (1.1.2)
6
+ diff-lcs (1.1.3)
7
7
  git (1.2.5)
8
- httparty (0.7.4)
9
- crack (= 0.1.8)
10
- jeweler (1.5.2)
11
- bundler (~> 1.0.0)
8
+ httparty (0.8.3)
9
+ multi_json (~> 1.0)
10
+ multi_xml
11
+ jeweler (1.8.3)
12
+ bundler (~> 1.0)
12
13
  git (>= 1.2.5)
13
14
  rake
15
+ rdoc
14
16
  json (1.5.1)
15
- rake (0.8.7)
17
+ multi_json (1.3.4)
18
+ multi_xml (0.4.4)
19
+ rake (0.9.2.2)
16
20
  rcov (0.9.9)
17
- rspec (2.3.0)
18
- rspec-core (~> 2.3.0)
19
- rspec-expectations (~> 2.3.0)
20
- rspec-mocks (~> 2.3.0)
21
- rspec-core (2.3.1)
22
- rspec-expectations (2.3.0)
23
- diff-lcs (~> 1.1.2)
24
- rspec-mocks (2.3.0)
25
- webmock (1.6.2)
26
- addressable (>= 2.2.2)
21
+ rdoc (3.12)
22
+ json (~> 1.4)
23
+ rspec (2.10.0)
24
+ rspec-core (~> 2.10.0)
25
+ rspec-expectations (~> 2.10.0)
26
+ rspec-mocks (~> 2.10.0)
27
+ rspec-core (2.10.0)
28
+ rspec-expectations (2.10.0)
29
+ diff-lcs (~> 1.1.3)
30
+ rspec-mocks (2.10.1)
31
+ webmock (1.8.6)
32
+ addressable (>= 2.2.7)
27
33
  crack (>= 0.1.7)
28
34
 
29
35
  PLATFORMS
30
36
  ruby
31
37
 
32
38
  DEPENDENCIES
33
- bundler (~> 1.0.0)
34
- httparty (>= 0.6.1)
35
- jeweler (~> 1.5.2)
39
+ bundler (~> 1.1.3)
40
+ httparty (~> 0.8.3)
41
+ jeweler (~> 1.8.3)
36
42
  json (>= 1.4.6)
37
43
  rcov
38
- rspec (~> 2.3.0)
39
- webmock (~> 1.6.2)
44
+ rspec (~> 2.10.0)
45
+ webmock (~> 1.8.6)
@@ -4,7 +4,7 @@ Google URL Shortener API in Ruby
4
4
 
5
5
  == Continuous Integration
6
6
 
7
- http://travis-ci.org/zigotto/googl.png Travis[http://travis-ci.org/zigotto/googl]
7
+ {<img src="https://secure.travis-ci.org/zigotto/googl.png" />}[http://travis-ci.org/zigotto/googl]
8
8
 
9
9
  == Basic Usage
10
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "googl"
8
- s.version = "0.6.0"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jesus Lopes"]
@@ -66,47 +66,37 @@ Gem::Specification.new do |s|
66
66
  s.homepage = "http://github.com/zigotto/googl"
67
67
  s.licenses = ["MIT"]
68
68
  s.require_paths = ["lib"]
69
- s.rubygems_version = "1.8.21"
69
+ s.rubygems_version = "1.8.24"
70
70
  s.summary = "Wrapper for Google URL Shortener API"
71
- s.test_files = [
72
- "spec/googl/client_spec.rb",
73
- "spec/googl/expand_spec.rb",
74
- "spec/googl/oauth2/native_spec.rb",
75
- "spec/googl/oauth2/server_spec.rb",
76
- "spec/googl/request_spec.rb",
77
- "spec/googl/shorten_spec.rb",
78
- "spec/shared_examples.rb",
79
- "spec/spec_helper.rb"
80
- ]
81
71
 
82
72
  if s.respond_to? :specification_version then
83
73
  s.specification_version = 3
84
74
 
85
75
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
86
- s.add_runtime_dependency(%q<httparty>, [">= 0.6.1"])
76
+ s.add_runtime_dependency(%q<httparty>, ["~> 0.8.3"])
87
77
  s.add_runtime_dependency(%q<json>, [">= 1.4.6"])
88
- s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
89
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
90
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
78
+ s.add_development_dependency(%q<rspec>, ["~> 2.10.0"])
79
+ s.add_development_dependency(%q<bundler>, ["~> 1.1.3"])
80
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
91
81
  s.add_development_dependency(%q<rcov>, [">= 0"])
92
- s.add_development_dependency(%q<webmock>, ["~> 1.6.2"])
82
+ s.add_development_dependency(%q<webmock>, ["~> 1.8.6"])
93
83
  else
94
- s.add_dependency(%q<httparty>, [">= 0.6.1"])
84
+ s.add_dependency(%q<httparty>, ["~> 0.8.3"])
95
85
  s.add_dependency(%q<json>, [">= 1.4.6"])
96
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
97
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
98
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
86
+ s.add_dependency(%q<rspec>, ["~> 2.10.0"])
87
+ s.add_dependency(%q<bundler>, ["~> 1.1.3"])
88
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
99
89
  s.add_dependency(%q<rcov>, [">= 0"])
100
- s.add_dependency(%q<webmock>, ["~> 1.6.2"])
90
+ s.add_dependency(%q<webmock>, ["~> 1.8.6"])
101
91
  end
102
92
  else
103
- s.add_dependency(%q<httparty>, [">= 0.6.1"])
93
+ s.add_dependency(%q<httparty>, ["~> 0.8.3"])
104
94
  s.add_dependency(%q<json>, [">= 1.4.6"])
105
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
106
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
107
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
95
+ s.add_dependency(%q<rspec>, ["~> 2.10.0"])
96
+ s.add_dependency(%q<bundler>, ["~> 1.1.3"])
97
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
108
98
  s.add_dependency(%q<rcov>, [">= 0"])
109
- s.add_dependency(%q<webmock>, ["~> 1.6.2"])
99
+ s.add_dependency(%q<webmock>, ["~> 1.8.6"])
110
100
  end
111
101
  end
112
102
 
@@ -86,7 +86,7 @@ module Googl
86
86
  # For mor details, see http://code.google.com/intl/pt-BR/apis/urlshortener/v1/reference.html#resource_url
87
87
  #
88
88
  def expand(url=nil, options={})
89
- raise ArgumentError.new("URL to expand is required") if url.blank?
89
+ raise ArgumentError.new("URL to expand is required") if url.nil? || url.strip.empty?
90
90
  options = {:shortUrl => url, :projection => nil}.merge!(options)
91
91
  Googl::Expand.new(options)
92
92
  end
@@ -45,7 +45,7 @@ module Googl
45
45
  # history = client.history(:projection => :analytics_clicks)
46
46
  #
47
47
  def history(options={})
48
- resp = options.blank? ? get(Googl::Utils::API_HISTORY_URL) : get(Googl::Utils::API_HISTORY_URL, :query => options)
48
+ resp = (options.nil? || options.empty?) ? get(Googl::Utils::API_HISTORY_URL) : get(Googl::Utils::API_HISTORY_URL, :query => options)
49
49
  case resp.code
50
50
  when 200
51
51
  self.items = resp.parsed_response.to_openstruct
@@ -18,7 +18,7 @@ module Googl
18
18
  #
19
19
  def history(options={})
20
20
  return unless authorized?
21
- resp = options.blank? ? get(Googl::Utils::API_HISTORY_URL) : get(Googl::Utils::API_HISTORY_URL, :query => options)
21
+ resp = (options.nil? || options.empty?) ? get(Googl::Utils::API_HISTORY_URL) : get(Googl::Utils::API_HISTORY_URL, :query => options)
22
22
  case resp.code
23
23
  when 200
24
24
  self.items = resp.parsed_response.to_openstruct
@@ -71,7 +71,7 @@ describe Googl::ClientLogin do
71
71
  it { item.label.should == 'http://goo.gl/Ue8sQ' }
72
72
  it { item.long_url.should == 'http://facebook.com/' }
73
73
  it { item.status.should == 'OK' }
74
- it { item.created.should be_instance_of(Time)}
74
+ it { item.created.should == "2011-01-13T21:39:17.271+00:00"}
75
75
 
76
76
  end
77
77
 
@@ -64,7 +64,7 @@ describe Googl::Expand do
64
64
  let(:element) { subject.created }
65
65
 
66
66
  it "should be the time url was shortened" do
67
- element.should == Time.iso8601("2011-01-13T03:48:10.309+00:00")
67
+ element.should == "2011-01-13T03:48:10.309+00:00"
68
68
  end
69
69
 
70
70
  end
@@ -58,15 +58,16 @@ def fake_urls?(status)
58
58
  url_login = "https://www.google.com/accounts/ClientLogin"
59
59
 
60
60
  # ClientLogin valid
61
- params = "Passwd=my_valid_password&service=urlshortener&accountType=HOSTED_OR_GOOGLE&Email=my_user%40gmail.com&source=gem-googl-ruby"
62
61
  stub_request(:post, url_login).
63
- with(:body => params,
64
- :headers => {'Content-Type'=>'application/x-www-form-urlencoded'}).
65
- to_return(load_fixture('client_login_valid.json'))
62
+ with(:body => {"accountType"=>"HOSTED_OR_GOOGLE", "service"=>"urlshortener", "Email"=>"my_user@gmail.com", "source"=>"gem-googl-ruby", "Passwd"=>"my_valid_password"},
63
+ :headers => {'Content-Type'=>'application/x-www-form-urlencoded'}).
64
+ to_return(load_fixture('client_login_valid.json'))
66
65
 
67
66
  # ClientLogin invalid
68
- params = "Passwd=my_invalid_passwod&service=urlshortener&accountType=HOSTED_OR_GOOGLE&Email=my_invalid_gmail&source=gem-googl-ruby"
69
- stub_request(:post, url_login).with(:body => params).to_return(load_fixture('client_login_invalid.json'))
67
+ stub_request(:post, url_login).
68
+ with(:body => {"Email"=>"my_invalid_gmail", "Passwd"=>"my_invalid_passwod", "source"=>"gem-googl-ruby", "service"=>"urlshortener", "accountType"=>"HOSTED_OR_GOOGLE"},
69
+ :headers => {'Authorization'=>'GoogleLogin auth=DQAAAK8AAAC9ahL-o7g', 'Content-Type'=>'application/x-www-form-urlencoded'}).
70
+ to_return(load_fixture('client_login_invalid.json'))
70
71
 
71
72
  # Shorten authenticated
72
73
  params = "{\"longUrl\":\"http://www.zigotto.net\"}"
metadata CHANGED
@@ -1,141 +1,135 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: googl
3
- version: !ruby/object:Gem::Version
4
- hash: 7
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 6
9
- - 0
10
- version: 0.6.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jesus Lopes
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-05-05 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 5
27
- segments:
28
- - 0
29
- - 6
30
- - 1
31
- version: 0.6.1
12
+ date: 2012-05-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
32
15
  name: httparty
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.8.3
33
22
  type: :runtime
34
23
  prerelease: false
35
- requirement: *id001
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
38
25
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 11
43
- segments:
44
- - 1
45
- - 4
46
- - 6
47
- version: 1.4.6
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.3
30
+ - !ruby/object:Gem::Dependency
48
31
  name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.4.6
49
38
  type: :runtime
50
39
  prerelease: false
51
- requirement: *id002
52
- - !ruby/object:Gem::Dependency
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
54
41
  none: false
55
- requirements:
56
- - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 2
61
- - 3
62
- - 0
63
- version: 2.3.0
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.4.6
46
+ - !ruby/object:Gem::Dependency
64
47
  name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 2.10.0
65
54
  type: :development
66
55
  prerelease: false
67
- requirement: *id003
68
- - !ruby/object:Gem::Dependency
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
70
57
  none: false
71
- requirements:
58
+ requirements:
72
59
  - - ~>
73
- - !ruby/object:Gem::Version
74
- hash: 23
75
- segments:
76
- - 1
77
- - 0
78
- - 0
79
- version: 1.0.0
60
+ - !ruby/object:Gem::Version
61
+ version: 2.10.0
62
+ - !ruby/object:Gem::Dependency
80
63
  name: bundler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 1.1.3
81
70
  type: :development
82
71
  prerelease: false
83
- requirement: *id004
84
- - !ruby/object:Gem::Dependency
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
86
73
  none: false
87
- requirements:
74
+ requirements:
88
75
  - - ~>
89
- - !ruby/object:Gem::Version
90
- hash: 7
91
- segments:
92
- - 1
93
- - 5
94
- - 2
95
- version: 1.5.2
76
+ - !ruby/object:Gem::Version
77
+ version: 1.1.3
78
+ - !ruby/object:Gem::Dependency
96
79
  name: jeweler
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 1.8.3
97
86
  type: :development
98
87
  prerelease: false
99
- requirement: *id005
100
- - !ruby/object:Gem::Dependency
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
102
89
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- hash: 3
107
- segments:
108
- - 0
109
- version: "0"
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 1.8.3
94
+ - !ruby/object:Gem::Dependency
110
95
  name: rcov
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
111
102
  type: :development
112
103
  prerelease: false
113
- requirement: *id006
114
- - !ruby/object:Gem::Dependency
115
- version_requirements: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
116
105
  none: false
117
- requirements:
118
- - - ~>
119
- - !ruby/object:Gem::Version
120
- hash: 11
121
- segments:
122
- - 1
123
- - 6
124
- - 2
125
- version: 1.6.2
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
126
111
  name: webmock
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 1.8.6
127
118
  type: :development
128
119
  prerelease: false
129
- requirement: *id007
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.8.6
130
126
  description: Small library for Google URL Shortener API
131
127
  email: jlopes@zigotto.com.br
132
128
  executables: []
133
-
134
129
  extensions: []
135
-
136
- extra_rdoc_files:
130
+ extra_rdoc_files:
137
131
  - README.rdoc
138
- files:
132
+ files:
139
133
  - .travis.yml
140
134
  - Gemfile
141
135
  - Gemfile.lock
@@ -183,44 +177,31 @@ files:
183
177
  - spec/shared_examples.rb
184
178
  - spec/spec_helper.rb
185
179
  homepage: http://github.com/zigotto/googl
186
- licenses:
180
+ licenses:
187
181
  - MIT
188
182
  post_install_message:
189
183
  rdoc_options: []
190
-
191
- require_paths:
184
+ require_paths:
192
185
  - lib
193
- required_ruby_version: !ruby/object:Gem::Requirement
186
+ required_ruby_version: !ruby/object:Gem::Requirement
194
187
  none: false
195
- requirements:
196
- - - ">="
197
- - !ruby/object:Gem::Version
198
- hash: 3
199
- segments:
188
+ requirements:
189
+ - - ! '>='
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ segments:
200
193
  - 0
201
- version: "0"
202
- required_rubygems_version: !ruby/object:Gem::Requirement
194
+ hash: 2810844095798142690
195
+ required_rubygems_version: !ruby/object:Gem::Requirement
203
196
  none: false
204
- requirements:
205
- - - ">="
206
- - !ruby/object:Gem::Version
207
- hash: 3
208
- segments:
209
- - 0
210
- version: "0"
197
+ requirements:
198
+ - - ! '>='
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
211
201
  requirements: []
212
-
213
202
  rubyforge_project:
214
- rubygems_version: 1.8.21
203
+ rubygems_version: 1.8.24
215
204
  signing_key:
216
205
  specification_version: 3
217
206
  summary: Wrapper for Google URL Shortener API
218
- test_files:
219
- - spec/googl/client_spec.rb
220
- - spec/googl/expand_spec.rb
221
- - spec/googl/oauth2/native_spec.rb
222
- - spec/googl/oauth2/server_spec.rb
223
- - spec/googl/request_spec.rb
224
- - spec/googl/shorten_spec.rb
225
- - spec/shared_examples.rb
226
- - spec/spec_helper.rb
207
+ test_files: []