emay_soap 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adaa820fd874c6b80d160e11ee8e7ea901afa00e
4
- data.tar.gz: 89e3d736557bfb08ba5aa9695c1d7b8da538691f
3
+ metadata.gz: 8be0af4346fed71759e026206e514492567e3ec7
4
+ data.tar.gz: bcf6f257a7b1c222c2429891ae9a2d97ff32169f
5
5
  SHA512:
6
- metadata.gz: ef672da2267802781afabf215f8fb6d417562eb466d231f911c49cee233cb01abf2dd92208a16578f2bcc49f6f255bc75ae1a9d9888f3710616025e29e89d28b
7
- data.tar.gz: 4a86710eb5f230913e5af26ef2b3ae9325750f4b37f98f03962bb6040ca53e867e03611b083a5630c0a7cc9e7c2a98458dfe4cc9cb684fed63c7f2cfcaa3a280
6
+ metadata.gz: e065f78b0c33ca84d8bbbcd86d7049e4835a7947ff5de335fc590f1cda2f31289cbaad182098f7c8f3d8a5d84ae3f9389154ede91ea0f44fb1533e66a4b6bc75
7
+ data.tar.gz: 0a15531035f9761d9edc58e1ec8f365f5b943586cfcdf7ecfe1ab5cbacba1025416a7df9f0108b894ab1737923892d19786b8c5027b17c052c27abe89033c968
@@ -0,0 +1,9 @@
1
+ # https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options
2
+ language: "ruby"
3
+ script: "bundle exec rake --trace"
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0
7
+ - 2.1
8
+ - jruby
9
+ - rbx-2
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/lenage/emay_soap"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.add_runtime_dependency 'savon', '~> 2.8'
16
+ spec.add_runtime_dependency 'savon'
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0")
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -50,6 +50,7 @@ module EmaySoap
50
50
  def send_sms(mobiles, content, options = {})
51
51
  send_at = format_sent_at(options[:send_at]) unless options[:send_at].blank?
52
52
  mobiles = mobiles.is_a?(String) ? [mobiles] : mobiles
53
+ content = "#{prefix} #{content}" unless prefix.nil?
53
54
  msg = { arg2: send_at, arg3: mobiles, arg4: content, arg5: options[:kind], arg6: nil, arg7: options[:priority], arg8: options[:id] }
54
55
  call(:send_sms, msg)
55
56
  end
@@ -79,7 +80,8 @@ module EmaySoap
79
80
 
80
81
  def call(action, message)
81
82
  msg = { arg0: @cdkey, arg1: @key }.merge message
82
- savon.call(action, message: msg).body
83
+ result = savon.call(action, message: msg)
84
+ result.body if result.success?
83
85
  end
84
86
 
85
87
  def format_sent_at send_at
@@ -1,10 +1,11 @@
1
1
  module EmaySoap
2
2
  module Configurable
3
- attr_accessor :cdkey, :key, :password
3
+ attr_accessor :prefix, :cdkey, :key, :password
4
4
 
5
5
  class << self
6
6
  def default_options
7
7
  {
8
+ prefix: ENV['EMAY_PREFIX'],
8
9
  cdkey: ENV['EMAY_CDKEY'],
9
10
  key: ENV['EMAY_KEY'], # session key, max length is 15
10
11
  password: ENV['EMAY_PASSWORD']
@@ -12,7 +13,7 @@ module EmaySoap
12
13
  end
13
14
 
14
15
  def setup_keys
15
- @setup_keys ||= [:cdkey, :key, :password]
16
+ @setup_keys ||= [:prefix, :cdkey, :key, :password]
16
17
  end
17
18
  end
18
19
 
@@ -1,3 +1,3 @@
1
1
  module EmaySoap
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emay_soap
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
  - Yuan He
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: savon
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.8'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.8'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
+ - ".travis.yml"
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md