12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/wechat.rb', line 12
def self.with(options)
appid = Wechat.config.appid
secret = Wechat.config.secret
token_file = options[:toke_file] || Wechat.config.access_token
if (appid.nil? || secret.nil? || token_file.nil?)
puts "You need create ~/.wechat.yml with wechat appid and secret. For example:\n\n appid: <wechat appid>\n secret: <wechat secret>\n access_toke: \"/var/tmp/wechat_access_token\"\n\n"
exit 1
end
Wechat::Api.new(appid, secret, token_file)
end
|