easy_weixin 0.0.8 → 0.0.9
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 +4 -4
- data/lib/easy_weixin.rb +5 -2
- data/lib/easy_weixin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9206ee70846db436d192ff9fb4c2764a1c48df5b
|
|
4
|
+
data.tar.gz: 72756ef2564b95fbe36f3015b4d712799b9d76da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d10ecaca75544322f6de133d2a891386bde6a73ad519c6893b5be721df2692051e7d77d0e352f484e00e7faaa17663c25123c7a429673fdaeb914d13fd422f0
|
|
7
|
+
data.tar.gz: 6d52b70b5ddde6433d2c240126731f000996254f174b5290655fa911ab70c3fd04f88b5f4d386211fd7364c7e6fd21eb5107737a0b39c1a6a2fd384bbd61a5a3
|
data/lib/easy_weixin.rb
CHANGED
|
@@ -6,7 +6,7 @@ require 'rack'
|
|
|
6
6
|
require 'open-uri'
|
|
7
7
|
|
|
8
8
|
module EasyWeixin
|
|
9
|
-
|
|
9
|
+
extend self
|
|
10
10
|
|
|
11
11
|
def text_msg(from, to, content)
|
|
12
12
|
msg = TextReplyMessage.new
|
|
@@ -16,10 +16,13 @@ module EasyWeixin
|
|
|
16
16
|
msg.to_xml
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def news_msg(from, to, articles, articleCount)
|
|
19
|
+
def news_msg(from, to, articles, articleCount=1)
|
|
20
20
|
msg = NewsReplyMessage.new
|
|
21
21
|
msg.ToUserName = to
|
|
22
22
|
msg.FromUserName = from
|
|
23
|
+
unless articles.is_a?(Array)
|
|
24
|
+
articles = [articles]
|
|
25
|
+
end
|
|
23
26
|
msg.Articles = articles
|
|
24
27
|
msg.ArticleCount = articleCount
|
|
25
28
|
msg.to_xml
|
data/lib/easy_weixin/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easy_weixin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- menghuanwd
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|