emay_sms 0.1.0 → 0.1.1

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: 210eaed850c7962be7034e344865788d2de1df1a
4
- data.tar.gz: e9972ebcb8d60ecf500f256ee9b16a4f55efde1f
3
+ metadata.gz: 0d5f3a319b557a01fee0ddd0d8fe7c84e1cbfc2f
4
+ data.tar.gz: 419ae2691da50ea20581c9fe217781c4806608cf
5
5
  SHA512:
6
- metadata.gz: 0b276ff8a464827928b021e29f7e8218a8686838f81ffea2aa1be6126fc474a21573696253c3a21f6c7d54a41ef02e5260872501d815890cdd739b857fcaffba
7
- data.tar.gz: c85a902b5fbf0b90a9413d67071f0be26312c0c22ac6e12cf082437257180db1f5bd392b06eb9beb50edf5ece25d84fec66f4e17dd19ae9b84051fd586acf6b0
6
+ metadata.gz: 0c29bf1967634a96253dc3b8ede68578eb6b15d832761c527c61c4be523098b9a3ac00a25edc51460157a9c42e7ef4750b8c71e37bb07e08c54dbb3bd530775b
7
+ data.tar.gz: 046f7fdae4b89f0809d37063e32363c3b01f0af2ff121aad7b25a11db038fa3ccba4b2b1ccd2717d3dda599458086da9defed22c6c5c5d0bb2885fb171e7dfe0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emay_sms (0.1.0)
4
+ emay_sms (0.1.1)
5
5
  savon (~> 2.7.2)
6
6
 
7
7
  GEM
@@ -51,7 +51,7 @@ GEM
51
51
  coderay (~> 1.1.0)
52
52
  method_source (~> 0.8.1)
53
53
  slop (~> 3.4)
54
- rack (1.6.0)
54
+ rack (1.6.4)
55
55
  rake (10.3.2)
56
56
  rb-fsevent (0.9.4)
57
57
  rb-inotify (0.9.5)
@@ -87,7 +87,7 @@ GEM
87
87
  thor (0.19.1)
88
88
  timers (4.0.1)
89
89
  hitimes
90
- uuid (2.3.7)
90
+ uuid (2.3.8)
91
91
  macaddr (~> 1.0)
92
92
  wasabi (3.3.1)
93
93
  httpi (~> 2.0)
data/README.md CHANGED
@@ -1,36 +1,5 @@
1
- <<<<<<< HEAD
2
- # EmaySms
3
-
4
- TODO: Write a gem description
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- gem 'emay_sms'
11
-
12
- And then execute:
13
-
14
- $ bundle
15
-
16
- Or install it yourself as:
17
-
18
- $ gem install emay_sms
19
-
20
- ## Usage
21
-
22
- TODO: Write usage instructions here
23
-
24
- ## Contributing
25
-
26
- 1. Fork it ( https://github.com/[my-github-username]/emay_sms/fork )
27
- 2. Create your feature branch (`git checkout -b my-new-feature`)
28
- 3. Commit your changes (`git commit -am 'Add some feature'`)
29
- 4. Push to the branch (`git push origin my-new-feature`)
30
- 5. Create a new Pull Request
31
1
  =======
32
2
  emay_sms
33
3
  ========
34
4
 
35
- 亿美软通短信接口
36
- >>>>>>> c7dfe596eb2180ee8474746591f9f6491550c3d0
5
+ 亿美软通短信接口
@@ -24,8 +24,12 @@ module EmaySms
24
24
  pretty_print_xml: true)
25
25
  end
26
26
 
27
- def sign_message(message)
28
- "#{EmaySms.config.sign}#{message}"
27
+ def sign_message(message, sign = nil)
28
+ if sign.nil?
29
+ "#{EmaySms.config.sign}#{message}"
30
+ else
31
+ "【#{sign}】#{message}"
32
+ end
29
33
  end
30
34
 
31
35
  def active
@@ -57,12 +61,12 @@ module EmaySms
57
61
  end
58
62
  end
59
63
 
60
- def send(message, mobiles = [])
64
+ def send(message, mobiles = [], sign = nil)
61
65
  response = client.call(:send_sms, message: { arg0: EmaySms.config.account,
62
66
  arg1: EmaySms.config.secret,
63
67
  arg2: "",
64
68
  arg3: mobiles,
65
- arg4: EmaySms.sign_message(message),
69
+ arg4: EmaySms.sign_message(message, sign),
66
70
  arg5: "",
67
71
  arg6: "UTF-8",
68
72
  arg7: 1,
@@ -1,3 +1,3 @@
1
1
  module EmaySms
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -13,7 +13,12 @@ describe "Service" do
13
13
  end
14
14
 
15
15
  it "should send message" do
16
- response = EmaySms.send("测试 #{Time.now.to_i}", ["13817513107", "18101801755", "18616015606"])
16
+ response = EmaySms.send("订单 #{Time.now.to_i} 已经团购成功, 请访问 http://www.baidu.com 支付.", ["13817513107", "18101801755", "18616015606"])
17
+ expect(response).to be true
18
+ end
19
+
20
+ it "should send message by custom sign" do
21
+ response = EmaySms.send("订单 #{Time.now.to_i} 已经团购成功, 请访问 http://www.baidu.com 支付.", ["13681695220"], "中国移动")
17
22
  expect(response).to be true
18
23
  end
19
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emay_sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - liuzelei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-09 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler