sinatra-weixin-robot 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module Sinatra
2
2
  module WeiXinRobot
3
- VERSION = '0.0.3' unless const_defined? :VERSION
3
+ VERSION = '0.0.4' unless const_defined? :VERSION
4
4
  def self.version
5
5
  "Sinatra::WeiXinRobot v#{VERSION}"
6
6
  end
@@ -7,7 +7,7 @@ module Sinatra
7
7
  module WeiXinRobot
8
8
  module RobotHelpers
9
9
  def generate_signature(token=nil)
10
- weixin_token = token || settings.wexin_token
10
+ weixin_token = token || settings.weixin_token
11
11
  timestamp, nonce = params[:timestamp], params[:nonce]
12
12
  weixin_sha1 = [weixin_token.to_s, timestamp.to_s, nonce.to_s].sort!.join
13
13
  Digest::SHA1.hexdigest(weixin_sha1)
@@ -177,7 +177,7 @@ module Sinatra
177
177
  end
178
178
  end #Reply
179
179
  def self.registered(robot)
180
- robot.set :weixin_token, ""
180
+ robot.set :weixin_token, nil
181
181
  robot.set :weixin_uri, "http://wwww.your-weixin-bot-url.com/"
182
182
  robot.set :weixin_path, URI(robot.settings.weixin_uri).path.to_s
183
183
  robot.helpers RobotHelpers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-weixin-robot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: