wechat_public 0.0.7 → 0.0.8
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/wechat_public/version.rb +1 -1
- data/lib/wechat_public.rb +16 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 758fb3c032d812c4ee223f4b07656f6305d8fabe
|
4
|
+
data.tar.gz: bc18663ff560aeb54cc23538147fa6af0c0ddb9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a280db83053f256d7ea11bf0095037c2769bdd75e2a45a2b46d5b39a6057e56e966ff9f1bea09cb3bf0b9edf61fd150a4a7e47dfc80e5d6aa694ee1f6cd5d81
|
7
|
+
data.tar.gz: d2c2bd58056002c065097d71965184209c833f73342fabd2bd18dd6caa00648b9f2f5885dafba1d3e834d4d358e6179b3256016967ecd87b499df9fe7a381b40
|
data/lib/wechat_public.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require "wechat_public/version"
|
2
2
|
|
3
3
|
module WechatPublic
|
4
|
-
autoload :Message, "
|
5
|
-
autoload :Responder, "
|
6
|
-
autoload :Response, "
|
4
|
+
autoload :Message, "wechat/message"
|
5
|
+
autoload :Responder, "wechat/responder"
|
6
|
+
autoload :Response, "wechat/response"
|
7
7
|
|
8
8
|
class AccessTokenExpiredError < StandardError; end
|
9
9
|
class ResponseError < StandardError
|
@@ -37,21 +37,21 @@ module WechatPublic
|
|
37
37
|
@api ||= WechatPublic::Api.new(self.config.appid, self.config.secret, self.config.access_token)
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
end
|
41
|
+
|
42
|
+
puts "before 判断 ActionController::Base...加载了么",ActionController::Base
|
43
|
+
if defined? ActionController::Base
|
44
|
+
class ActionController::Base
|
45
|
+
def self.wechat_responder opts={}
|
46
|
+
self.send(:include, WechatPublic::Responder)
|
47
|
+
if (opts.empty?)
|
48
|
+
self.wechat = WechatPublic.api
|
49
|
+
self.token = WechatPublic.config.token
|
50
|
+
else
|
51
|
+
self.wechat = WechatPublic::Api.new(opts[:appid], opts[:secret], opts[:access_token])
|
52
|
+
self.token = opts[:token]
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
55
|
-
|
56
56
|
end
|
57
57
|
|