luosimao 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: 7f62a95dfbedc336f0740f5fc0f77f0f8b2b7211
4
- data.tar.gz: 6591b1dee41d8bb61423fb68a530d20439077aae
3
+ metadata.gz: 489634a344de7a88d47c6fa4f59e455ddf14996c
4
+ data.tar.gz: ab046b101dcef02b80bd0faf715978b6fc3fe98c
5
5
  SHA512:
6
- metadata.gz: f069834379ba99d5a8e7e0841fe16aa9b8296668a0802f94106d3d42f0afcacb713d0401be19869c7447d800516b6585b66747685044c9df7d47b851313edb19
7
- data.tar.gz: 5460cbf2df1641b495772a919a492cde01f5bf5eec02852f01419dc2bbbd090b6648d2087a3446f2cc4c862e99bdf866d754971199006fcc1456bfc88c030b13
6
+ metadata.gz: 67e078e2e610a4bbe5c9a2fb5cf63aefb2fb618530712c3cd366e80977aeb728efa7e86e55739c7622f1ef79c8cac7e2974533eb11a81c3d93c242a957a4e7b0
7
+ data.tar.gz: 4b6d8d8dd94cc89ba2d4e0fc4d7609ac6a6c45a525fc305e361e90968e4d3fe2c3bec1666a90f4c3153c590ae11ff7372eb8d2fb58bd5d11166172881e4f8f5c
data/README.md CHANGED
@@ -19,9 +19,16 @@ Or install it yourself as:
19
19
  $ gem install luosimao
20
20
 
21
21
  ## Usage
22
-
23
- TODO: Write usage instructions here
24
-
22
+ ### Config
23
+ ```ruby
24
+ Luosimao.username = "danche"
25
+ Luosimao.key = "dianying"
26
+ Luosimao.brand = "【单车电影】"
27
+ ```
28
+ ### Send message
29
+ ```ruby
30
+ Luosimao::Message.to "10086", "hello world!"
31
+ ```
25
32
  ## Contributing
26
33
 
27
34
  1. Fork it ( https://github.com/[my-github-username]/luosimao/fork )
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
+ require 'json'
2
3
  module Luosimao
3
4
  module Message
4
- URL = "https://sms-api.luosimao.com/v1/send.json"
5
+ SEND_URL = "https://sms-api.luosimao.com/v1/send.json"
5
6
 
6
- def send(phone, content)
7
- url = URL.parse URL
7
+ def self.to(phone, content)
8
+ url = URI.parse SEND_URL
8
9
  post = Net::HTTP::Post.new(url.path)
9
10
  post.basic_auth(Luosimao.username, Luosimao.key)
10
11
  post.set_form_data({mobile: phone, message: "#{content}#{Luosimao.brand}"})
@@ -1,3 +1,3 @@
1
1
  module Luosimao
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luosimao
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
  - Villins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-31 00:00:00.000000000 Z
11
+ date: 2015-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.4.1
77
+ rubygems_version: 2.2.2
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: a warpper of luosimao send message