awesm 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +25 -5
- data/Rakefile +5 -0
- data/awesm.gemspec +5 -7
- data/lib/awesm.rb +8 -1
- data/lib/awesm/conversion.rb +5 -5
- data/lib/awesm/project.rb +12 -12
- data/lib/awesm/stats.rb +7 -7
- data/lib/awesm/url.rb +11 -7
- data/lib/awesm/version.rb +1 -1
- data/spec/awesm/project_spec.rb +21 -13
- data/spec/awesm/url_spec.rb +12 -12
- data/spec/spec_helper.rb +1 -1
- metadata +38 -123
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1d281a5a771b4cddbe69c4036dc0ac25cfd0286b
|
4
|
+
data.tar.gz: 04d101e91d7b1ac149102e4ffa8d89ab3e8599ca
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8a98ab405f977cf6cd784610cc9389b6b0b7530a73fb35bf236cdb2d03f229e1e7f7e9cf10693c31d8345f30b6271ad7f0fdd6a435b4f4f15ffcbd54410ff7ae
|
7
|
+
data.tar.gz: 7480b033ae9d343d87ff91391d8c6f4caf01dcfdc0d2ca6dc8ca7883c4df8ceca59280235c504d1a5011cda1640d827b688e9320efd41ac5f670cd3678d98cfb
|
data/README.md
CHANGED
@@ -4,8 +4,9 @@ The *awesm* gem is an easy way to access the awe.sm API (http://developers.awe.s
|
|
4
4
|
|
5
5
|
You can find the YARD documentation for the latest release here: http://rdoc.info/github/sfsekaran/awesm/frames
|
6
6
|
|
7
|
-
We're actively developing this
|
8
|
-
feel free to send us
|
7
|
+
We're actively developing this, so please
|
8
|
+
feel free to send us pull requests for changes
|
9
|
+
from a topic branch with specs,
|
9
10
|
documentation, and an explanation :)
|
10
11
|
|
11
12
|
## Usage ##
|
@@ -128,6 +129,11 @@ And in your code:
|
|
128
129
|
)
|
129
130
|
url_stats.clicks # => 256
|
130
131
|
|
132
|
+
## Maintainers ##
|
133
|
+
|
134
|
+
* *Sathya Sekaran*
|
135
|
+
* *Michael Durnhofer*
|
136
|
+
|
131
137
|
## Contributing ##
|
132
138
|
|
133
139
|
* fork
|
@@ -140,10 +146,24 @@ And in your code:
|
|
140
146
|
|
141
147
|
## Contributors ##
|
142
148
|
|
143
|
-
|
144
|
-
* *Michael Durnhofer*
|
145
|
-
* *Cody Johnston*
|
149
|
+
http://github.com/sfsekaran/awesm/graphs/contributors
|
146
150
|
|
147
151
|
## Many Thanks To ##
|
152
|
+
|
148
153
|
* our employer, Topspin Media, Inc. (http://topspinmedia.com)
|
149
154
|
* and the good folks at awe.sm (http://totally.awe.sm)
|
155
|
+
|
156
|
+
## Disclaimer ##
|
157
|
+
|
158
|
+
This gem is in no way maintained by the company Awe.sm, and is third party software written and collaborated on by the development community at large.
|
159
|
+
|
160
|
+
## The MIT License (MIT) ##
|
161
|
+
|
162
|
+
Copyright (c) 2013 Sathya Sekaran, Michael Durnhofer
|
163
|
+
|
164
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
165
|
+
|
166
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
167
|
+
|
168
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
169
|
+
|
data/Rakefile
CHANGED
data/awesm.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.email = ["sfsekaran@gmail.com", "mdurnhofer@gmail.com", "cody@codegobl.in"]
|
9
9
|
s.homepage = "http://github.com/sfsekaran/awesm"
|
10
10
|
s.summary = %q{Totally awe.sm!}
|
11
|
-
s.description = %q{The 'awesm' gem is an interface for awe.sm (http://totally.awe.sm), a social link analytics tracking service.}
|
11
|
+
s.description = %q{The 'awesm' gem is an interface for awe.sm (http://totally.awe.sm), a social link analytics tracking service. This gem is in no way maintained by the company Awe.sm, and is third party software written and collaborated on by the development community at large.}
|
12
12
|
|
13
13
|
s.rubyforge_project = "awesm"
|
14
14
|
|
@@ -19,13 +19,11 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
# specify any dependencies here;
|
21
21
|
s.add_development_dependency "rake"
|
22
|
-
s.add_development_dependency "rspec", "
|
23
|
-
s.add_development_dependency "webmock", "
|
24
|
-
s.add_development_dependency "
|
25
|
-
s.add_development_dependency "hashie"
|
26
|
-
s.add_development_dependency "ruby-debug"
|
22
|
+
s.add_development_dependency "rspec", ">= 2.7.0"
|
23
|
+
s.add_development_dependency "webmock", ">= 1.9.0"
|
24
|
+
s.add_development_dependency "pry"
|
27
25
|
|
28
|
-
s.add_runtime_dependency "
|
26
|
+
s.add_runtime_dependency "httpclient"
|
29
27
|
s.add_runtime_dependency "json"
|
30
28
|
s.add_runtime_dependency "hashie"
|
31
29
|
end
|
data/lib/awesm.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require '
|
1
|
+
require 'httpclient'
|
2
|
+
require 'httpclient/include_client'
|
2
3
|
require 'json'
|
3
4
|
require 'hashie'
|
4
5
|
|
@@ -9,6 +10,12 @@ require 'awesm/url'
|
|
9
10
|
require 'awesm/stats'
|
10
11
|
|
11
12
|
module Awesm
|
13
|
+
HOST = 'http://api.awe.sm'
|
14
|
+
|
15
|
+
extend HTTPClient::IncludeClient
|
16
|
+
|
17
|
+
include_http_client
|
18
|
+
|
12
19
|
def self.subscription_key=(key)
|
13
20
|
@@subscription_key = key
|
14
21
|
end
|
data/lib/awesm/conversion.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Awesm
|
2
2
|
class Conversion < Hashie::Mash
|
3
|
-
|
4
|
-
base_uri 'http://api.awe.sm/conversions'
|
3
|
+
PATH = '/conversions'
|
5
4
|
|
6
5
|
def self.convert(params)
|
7
|
-
response = get(
|
8
|
-
|
6
|
+
response = Awesm.http_client.get("#{Awesm::HOST}#{PATH}/new", params)
|
7
|
+
unless response.status == 200
|
9
8
|
nil
|
10
9
|
else
|
11
|
-
|
10
|
+
json = JSON.parse response.content
|
11
|
+
new(json['response']['conversion'])
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/awesm/project.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Awesm
|
2
2
|
class Project < Hashie::Mash
|
3
|
-
|
4
|
-
base_uri 'http://api.awe.sm/projects'
|
5
|
-
format :json
|
3
|
+
PATH = '/projects'
|
6
4
|
|
7
5
|
def self.create(attributes)
|
8
6
|
project = self.new(attributes)
|
@@ -10,12 +8,13 @@ module Awesm
|
|
10
8
|
end
|
11
9
|
|
12
10
|
def self.list
|
13
|
-
response = post(
|
14
|
-
|
11
|
+
response = Awesm.http_client.post("#{Awesm::HOST}#{PATH}/list", { :application_key => Awesm.application_key, :subscription_key => Awesm.subscription_key})
|
12
|
+
unless response.status == 200
|
15
13
|
nil
|
16
14
|
else
|
17
15
|
projects = []
|
18
|
-
response
|
16
|
+
json = JSON.parse response.content
|
17
|
+
json['response']['projects'].each do |project|
|
19
18
|
projects << new(project)
|
20
19
|
end
|
21
20
|
projects
|
@@ -27,20 +26,21 @@ module Awesm
|
|
27
26
|
####################
|
28
27
|
|
29
28
|
def save
|
30
|
-
response =
|
31
|
-
|
29
|
+
response = Awesm.http_client.post("#{Awesm::HOST}#{PATH}/new", :application_key => Awesm.application_key, :subscription_key => Awesm.subscription_key, :json => self.to_hash.to_json)
|
30
|
+
json = JSON.parse response.content
|
31
|
+
unless response.status.between? 200, 230
|
32
32
|
# use mash to update error code and message
|
33
|
-
update(
|
33
|
+
update(json)
|
34
34
|
false
|
35
35
|
else
|
36
|
-
update(
|
36
|
+
update(json['response']['project'])
|
37
37
|
true
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def destroy
|
42
|
-
response =
|
43
|
-
|
42
|
+
response = Awesm.http_client.post("#{Awesm::HOST}#{PATH}/#{api_key}/destroy", { :application_key => Awesm.application_key, :subscription_key => Awesm.subscription_key })
|
43
|
+
response.status == 200
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/awesm/stats.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
module Awesm
|
2
2
|
class Stats < Hashie::Mash
|
3
|
-
|
4
|
-
base_uri 'http://api.awe.sm/stats'
|
5
|
-
format :json
|
3
|
+
PATH = '/stats'
|
6
4
|
|
7
5
|
def self.range(options)
|
8
|
-
response = get
|
9
|
-
|
6
|
+
response = Awesm.http_client.get "#{Awesm::HOST}#{PATH}/range.json", { :v => 3 }.merge(options)
|
7
|
+
json = JSON.parse response.content
|
8
|
+
new(json)
|
10
9
|
end
|
11
10
|
|
12
11
|
def self.url(options)
|
13
12
|
awesm_id = options.delete(:awesm_id)
|
14
|
-
response = get "/#{awesm_id}.json",
|
15
|
-
|
13
|
+
response = Awesm.http_client.get "#{Awesm::HOST}#{PATH}/#{awesm_id}.json", { :v => 3 }.merge(options)
|
14
|
+
json = JSON.parse response.content
|
15
|
+
new(json)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/awesm/url.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
module Awesm
|
2
2
|
class Url < Hashie::Mash
|
3
|
-
|
4
|
-
base_uri 'http://api.awe.sm/url'
|
3
|
+
PATH = '/url'
|
5
4
|
REQUIRED_SHARE_PARAMS = [:url, :key, :tool, :channel, :destination].freeze
|
6
5
|
|
7
6
|
# Right now this method only supports the json format
|
8
7
|
def self.create(params = {})
|
9
|
-
call_api(
|
8
|
+
call_api("#{Awesm::HOST}#{PATH}.json", params)
|
10
9
|
end
|
11
10
|
|
12
11
|
def self.share(params = {})
|
@@ -14,7 +13,7 @@ module Awesm
|
|
14
13
|
options = params.clone
|
15
14
|
options = options.delete_if{|key,value| REQUIRED_SHARE_PARAMS.include?(key) }
|
16
15
|
query = options.map{|k,v| "#{k}=#{v}"}.join('&')
|
17
|
-
share_url = "
|
16
|
+
share_url = "#{Awesm::HOST}#{PATH}/share?v=3&url=#{params[:url]}&key=#{params[:key]}&tool=#{params[:tool]}&channel=#{params[:channel]}&destination=#{params[:destination]}"
|
18
17
|
share_url += "&#{query}" if query.length > 0
|
19
18
|
share_url
|
20
19
|
end
|
@@ -22,7 +21,7 @@ module Awesm
|
|
22
21
|
|
23
22
|
# Right now this method only supports the json format
|
24
23
|
def self.static(params = {})
|
25
|
-
call_api(
|
24
|
+
call_api("#{Awesm::HOST}#{PATH}/static.json", params)
|
26
25
|
end
|
27
26
|
|
28
27
|
#########
|
@@ -30,8 +29,13 @@ module Awesm
|
|
30
29
|
#########
|
31
30
|
|
32
31
|
def self.call_api(action, params)
|
33
|
-
response = post(action,
|
34
|
-
response.
|
32
|
+
response = Awesm.http_client.post(action, { :v => 3 }.merge(params))
|
33
|
+
unless response.status == 200
|
34
|
+
nil
|
35
|
+
else
|
36
|
+
json = JSON.parse response.content
|
37
|
+
new(json)
|
38
|
+
end
|
35
39
|
end
|
36
40
|
|
37
41
|
def self.required_params_present?(required_params, params)
|
data/lib/awesm/version.rb
CHANGED
data/spec/awesm/project_spec.rb
CHANGED
@@ -70,9 +70,11 @@ describe Awesm::Project do
|
|
70
70
|
|
71
71
|
describe '.create' do
|
72
72
|
before do
|
73
|
-
stub_request(:post, "http://api.awe.sm/projects/new
|
73
|
+
stub_request(:post, "http://api.awe.sm/projects/new").
|
74
|
+
with(:body => { "application_key" => "app-xxxxxx", "json" => "{\"name\":\"TotallyAwesomeProject\"}", "subscription_key" => "sub-xxxxxx"}).
|
74
75
|
to_return(:status => 200, :body => new_project_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
75
|
-
stub_request(:post, "http://api.awe.sm/projects/new
|
76
|
+
stub_request(:post, "http://api.awe.sm/projects/new").
|
77
|
+
with(:body => { "application_key" => "app-xxxxxx", "json" => "{\"name\":\"ExistingAwesomeProject\"}", "subscription_key" => "sub-xxxxxx"}).
|
76
78
|
to_return(:status => 400, :body => new_project_error_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
77
79
|
end
|
78
80
|
|
@@ -94,7 +96,7 @@ describe Awesm::Project do
|
|
94
96
|
Awesm::Project.create({ :name => "TotallyAwesomeProject" })
|
95
97
|
|
96
98
|
a_request(:post, "http://api.awe.sm/projects/new").
|
97
|
-
with(:
|
99
|
+
with(:body => {:subscription_key => "sub-xxxxxx", :application_key => "app-xxxxxx", :json => { "name" => "TotallyAwesomeProject" }.to_json }).
|
98
100
|
should have_been_made.once
|
99
101
|
end
|
100
102
|
end
|
@@ -108,9 +110,11 @@ describe Awesm::Project do
|
|
108
110
|
|
109
111
|
describe '#save' do
|
110
112
|
before do
|
111
|
-
stub_request(:post, "http://api.awe.sm/projects/new
|
113
|
+
stub_request(:post, "http://api.awe.sm/projects/new").
|
114
|
+
with(:body => {"application_key" => "app-xxxxxx", "json" => "{\"name\":\"TotallyAwesomeProject\"}", "subscription_key" => "sub-xxxxxx"}).
|
112
115
|
to_return(:status => 200, :body => new_project_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
113
|
-
stub_request(:post, "http://api.awe.sm/projects/new
|
116
|
+
stub_request(:post, "http://api.awe.sm/projects/new").
|
117
|
+
with(:body => {"application_key" => "app-xxxxxx", "json" => "{\"name\":\"ExistingAwesomeProject\"}", "subscription_key" => "sub-xxxxxx"}).
|
114
118
|
to_return(:status => 400, :body => new_project_error_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
115
119
|
end
|
116
120
|
|
@@ -122,7 +126,7 @@ describe Awesm::Project do
|
|
122
126
|
project.save
|
123
127
|
|
124
128
|
a_request(:post, "http://api.awe.sm/projects/new").
|
125
|
-
with(:
|
129
|
+
with(:body => {:subscription_key => "sub-xxxxxx", :application_key => "app-xxxxxx", :json => { "name" => "TotallyAwesomeProject" }.to_json }).
|
126
130
|
should have_been_made.once
|
127
131
|
end
|
128
132
|
|
@@ -155,15 +159,16 @@ describe Awesm::Project do
|
|
155
159
|
let(:existing_project) { Awesm::Project.new(:name => 'ExistingAwesomeProject', :api_key => '9x863xx7xx12x56433059xx8091838f5f5589x71x04f4760490x6x79xx9xx681') }
|
156
160
|
|
157
161
|
before do
|
158
|
-
stub_request(:post, "http://api.awe.sm/projects/9x863xx7xx12x56433059xx8091838f5f5589x71x04f4760490x6x79xx9xx681/destroy
|
159
|
-
|
162
|
+
stub_request(:post, "http://api.awe.sm/projects/9x863xx7xx12x56433059xx8091838f5f5589x71x04f4760490x6x79xx9xx681/destroy").
|
163
|
+
with(:body => {"application_key" => "app-xxxxxx", "subscription_key" => "sub-xxxxxx"}).
|
164
|
+
to_return(:status => 200, :body => delete_project_response, :headers => {})
|
160
165
|
end
|
161
166
|
|
162
167
|
it 'posts to the project destroy api' do
|
163
168
|
existing_project.destroy
|
164
169
|
|
165
170
|
a_request(:post, "http://api.awe.sm/projects/#{existing_project.api_key}/destroy").
|
166
|
-
with(:
|
171
|
+
with(:body => {:subscription_key => "sub-xxxxxx", :application_key => "app-xxxxxx"}).
|
167
172
|
should have_been_made.once
|
168
173
|
end
|
169
174
|
|
@@ -238,9 +243,11 @@ describe Awesm::Project do
|
|
238
243
|
end
|
239
244
|
|
240
245
|
before do
|
241
|
-
stub_request(:post, "http://api.awe.sm/projects/list
|
246
|
+
stub_request(:post, "http://api.awe.sm/projects/list").
|
247
|
+
with(:body => {"application_key" => "app-xxxxxx", "subscription_key" => "sub-xxxxxx"}).
|
242
248
|
to_return(:status => 200, :body => list_project_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
243
|
-
stub_request(:post, "http://api.awe.sm/projects/list
|
249
|
+
stub_request(:post, "http://api.awe.sm/projects/list").
|
250
|
+
with(:body => {"application_key" => "app-xxxxxx", "subscription_key" => "invalid"}).
|
244
251
|
to_return(:status => 400, :body => list_project_error_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
245
252
|
end
|
246
253
|
|
@@ -248,7 +255,7 @@ describe Awesm::Project do
|
|
248
255
|
Awesm::Project.list
|
249
256
|
|
250
257
|
a_request(:post, "http://api.awe.sm/projects/list").
|
251
|
-
with(:
|
258
|
+
with(:body => {:subscription_key => "sub-xxxxxx", :application_key => "app-xxxxxx"}).
|
252
259
|
should have_been_made.once
|
253
260
|
end
|
254
261
|
|
@@ -270,7 +277,8 @@ describe Awesm::Project do
|
|
270
277
|
|
271
278
|
describe '#api_key' do
|
272
279
|
before do
|
273
|
-
stub_request(:post, "http://api.awe.sm/projects/new
|
280
|
+
stub_request(:post, "http://api.awe.sm/projects/new").
|
281
|
+
with(:body => {"application_key" => "app-xxxxxx", "json" => "{\"name\":\"TotallyAwesomeProject\"}", "subscription_key" => "sub-xxxxxx"}).
|
274
282
|
to_return(:status => 200, :body => new_project_response, :headers => { 'Content-Type' => 'application/json;charset=utf-8' })
|
275
283
|
end
|
276
284
|
|
data/spec/awesm/url_spec.rb
CHANGED
@@ -81,9 +81,9 @@ describe Awesm::Url do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
before do
|
84
|
-
expected_params = required_params.merge(:v => 3)
|
84
|
+
expected_params = required_params.merge(:v => "3")
|
85
85
|
stub_request(:post, api_url).
|
86
|
-
with(:
|
86
|
+
with(:body => expected_params).
|
87
87
|
to_return(:status => 200,
|
88
88
|
:body => create_url_response,
|
89
89
|
:headers => {
|
@@ -93,9 +93,9 @@ describe Awesm::Url do
|
|
93
93
|
|
94
94
|
context 'when an error occurs' do
|
95
95
|
before do
|
96
|
-
expected_params = invalid_params.merge(:v => 3)
|
96
|
+
expected_params = invalid_params.merge(:v => "3")
|
97
97
|
stub_request(:post, api_url).
|
98
|
-
with(:
|
98
|
+
with(:body => expected_params).
|
99
99
|
to_return(:status => 400,
|
100
100
|
:body => create_url_error_response,
|
101
101
|
:headers => {
|
@@ -117,10 +117,10 @@ describe Awesm::Url do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'posts to the awe.sm project creation api properly' do
|
120
|
-
expected_query = required_params.merge(:v => 3)
|
120
|
+
expected_query = required_params.merge(:v => "3")
|
121
121
|
Awesm::Url.create(required_params)
|
122
122
|
a_request(:post, "http://api.awe.sm/url.json").
|
123
|
-
with(:
|
123
|
+
with(:body => expected_query).
|
124
124
|
should have_been_made.once
|
125
125
|
end
|
126
126
|
end
|
@@ -246,9 +246,9 @@ describe Awesm::Url do
|
|
246
246
|
end
|
247
247
|
|
248
248
|
before do
|
249
|
-
expected_params = valid_params.merge(:v => 3)
|
249
|
+
expected_params = valid_params.merge(:v => "3")
|
250
250
|
stub_request(:post, api_url).
|
251
|
-
with(:
|
251
|
+
with(:body => expected_params).
|
252
252
|
to_return(:status => 200,
|
253
253
|
:body => static_url_response,
|
254
254
|
:headers => {
|
@@ -258,9 +258,9 @@ describe Awesm::Url do
|
|
258
258
|
|
259
259
|
context 'when an error occurs' do
|
260
260
|
before do
|
261
|
-
expected_params = invalid_params.merge(:v => 3)
|
261
|
+
expected_params = invalid_params.merge(:v => "3")
|
262
262
|
stub_request(:post, api_url).
|
263
|
-
with(:
|
263
|
+
with(:body => expected_params).
|
264
264
|
to_return(:status => 400,
|
265
265
|
:body => static_url_error_response,
|
266
266
|
:headers => {
|
@@ -282,10 +282,10 @@ describe Awesm::Url do
|
|
282
282
|
end
|
283
283
|
|
284
284
|
it 'posts to the awe.sm project creation api properly' do
|
285
|
-
expected_query = valid_params.merge(:v => 3)
|
285
|
+
expected_query = valid_params.merge(:v => "3")
|
286
286
|
Awesm::Url.static(valid_params)
|
287
287
|
a_request(:post, "http://api.awe.sm/url/static.json").
|
288
|
-
with(:
|
288
|
+
with(:body => expected_query).
|
289
289
|
should have_been_made.once
|
290
290
|
end
|
291
291
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 9
|
10
|
-
version: 0.1.9
|
4
|
+
version: 0.1.10
|
11
5
|
platform: ruby
|
12
6
|
authors:
|
13
7
|
- Sathya Sekaran
|
@@ -17,141 +11,72 @@ autorequire:
|
|
17
11
|
bindir: bin
|
18
12
|
cert_chain: []
|
19
13
|
|
20
|
-
date:
|
14
|
+
date: 2013-04-17 00:00:00 Z
|
21
15
|
dependencies:
|
22
16
|
- !ruby/object:Gem::Dependency
|
23
17
|
name: rake
|
24
|
-
|
25
|
-
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
20
|
requirements:
|
27
|
-
-
|
21
|
+
- &id004
|
22
|
+
- ">="
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
24
|
version: "0"
|
33
|
-
prerelease: false
|
34
25
|
type: :development
|
35
|
-
|
26
|
+
version_requirements: *id001
|
36
27
|
- !ruby/object:Gem::Dependency
|
37
28
|
name: rspec
|
38
|
-
|
39
|
-
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
31
|
requirements:
|
41
|
-
- - "
|
32
|
+
- - ">="
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 19
|
44
|
-
segments:
|
45
|
-
- 2
|
46
|
-
- 7
|
47
|
-
- 0
|
48
34
|
version: 2.7.0
|
49
|
-
prerelease: false
|
50
35
|
type: :development
|
51
|
-
|
36
|
+
version_requirements: *id002
|
52
37
|
- !ruby/object:Gem::Dependency
|
53
38
|
name: webmock
|
54
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - "="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 27
|
60
|
-
segments:
|
61
|
-
- 1
|
62
|
-
- 7
|
63
|
-
- 8
|
64
|
-
version: 1.7.8
|
65
39
|
prerelease: false
|
66
|
-
|
67
|
-
requirement: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: json
|
70
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
72
41
|
requirements:
|
73
42
|
- - ">="
|
74
43
|
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
segments:
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
prerelease: false
|
44
|
+
version: 1.9.0
|
80
45
|
type: :development
|
81
|
-
|
46
|
+
version_requirements: *id003
|
82
47
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
84
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
hash: 3
|
90
|
-
segments:
|
91
|
-
- 0
|
92
|
-
version: "0"
|
48
|
+
name: pry
|
93
49
|
prerelease: false
|
94
|
-
|
95
|
-
requirement: *id005
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
name: ruby-debug
|
98
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
50
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
100
51
|
requirements:
|
101
|
-
-
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
hash: 3
|
104
|
-
segments:
|
105
|
-
- 0
|
106
|
-
version: "0"
|
107
|
-
prerelease: false
|
52
|
+
- *id004
|
108
53
|
type: :development
|
109
|
-
|
54
|
+
version_requirements: *id005
|
110
55
|
- !ruby/object:Gem::Dependency
|
111
|
-
name:
|
112
|
-
version_requirements: &id007 !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - "="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
hash: 61
|
118
|
-
segments:
|
119
|
-
- 0
|
120
|
-
- 8
|
121
|
-
- 1
|
122
|
-
version: 0.8.1
|
56
|
+
name: httpclient
|
123
57
|
prerelease: false
|
58
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- *id004
|
124
61
|
type: :runtime
|
125
|
-
|
62
|
+
version_requirements: *id006
|
126
63
|
- !ruby/object:Gem::Dependency
|
127
64
|
name: json
|
128
|
-
version_requirements: &id008 !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ">="
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
hash: 3
|
134
|
-
segments:
|
135
|
-
- 0
|
136
|
-
version: "0"
|
137
65
|
prerelease: false
|
66
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- *id004
|
138
69
|
type: :runtime
|
139
|
-
|
70
|
+
version_requirements: *id007
|
140
71
|
- !ruby/object:Gem::Dependency
|
141
72
|
name: hashie
|
142
|
-
version_requirements: &id009 !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
|
-
requirements:
|
145
|
-
- - ">="
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
hash: 3
|
148
|
-
segments:
|
149
|
-
- 0
|
150
|
-
version: "0"
|
151
73
|
prerelease: false
|
74
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- *id004
|
152
77
|
type: :runtime
|
153
|
-
|
154
|
-
description: The 'awesm' gem is an interface for awe.sm (http://totally.awe.sm), a social link analytics tracking service.
|
78
|
+
version_requirements: *id008
|
79
|
+
description: The 'awesm' gem is an interface for awe.sm (http://totally.awe.sm), a social link analytics tracking service. This gem is in no way maintained by the company Awe.sm, and is third party software written and collaborated on by the development community at large.
|
155
80
|
email:
|
156
81
|
- sfsekaran@gmail.com
|
157
82
|
- mdurnhofer@gmail.com
|
@@ -185,35 +110,25 @@ files:
|
|
185
110
|
homepage: http://github.com/sfsekaran/awesm
|
186
111
|
licenses: []
|
187
112
|
|
113
|
+
metadata: {}
|
114
|
+
|
188
115
|
post_install_message:
|
189
116
|
rdoc_options: []
|
190
117
|
|
191
118
|
require_paths:
|
192
119
|
- lib
|
193
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
194
|
-
none: false
|
195
121
|
requirements:
|
196
|
-
-
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
hash: 3
|
199
|
-
segments:
|
200
|
-
- 0
|
201
|
-
version: "0"
|
122
|
+
- *id004
|
202
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
|
-
none: false
|
204
124
|
requirements:
|
205
|
-
-
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
hash: 3
|
208
|
-
segments:
|
209
|
-
- 0
|
210
|
-
version: "0"
|
125
|
+
- *id004
|
211
126
|
requirements: []
|
212
127
|
|
213
128
|
rubyforge_project: awesm
|
214
|
-
rubygems_version:
|
129
|
+
rubygems_version: 2.0.3
|
215
130
|
signing_key:
|
216
|
-
specification_version:
|
131
|
+
specification_version: 4
|
217
132
|
summary: Totally awe.sm!
|
218
133
|
test_files:
|
219
134
|
- spec/awesm/conversion_spec.rb
|