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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bafd47b8c63d4f9ddd0fef3f8a67e20895f0fc62
4
- data.tar.gz: 1911e3bcd3ab765beefc38f495ad882d4f004491
3
+ metadata.gz: 6475ad4b454c1e3b24cdd4226a35f759ddef75d4
4
+ data.tar.gz: 135ee44eb9bd52199f000c9fd5b668b544ab9104
5
5
  SHA512:
6
- metadata.gz: f3a7e9671d4240a3a567d44594b255aeb37fd9737548ef8404bc499fa9a4eafb2b6a7ae078a0c5aec130cf882386e0c981250b099ef890119e47f17cc0677b37
7
- data.tar.gz: fc82d305d4798572e7ca624a364261193133312368072fe0147e01c0f0ade459669a908c70e3e2db7948f6e4d5e6b31fe73dba0bf1b88bed3ce633804191b31b
6
+ metadata.gz: 6453cda35d71b3a89b627bc5539e4f3746c25af8518b132a74a28107a05b8ada2189213270a3d04e232423486651fb9754f67690594ebf4fadb77798ddc278b9
7
+ data.tar.gz: a3e4d324103dfb02181d43062a258db42ab675a52b983d118c2c496f512f666befac227bc46d3f882cc317a81992bf2463926c2a9aa1739c7cac30407ee25b84
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'curb'
4
+
3
5
  group :test do
4
6
  gem 'minitest'
5
7
  end
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
- uri = URI("https://app.bombbomb.com/app/api/api.php?method=#{method}")
34
- response = Net::HTTP.post_form(uri, param_fields(args))
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)
@@ -1,3 +1,3 @@
1
1
  module BombBomb
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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(:body)
14
+ FakeResponse = Struct.new(:body_str)
14
15
  @response = FakeResponse.new("{}")
15
16
  @mock = MiniTest::Mock.new
16
- @mock.expect :body, @response.body
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
- Net::HTTP.stub(:post_form, @mock) do
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
- Net::HTTP.stub(:post_form, @mock) do
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
- Net::HTTP.stub(:post_form, @mock) do
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2013-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler