weixin_rails_middleware 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weixin_rails_middleware/configuration.rb +2 -4
- data/lib/weixin_rails_middleware/helpers/auto_generate_weixin_token_secret_key.rb +2 -2
- data/lib/weixin_rails_middleware/helpers/reply_weixin_message_helper.rb +1 -1
- data/lib/weixin_rails_middleware/version.rb +1 -1
- metadata +2 -3
- data/lib/tasks/weixin_rails_middleware_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4561303d08506a46b5bfe5175b1fb2529e4e7052
|
4
|
+
data.tar.gz: 4e6aae5db8c81f3ed8ebe0817a1cb2b5e9b662d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f4e2a81e68d03db97d59771a8c95668455d166bb4a512d7fae4bffb2010d5f6fd1f98eef2b576bc90d04d5073e662b07566a54322a168e2d1b2adb30c9bc1d
|
7
|
+
data.tar.gz: a4b5e171495c7d0524302faed81a58535b58dc130d84e07d9c2c0590cc21889867f83f89803fcdae425a86a5eb0c7ef09df7a44fc41046ceca0aef7af6c46fa0
|
@@ -15,16 +15,14 @@ module WeixinRailsMiddleware
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class Configuration
|
18
|
-
|
19
|
-
|
20
|
-
attr_accessor :public_account_class, :weixin_token_string, :weixin_secret_string
|
18
|
+
attr_accessor :public_account_class, :weixin_token_string
|
19
|
+
attr_accessor :weixin_secret_string
|
21
20
|
|
22
21
|
end
|
23
22
|
|
24
23
|
module ConfigurationHelpers
|
25
24
|
extend ActiveSupport::Concern
|
26
25
|
|
27
|
-
|
28
26
|
def weixin_token_string
|
29
27
|
@weixin_token_string ||= WeixinRailsMiddleware.config.weixin_token_string.to_s
|
30
28
|
end
|
@@ -6,7 +6,7 @@ module WeixinRailsMiddleware
|
|
6
6
|
|
7
7
|
before_create do
|
8
8
|
# TODO: refactor
|
9
|
-
self.weixin_secret_key =
|
9
|
+
self.weixin_secret_key = generate_weixin_secret_key
|
10
10
|
self.weixin_token = WeiXinUniqueToken.generate
|
11
11
|
end
|
12
12
|
end
|
@@ -14,7 +14,7 @@ module WeixinRailsMiddleware
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def generate_weixin_secret_key
|
17
|
-
WeiXinUniqueToken.generate(generator: :urlsafe_base64, size:
|
17
|
+
WeiXinUniqueToken.generate(generator: :urlsafe_base64, size: 32).downcase
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -85,7 +85,7 @@ module WeixinRailsMiddleware
|
|
85
85
|
image
|
86
86
|
end
|
87
87
|
|
88
|
-
def
|
88
|
+
def reply_image_message(from=nil, to=nil, image)
|
89
89
|
message = ImageReplyMessage.new
|
90
90
|
message.FromUserName = from || @weixin_message.ToUserName
|
91
91
|
message.ToUserName = to || @weixin_message.FromUserName
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weixin_rails_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lanrion
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -110,7 +110,6 @@ files:
|
|
110
110
|
- lib/generators/templates/weixin_controller.rb
|
111
111
|
- lib/generators/weixin_rails_middleware/install_generator.rb
|
112
112
|
- lib/generators/weixin_rails_middleware/migration_generator.rb
|
113
|
-
- lib/tasks/weixin_rails_middleware_tasks.rake
|
114
113
|
- lib/weixin_rails_middleware.rb
|
115
114
|
- lib/weixin_rails_middleware/configuration.rb
|
116
115
|
- lib/weixin_rails_middleware/engine.rb
|