bomb_bomb 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/bomb_bomb.rb +2 -4
- data/lib/bomb_bomb/version.rb +1 -1
- data/test/bomb_bomb_test.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6475ad4b454c1e3b24cdd4226a35f759ddef75d4
|
4
|
+
data.tar.gz: 135ee44eb9bd52199f000c9fd5b668b544ab9104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6453cda35d71b3a89b627bc5539e4f3746c25af8518b132a74a28107a05b8ada2189213270a3d04e232423486651fb9754f67690594ebf4fadb77798ddc278b9
|
7
|
+
data.tar.gz: a3e4d324103dfb02181d43062a258db42ab675a52b983d118c2c496f512f666befac227bc46d3f882cc317a81992bf2463926c2a9aa1739c7cac30407ee25b84
|
data/Gemfile
CHANGED
data/lib/bomb_bomb.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "bomb_bomb/version"
|
2
|
-
require "net/http"
|
3
2
|
require "json"
|
4
3
|
|
5
4
|
module BombBomb
|
@@ -30,9 +29,8 @@ module BombBomb
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def make_call(method, args)
|
33
|
-
|
34
|
-
response
|
35
|
-
JSON.load("[#{response.body}]").first
|
32
|
+
response = Curl.post("https://app.bombbomb.com/app/api/api.php?method=#{method}", param_fields(args))
|
33
|
+
JSON.load("[#{response.body_str}]").first
|
36
34
|
end
|
37
35
|
|
38
36
|
def camelize_method(method)
|
data/lib/bomb_bomb/version.rb
CHANGED
data/test/bomb_bomb_test.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
require "bomb_bomb"
|
3
|
+
require "curb"
|
3
4
|
require "minitest/mock"
|
4
5
|
|
5
6
|
describe "BombBomb API method calls samples" do
|
@@ -10,15 +11,15 @@ describe "BombBomb API method calls samples" do
|
|
10
11
|
@bomb = BombBomb::API.new(@email, @pw)
|
11
12
|
|
12
13
|
#Fake Response
|
13
|
-
FakeResponse = Struct.new(:
|
14
|
+
FakeResponse = Struct.new(:body_str)
|
14
15
|
@response = FakeResponse.new("{}")
|
15
16
|
@mock = MiniTest::Mock.new
|
16
|
-
@mock.expect :
|
17
|
+
@mock.expect :body_str, @response.body_str
|
17
18
|
end
|
18
19
|
|
19
20
|
it "checks if login is valid" do
|
20
21
|
|
21
|
-
|
22
|
+
Curl.stub(:post, @mock) do
|
22
23
|
@bomb.is_valid_login
|
23
24
|
end
|
24
25
|
|
@@ -26,7 +27,7 @@ describe "BombBomb API method calls samples" do
|
|
26
27
|
end
|
27
28
|
|
28
29
|
it "gets all lists" do
|
29
|
-
|
30
|
+
Curl.stub(:post, @mock) do
|
30
31
|
@bomb.get_lists
|
31
32
|
end
|
32
33
|
|
@@ -34,7 +35,7 @@ describe "BombBomb API method calls samples" do
|
|
34
35
|
end
|
35
36
|
|
36
37
|
it "gets contacts of a list" do
|
37
|
-
|
38
|
+
Curl.stub(:post, @mock) do
|
38
39
|
@bomb.get_list_contacts( :list_id => "idtolist")
|
39
40
|
end
|
40
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bomb_bomb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guille Carlos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|