wei-backend 0.0.5 → 0.0.6

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: 23dbcfa965bc6620b9c97fa48fbc177cdd3a3c1b
4
- data.tar.gz: 6b06a2ffe5d7d029f1b5fbae6982fcfc123a22ac
3
+ metadata.gz: ff325112bc64a9c7e4016405c46d7f74eb885f01
4
+ data.tar.gz: 0ce3a35ddc850c70f6b92b9c01ff870144a52b06
5
5
  SHA512:
6
- metadata.gz: 35a59017b78eb7949354ba531d4dcef446ca2a3758f51e1597a057d03c81ba7b6b46d5b203c850bdc5a94dd46019c77142294a364c6718ad294a6e39442c4fad
7
- data.tar.gz: 84d270c3beaa61d60bde04e396cf4c542912cf592e38ce3e9f5652d5936a3c13c575a783213461c1c844a29cfdcddcba870a0f4bd58e848b8f9def598e58b806
6
+ metadata.gz: c6d0a648a635c7a49311130b2c2b3717dbe618def0427f27bb42b4e2f9a8b0ea628df5631ede4684e23a5098f21f03c071abf3ac8b5d34ecc15698f0f49bf8e5
7
+ data.tar.gz: cf4c1b08ddb62a25b899ce1a0123ecf77254bf1dc31fdc587d1adfe215bedd97bc3ddaad18c2066a31939e6f913c47ec62d14b7ebab5a59ff3740ff700d3e242
data/README.md CHANGED
@@ -1,4 +1,16 @@
1
+ <script>
2
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
6
+
7
+ ga('create', 'UA-46801609-2', 'github.com');
8
+ ga('send', 'pageview');
9
+
10
+ </script>
1
11
  ## 微信公众平台后台框架
12
+ [![Build Status](https://travis-ci.org/charleyw/weChat-backend.png?branch=master)](https://travis-ci.org/charleyw/weChat-backend)
13
+
2
14
  微信公众平台 后台框架,基于sinatra,使用DSL的思想帮助你以最快的**速度**开启微信公众平台开发.
3
15
 
4
16
  ## 仅需3步,一个文件创建一个微信后台程序
@@ -122,14 +134,16 @@ EOF
122
134
 
123
135
 
124
136
  * ### on_location
125
- 当用户想微信公众号分享位置信息时,微信会POST相应的位置信息到公众号后台服务器
137
+ 当用户向微信公众号分享位置信息时,微信会POST相应的位置信息到公众号后台服务器
126
138
  * `params[:ToUserName]`: 发送请求的用户
127
139
  * `params[:FromUserName]`: 公众号用户
128
140
  * `params[:CreateTime]`: 创建时间
129
141
  * `params[:MsgType]`: 消息类型,在这里是location
130
- * `params[:Latitude]`: 地理位置纬度
131
- * `params[:Longitude]`: 地理位置经度 * `params[:Precision]`: 地理位置精度
132
-
142
+ * `params[:Location_X]`: 地理位置纬度
143
+ * `params[:Location_Y]`: 地理位置经度
144
+ * `params[:Scale]`: 地图缩放大小
145
+ * `params[:Label]`: 地理位置信息
146
+
133
147
  ## 返回消息
134
148
  * 返回文本消息:
135
149
 
@@ -156,4 +170,7 @@ EOF
156
170
 
157
171
  ## Liscense
158
172
 
159
- © 2013 Wang Chao. This code is distributed under the MIT license.
173
+ © 2013 Wang Chao. This code is distributed under the MIT license.
174
+
175
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/charleyw/wechat-backend/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
176
+
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
4
+
5
+ task :default => :spec
@@ -13,7 +13,12 @@ module WeiBackend
13
13
  end
14
14
 
15
15
  def create_model data
16
- data.is_a?(Hash) || data.is_a?(Array) ? image_text_message(data) : text_message(data)
16
+ case data
17
+ when Hash, Array
18
+ image_text_message(data)
19
+ else
20
+ text_message(data)
21
+ end
17
22
  end
18
23
 
19
24
  def text_message(data)
@@ -1,3 +1,3 @@
1
1
  module WeiBackend
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wei-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wang Chao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -76,6 +76,7 @@ files:
76
76
  - Gemfile
77
77
  - Gemfile.lock
78
78
  - README.md
79
+ - Rakefile
79
80
  - examples/locations/Gemfile
80
81
  - examples/locations/Gemfile.lock
81
82
  - examples/locations/app.rb