chutki 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- chutki = Chutki.new({username: username, password: password, sender_id: sender_id})
21
+ chutki = Chutki.new({user: username, password: password, sender: sender_id})
22
22
  result = chutki.send_sms(phone_number,message)
23
23
  if result.success?
24
24
  ...
@@ -32,9 +32,9 @@ Or install it yourself as:
32
32
  in your config/initializers/chutki.rb
33
33
 
34
34
  ActionMailer::Base.add_delivery_method :chutki, Chutki, {
35
- username: "username",
35
+ user: "username",
36
36
  password: "password",
37
- sender_id: "sender_id"
37
+ sender: "sender_id"
38
38
  }
39
39
 
40
40
  in your app/mailer/yourmailer.rb
@@ -7,9 +7,9 @@ class Chutki
7
7
 
8
8
  def initialize(options)
9
9
  @options = options
10
- @username = options[:username]
10
+ @username = options[:user]
11
11
  @password = options[:password]
12
- @sender_id = options[:sender_id]
12
+ @sender_id = options[:sender]
13
13
  end
14
14
 
15
15
  def send_sms(message,to,opts = {})
@@ -58,7 +58,7 @@ class Chutki
58
58
  private
59
59
 
60
60
  def makesend(endpoint,opts = {})
61
- self.class.post(endpoint,opts.merge(@options))
61
+ self.class.post(endpoint,{:query => opts.merge(@options)})
62
62
  end
63
63
 
64
64
  end
@@ -1,3 +1,3 @@
1
1
  class Chutki
2
- VERSION="0.1.1"
2
+ VERSION="1.0.0"
3
3
  end
@@ -6,7 +6,7 @@ class InitTest < Test::Unit::TestCase
6
6
 
7
7
  should "require username and password and senderid" do
8
8
  lambda { Chutki.new }.should raise_error(ArgumentError)
9
- Chutki.new({username: "username", password: "password", sender_id: "senderid"})
9
+ Chutki.new({user: "username", password: "password", sender: "senderid"})
10
10
  end
11
11
  end
12
12
 
@@ -17,8 +17,8 @@ class InitTest < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  context "Sending SMS" do
20
- @chutki = Chutki.new({username: "username", password: "password", sender_id: "senderid"})
21
- Chutki.expects(:post).with("/sendhttp.php", :mobiles => "phonenumber", :message => "message", :username => "username", :password => "password", :sender_id => "senderid")
20
+ @chutki = Chutki.new({user: "username", password: "password", sender: "senderid"})
21
+ Chutki.expects(:post).with("/sendhttp.php", :mobiles => "phonenumber", :message => "message", :user => "username", :password => "password", :sender => "senderid")
22
22
  @chutki.send_sms("message","phonenumber",{})
23
23
  end
24
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chutki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-30 00:00:00.000000000 Z
12
+ date: 2012-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty