wechat-bot 0.1.0.alpha → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +13 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/README.md +2 -2
- data/Rakefile +6 -4
- data/lib/wechat-bot.rb +3 -1
- data/lib/wechat/bot.rb +8 -6
- data/lib/wechat/bot/client.rb +7 -7
- data/lib/wechat/bot/configuration.rb +21 -19
- data/lib/wechat/bot/contact.rb +1 -1
- data/lib/wechat/bot/core.rb +1 -1
- data/lib/wechat/bot/exception.rb +5 -0
- data/lib/wechat/bot/http/adapter/js.rb +1 -1
- data/lib/wechat/bot/http/adapter/xml.rb +1 -1
- data/lib/wechat/bot/logger.rb +1 -1
- data/lib/wechat/bot/message.rb +29 -9
- data/lib/wechat/bot/message_data/{share_link.rb → share_card.rb} +1 -1
- data/lib/wechat/bot/version.rb +1 -1
- data/lib/wechat_bot.rb +3 -1
- data/wechat-bot.gemspec +3 -0
- metadata +23 -10
- data/.travis.yml +0 -5
- data/.vscode/launch.json +0 -65
- data/lib/wechat/bot/helper.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f51d686f64f0e38fe8db34c7b9bae5e6de249fc02ebcf98d4ddd4f94a96a342e
|
4
|
+
data.tar.gz: 9fffa5e215ce50566f1287ad2e38eed4b19bd0c9b5134ef4cca87c6df4d8fd1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f82d691486b461ebff9b0804e1cb6955f4b8f91f4ec96d10a664639776acc549daa328c58f92ff44ca004bd33afc4c682b631f379b106c57e039f074bebe268
|
7
|
+
data.tar.gz: 190fb8b8331da512d2ce7771193ccb7ab703d7b12c61c979d2436778e5b425796b39d3eee580665009600daf18ee5a161d41169b9b5fa054ffde0b46930f8353
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
wechat-bot
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.0
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# wechat-bot
|
2
2
|
|
3
|
-
[![Build Status](https://img.shields.io/
|
3
|
+
[![Build Status](https://img.shields.io/circleci/project/github/icyleaf/wechat-bot.svg?style=flat)](https://circleci.com/gh/icyleaf/wechat-bot)
|
4
4
|
[![Code Climate](https://img.shields.io/codeclimate/github/icyleaf/wechat-bot.svg?style=flat)](https://codeclimate.com/github/icyleaf/wechat-bot)
|
5
5
|
[![Inline docs](http://inch-ci.org/github/icyleaf/wechat-bot.svg?style=flat)](https://inch-ci.org/github/icyleaf/wechat-bot)
|
6
6
|
[![Gem version](https://img.shields.io/gem/v/wechat-bot.svg?style=flat)](https://rubygems.org/gems/wechat-bot)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
```ruby
|
14
14
|
require 'wechat-bot'
|
15
15
|
|
16
|
-
bot = Wechat::Bot
|
16
|
+
bot = Wechat::Bot.new do
|
17
17
|
on :message, "ping" do |message|
|
18
18
|
message.reply "PONG"
|
19
19
|
end
|
data/Rakefile
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
|
4
2
|
require 'wechat_bot'
|
5
3
|
require 'awesome_print'
|
6
4
|
|
5
|
+
require 'rspec/core/rake_task'
|
7
6
|
RSpec::Core::RakeTask.new(:spec)
|
8
7
|
|
9
|
-
|
8
|
+
require 'rubocop/rake_task'
|
9
|
+
RuboCop::RakeTask.new
|
10
|
+
|
11
|
+
task :default => [:rubocop, :spec]
|
10
12
|
|
11
13
|
desc 'Run a sample wechat bot'
|
12
14
|
task :bot do
|
@@ -25,7 +27,7 @@ task :bot do
|
|
25
27
|
else
|
26
28
|
m.reply m.media_id, type: :emoticon
|
27
29
|
end
|
28
|
-
when WeChat::Bot::Message::Kind::
|
30
|
+
when WeChat::Bot::Message::Kind::ShareCard
|
29
31
|
m.reply "标题:#{m.meta_data.title}\n描述:#{m.meta_data.description}\n#{m.meta_data.link}"
|
30
32
|
when WeChat::Bot::Message::Kind::System
|
31
33
|
m.reply "系统消息:#{m.message}"
|
data/lib/wechat-bot.rb
CHANGED
data/lib/wechat/bot.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
require "wechat/bot/
|
2
|
-
|
1
|
+
require "wechat/bot/version"
|
3
2
|
require "wechat/bot/core"
|
4
3
|
require "wechat/bot/client"
|
5
|
-
require "wechat/bot/
|
4
|
+
require "wechat/bot/exception"
|
5
|
+
require "wechat/bot/ext/wechat_emoji_string"
|
6
6
|
|
7
|
-
module WeChat
|
8
|
-
|
9
|
-
|
7
|
+
module WeChat
|
8
|
+
module Bot
|
9
|
+
def self.new(&block)
|
10
|
+
WeChat::Bot::Core.new(&block)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
data/lib/wechat/bot/client.rb
CHANGED
@@ -111,7 +111,7 @@ module WeChat::Bot
|
|
111
111
|
end
|
112
112
|
|
113
113
|
# 获取二维码图片
|
114
|
-
def show_qr_code(uuid
|
114
|
+
def show_qr_code(uuid)
|
115
115
|
@bot.logger.info "获取登录用扫描二维码 ... "
|
116
116
|
url = File.join(@bot.config.auth_url, "l", uuid)
|
117
117
|
qrcode = RQRCode::QRCode.new(url)
|
@@ -153,11 +153,11 @@ module WeChat::Bot
|
|
153
153
|
r = @session.get(File.join(@bot.config.auth_url, "cgi-bin/mmwebwx-bin/login"), params: params)
|
154
154
|
data = r.parse(:js)
|
155
155
|
status = case data["code"]
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
156
|
+
when 200 then :logged
|
157
|
+
when 201 then :scaned
|
158
|
+
when 408 then :waiting
|
159
|
+
else :timeout
|
160
|
+
end
|
161
161
|
|
162
162
|
[status, data]
|
163
163
|
end
|
@@ -559,7 +559,7 @@ module WeChat::Bot
|
|
559
559
|
#
|
560
560
|
# @return [void]
|
561
561
|
def params_sync_key
|
562
|
-
store(:sync_key)["List"].map {|i| i.values.join("_") }.join("|")
|
562
|
+
store(:sync_key)["List"].map { |i| i.values.join("_") }.join("|")
|
563
563
|
end
|
564
564
|
|
565
565
|
# 初始化变量
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
1
3
|
module WeChat::Bot
|
2
4
|
class Configuration < OpenStruct
|
3
5
|
# 默认配置
|
@@ -10,36 +12,36 @@ module WeChat::Bot
|
|
10
12
|
fireman: 'filehelper',
|
11
13
|
|
12
14
|
# WeChat Configurations
|
13
|
-
app_id:
|
14
|
-
auth_url:
|
15
|
+
app_id: 'wx782c26e4c19acffb',
|
16
|
+
auth_url: 'https://login.weixin.qq.com',
|
15
17
|
servers: [
|
16
18
|
{
|
17
|
-
index:
|
18
|
-
file:
|
19
|
-
push:
|
19
|
+
index: 'wx.qq.com',
|
20
|
+
file: 'file.wx.qq.com',
|
21
|
+
push: 'webpush.wx.qq.com',
|
20
22
|
},
|
21
23
|
{
|
22
|
-
index:
|
23
|
-
file:
|
24
|
-
push:
|
24
|
+
index: 'wx2.qq.com',
|
25
|
+
file: 'file.wx2.qq.com',
|
26
|
+
push: 'webpush.wx2.qq.com',
|
25
27
|
},
|
26
28
|
{
|
27
|
-
index:
|
28
|
-
file:
|
29
|
-
push:
|
29
|
+
index: 'wx8.qq.com',
|
30
|
+
file: 'file.wx8.qq.com',
|
31
|
+
push: 'webpush.wx8.qq.com',
|
30
32
|
},
|
31
33
|
{
|
32
|
-
index:
|
33
|
-
file:
|
34
|
-
push:
|
34
|
+
index: 'wechat.com',
|
35
|
+
file: 'file.web.wechat.com',
|
36
|
+
push: 'webpush.web.wechat.com',
|
35
37
|
},
|
36
38
|
{
|
37
|
-
index:
|
38
|
-
file:
|
39
|
-
push:
|
39
|
+
index: 'web2.wechat.com',
|
40
|
+
file: 'file.web2.wechat.com',
|
41
|
+
push: 'webpush.web2.wechat.com',
|
40
42
|
},
|
41
43
|
],
|
42
|
-
cookies:
|
44
|
+
cookies: 'wechat-bot-cookies.txt',
|
43
45
|
special_users: [
|
44
46
|
'newsapp', 'filehelper', 'weibo', 'qqmail',
|
45
47
|
'fmessage', 'tmessage', 'qmessage', 'qqsync',
|
@@ -51,7 +53,7 @@ module WeChat::Bot
|
|
51
53
|
'notification_messages', 'wxid_novlwrv3lqwv11',
|
52
54
|
'gh_22b87fa7cb3c', 'userexperience_alarm',
|
53
55
|
],
|
54
|
-
user_agent:
|
56
|
+
user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36',
|
55
57
|
}
|
56
58
|
end
|
57
59
|
|
data/lib/wechat/bot/contact.rb
CHANGED
@@ -133,7 +133,7 @@ module WeChat::Bot
|
|
133
133
|
|
134
134
|
# 满足群组类型且 nickname 为空时补充一个默认的群组名(参考微信 App 设计)
|
135
135
|
if attribute.to_sym == :nickname && value.to_s.empty? && @kind == Kind::Group
|
136
|
-
value = members.map {|m| m.nickname }.join("、")
|
136
|
+
value = members.map { |m| m.nickname }.join("、")
|
137
137
|
end
|
138
138
|
|
139
139
|
if data
|
data/lib/wechat/bot/core.rb
CHANGED
data/lib/wechat/bot/logger.rb
CHANGED
@@ -42,7 +42,7 @@ module WeChat::Bot
|
|
42
42
|
|
43
43
|
def fatal(exception)
|
44
44
|
message = ["#{exception.backtrace.first}: #{exception.message} (#{exception.class})"]
|
45
|
-
message.concat
|
45
|
+
message.concat(exception.backtrace[1..-1].map {|s| "\t" + s})
|
46
46
|
log(:fatal, message.join("\n"))
|
47
47
|
end
|
48
48
|
|
data/lib/wechat/bot/message.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "wechat/bot/message_data/
|
1
|
+
require "wechat/bot/message_data/share_card"
|
2
2
|
|
3
3
|
module WeChat::Bot
|
4
4
|
# 微信消息
|
@@ -10,10 +10,11 @@ module WeChat::Bot
|
|
10
10
|
Voice = :voice
|
11
11
|
ShortVideo = :short_video
|
12
12
|
Emoticon = :emoticon
|
13
|
-
|
13
|
+
ShareCard = :share_link
|
14
14
|
# RedPacage = :red_package
|
15
15
|
# BusinessCard = :business_card
|
16
16
|
# MusicLink = :music_link
|
17
|
+
Verify = :verify
|
17
18
|
System = :system
|
18
19
|
Unkown = :unkown
|
19
20
|
end
|
@@ -67,7 +68,7 @@ module WeChat::Bot
|
|
67
68
|
|
68
69
|
parse
|
69
70
|
|
70
|
-
@bot.logger.
|
71
|
+
@bot.logger.verbose "Message Raw: #{@raw}"
|
71
72
|
end
|
72
73
|
|
73
74
|
# 回复消息
|
@@ -76,6 +77,12 @@ module WeChat::Bot
|
|
76
77
|
to_user = @bot.contact_list.find(nickname: args[:nickname]) if args[:nickname]
|
77
78
|
|
78
79
|
message_type = args[:type] || :text
|
80
|
+
|
81
|
+
# if @bot.config.special_users.include?(to_user) && to_user != 'filehelper'
|
82
|
+
# @bot.logger.error "特殊账户无法回复: #{to_user}"
|
83
|
+
# raise NoReplyException, "特殊账户无法回复: #{to_user}"
|
84
|
+
# end
|
85
|
+
|
79
86
|
@bot.client.send(message_type, to_user, text)
|
80
87
|
end
|
81
88
|
|
@@ -89,17 +96,18 @@ module WeChat::Bot
|
|
89
96
|
message = @raw["Content"].convert_emoji
|
90
97
|
message = CGI.unescape_html(message) if @kinde != Message::Kind::Text
|
91
98
|
if match = group_message(message)
|
92
|
-
from_username = match[0]
|
99
|
+
# from_username = match[0]
|
93
100
|
message = match[1]
|
94
101
|
end
|
95
102
|
|
96
103
|
@message = message
|
104
|
+
# TODO: 来自于特殊账户无法获取联系人信息,需要单独处理
|
97
105
|
@from = @bot.contact_list.find(username: @raw["FromUserName"])
|
98
106
|
parse_emoticon if @kind == Message::Kind::Emoticon
|
99
107
|
|
100
108
|
case @kind
|
101
|
-
when Message::Kind::
|
102
|
-
@meta_data = MessageData::
|
109
|
+
when Message::Kind::ShareCard
|
110
|
+
@meta_data = MessageData::ShareCard.parse(@message)
|
103
111
|
end
|
104
112
|
|
105
113
|
parse_events
|
@@ -129,6 +137,10 @@ module WeChat::Bot
|
|
129
137
|
@message.match(regexp)
|
130
138
|
end
|
131
139
|
|
140
|
+
def at_message?
|
141
|
+
@at_mesage == true
|
142
|
+
end
|
143
|
+
|
132
144
|
# 解析消息来源
|
133
145
|
#
|
134
146
|
# 特殊账户/群聊/公众号/用户
|
@@ -155,9 +167,10 @@ module WeChat::Bot
|
|
155
167
|
# - 1: Text 文本消息
|
156
168
|
# - 3: Image 图片消息
|
157
169
|
# - 34: Voice 语言消息
|
170
|
+
# - 37: 验证消息
|
158
171
|
# - 42: BusinessCard 名片消息
|
159
172
|
# - 47: Emoticon 微信表情
|
160
|
-
# - 49:
|
173
|
+
# - 49: ShareCard 分享链接消息
|
161
174
|
# - 62: ShortVideo 短视频消息
|
162
175
|
# - 1000: System 系统消息
|
163
176
|
# - Unkown 未知消息
|
@@ -171,6 +184,8 @@ module WeChat::Bot
|
|
171
184
|
Message::Kind::Image
|
172
185
|
when 34
|
173
186
|
Message::Kind::Voice
|
187
|
+
when 37
|
188
|
+
Message::Kind::Verify
|
174
189
|
when 42
|
175
190
|
Message::Kind::BusinessCard
|
176
191
|
when 62
|
@@ -178,7 +193,7 @@ module WeChat::Bot
|
|
178
193
|
when 47
|
179
194
|
Message::Kind::Emoticon
|
180
195
|
when 49
|
181
|
-
Message::Kind::
|
196
|
+
Message::Kind::ShareCard
|
182
197
|
when 10000
|
183
198
|
Message::Kind::System
|
184
199
|
else
|
@@ -190,6 +205,9 @@ module WeChat::Bot
|
|
190
205
|
#
|
191
206
|
# - `:message` 用户消息
|
192
207
|
# - `:text` 文本消息
|
208
|
+
# - `:image` 图片消息
|
209
|
+
# - `:voice` 语音消息
|
210
|
+
# - `:short_video` 短视频消息
|
193
211
|
# - `:group` 群聊消息
|
194
212
|
# - `:at_message` @ 消息
|
195
213
|
#
|
@@ -199,8 +217,10 @@ module WeChat::Bot
|
|
199
217
|
@events << @kind
|
200
218
|
@events << @source
|
201
219
|
|
220
|
+
@at_mesage = false
|
202
221
|
if @source == :group && @raw["Content"] =~ /@([^\s]+)\s+(.*)/
|
203
222
|
@events << :at_message
|
223
|
+
@at_mesage = true
|
204
224
|
end
|
205
225
|
end
|
206
226
|
|
@@ -223,8 +243,8 @@ module WeChat::Bot
|
|
223
243
|
end
|
224
244
|
|
225
245
|
def parse_share
|
246
|
+
# TODO: 完成解析
|
226
247
|
data = MultiXml.parse(@message)
|
227
|
-
|
228
248
|
end
|
229
249
|
|
230
250
|
# 解析用户的群消息
|
data/lib/wechat/bot/version.rb
CHANGED
data/lib/wechat_bot.rb
CHANGED
data/wechat-bot.gemspec
CHANGED
@@ -21,9 +21,12 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
+
spec.required_ruby_version = ">= 2.1.0"
|
25
|
+
|
24
26
|
spec.add_development_dependency "bundler", "~> 1.14"
|
25
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
spec.add_development_dependency "rubocop", "~> 0.53.0"
|
27
30
|
spec.add_development_dependency "webmock"
|
28
31
|
spec.add_development_dependency "awesome_print"
|
29
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wechat-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- icyleaf
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.53.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.53.0
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: webmock
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,13 +157,12 @@ executables: []
|
|
143
157
|
extensions: []
|
144
158
|
extra_rdoc_files: []
|
145
159
|
files:
|
160
|
+
- ".circleci/config.yml"
|
146
161
|
- ".gitignore"
|
147
162
|
- ".rspec"
|
148
163
|
- ".rubocop.yml"
|
149
164
|
- ".ruby-gemset"
|
150
165
|
- ".ruby-version"
|
151
|
-
- ".travis.yml"
|
152
|
-
- ".vscode/launch.json"
|
153
166
|
- ".yardopts"
|
154
167
|
- CODE_OF_CONDUCT.md
|
155
168
|
- Gemfile
|
@@ -165,16 +178,16 @@ files:
|
|
165
178
|
- lib/wechat/bot/contact.rb
|
166
179
|
- lib/wechat/bot/contact_list.rb
|
167
180
|
- lib/wechat/bot/core.rb
|
181
|
+
- lib/wechat/bot/exception.rb
|
168
182
|
- lib/wechat/bot/ext/wechat_emoji_string.rb
|
169
183
|
- lib/wechat/bot/handler.rb
|
170
184
|
- lib/wechat/bot/handler_list.rb
|
171
|
-
- lib/wechat/bot/helper.rb
|
172
185
|
- lib/wechat/bot/http/adapter/js.rb
|
173
186
|
- lib/wechat/bot/http/adapter/xml.rb
|
174
187
|
- lib/wechat/bot/http/session.rb
|
175
188
|
- lib/wechat/bot/logger.rb
|
176
189
|
- lib/wechat/bot/message.rb
|
177
|
-
- lib/wechat/bot/message_data/
|
190
|
+
- lib/wechat/bot/message_data/share_card.rb
|
178
191
|
- lib/wechat/bot/pattern.rb
|
179
192
|
- lib/wechat/bot/version.rb
|
180
193
|
- lib/wechat_bot.rb
|
@@ -191,15 +204,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
204
|
requirements:
|
192
205
|
- - ">="
|
193
206
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
207
|
+
version: 2.1.0
|
195
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
209
|
requirements:
|
197
|
-
- - "
|
210
|
+
- - ">="
|
198
211
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
212
|
+
version: '0'
|
200
213
|
requirements: []
|
201
214
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.
|
215
|
+
rubygems_version: 2.7.3
|
203
216
|
signing_key:
|
204
217
|
specification_version: 4
|
205
218
|
summary: WeChat Bot for Ruby
|
data/.travis.yml
DELETED
data/.vscode/launch.json
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "0.2.0",
|
3
|
-
"configurations": [
|
4
|
-
{
|
5
|
-
"name": "Rake",
|
6
|
-
"type": "Ruby",
|
7
|
-
"request": "launch",
|
8
|
-
"cwd": "${workspaceRoot}",
|
9
|
-
"program": "${workspaceRoot}/vendor/rake",
|
10
|
-
"useBundler": true,
|
11
|
-
"args": [
|
12
|
-
"bot"
|
13
|
-
]
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"name": "Listen for rdebug-ide",
|
17
|
-
"type": "Ruby",
|
18
|
-
"request": "attach",
|
19
|
-
"cwd": "${workspaceRoot}",
|
20
|
-
"remoteHost": "127.0.0.1",
|
21
|
-
"remotePort": "1234",
|
22
|
-
"remoteWorkspaceRoot": "${workspaceRoot}"
|
23
|
-
},
|
24
|
-
{
|
25
|
-
"name": "Rails server",
|
26
|
-
"type": "Ruby",
|
27
|
-
"request": "launch",
|
28
|
-
"cwd": "${workspaceRoot}",
|
29
|
-
"program": "${workspaceRoot}/bin/rails",
|
30
|
-
"args": [
|
31
|
-
"server"
|
32
|
-
]
|
33
|
-
},
|
34
|
-
{
|
35
|
-
"name": "RSpec - all",
|
36
|
-
"type": "Ruby",
|
37
|
-
"request": "launch",
|
38
|
-
"cwd": "${workspaceRoot}",
|
39
|
-
"program": "${workspaceRoot}/bin/rspec",
|
40
|
-
"args": [
|
41
|
-
"-I",
|
42
|
-
"${workspaceRoot}"
|
43
|
-
]
|
44
|
-
},
|
45
|
-
{
|
46
|
-
"name": "RSpec - active spec file only",
|
47
|
-
"type": "Ruby",
|
48
|
-
"request": "launch",
|
49
|
-
"cwd": "${workspaceRoot}",
|
50
|
-
"program": "${workspaceRoot}/bin/rspec",
|
51
|
-
"args": [
|
52
|
-
"-I",
|
53
|
-
"${workspaceRoot}",
|
54
|
-
"${file}"
|
55
|
-
]
|
56
|
-
},
|
57
|
-
{
|
58
|
-
"name": "Cucumber",
|
59
|
-
"type": "Ruby",
|
60
|
-
"request": "launch",
|
61
|
-
"cwd": "${workspaceRoot}",
|
62
|
-
"program": "${workspaceRoot}/bin/cucumber"
|
63
|
-
}
|
64
|
-
]
|
65
|
-
}
|
data/lib/wechat/bot/helper.rb
DELETED