ruboty-wandbox 0.0.1 → 0.0.1.1
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/ruboty/handlers/wandbox.rb +6 -4
- data/lib/ruboty/wandbox/version.rb +1 -1
- 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: 07d43b7672043afc75eef06b5e01e3e51efe8371
|
4
|
+
data.tar.gz: 326ab0a934c2f4019707738d617f8df007ed6408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e681642e8c78fecf3d49b4dc8ec76fd70ec7ab6989edee1fe8e95c3d12fb11226991027cfe8e021f2bf57d16d1fe64894eaee478261d4f982642cb1479e9f4d
|
7
|
+
data.tar.gz: 26ab21ef01105c8db8c2c95bd983de357c08bbbbd7d2f290dd57a566f2184a231377205a33fbd149e9ee6a7be5ef300ff1b37301d4fba7d3a6c7c5dc937cb42f
|
@@ -39,7 +39,7 @@ module Ruboty
|
|
39
39
|
on /wandbox list/, name: 'languages', description: 'show compiler list'
|
40
40
|
on /wandbox setinput ?(?<input_uri>\S*)/, name: 'setinput', description: 'set input'
|
41
41
|
on /wandbox submit (?<language>\S+) (?<source_uri>\S+) ?(?<input_uri>\S*)/, name: 'submit', description: 'send code via uri'
|
42
|
-
on /
|
42
|
+
on /wandbox view ?(?<id>\w*)/, name: 'view', description: 'view submission'
|
43
43
|
def languages(message)
|
44
44
|
message.reply get_compiler_list.map{|k,v|k+': '+v*','+"\n"}.join
|
45
45
|
end
|
@@ -80,12 +80,14 @@ module Ruboty
|
|
80
80
|
resp=http.post(uri.path,JSON.generate(json),{
|
81
81
|
'Content-Type'=>'application/json',
|
82
82
|
})
|
83
|
-
|
84
|
-
|
83
|
+
json=JSON.parse(resp.body)
|
84
|
+
#p json
|
85
|
+
#@current_submission=json['permlink']
|
86
|
+
message.reply process(json)
|
85
87
|
}
|
86
88
|
end
|
87
89
|
def view(message)
|
88
|
-
#id: wandbox ID(空文字列なら直前のsubmitで返されたIDを使用)
|
90
|
+
#id: wandbox ID(空文字列なら直前のsubmitで返されたIDを使用 ※現在permlinkを保存しない設定なので特に意味は無い)
|
89
91
|
submission=message[:id]&&!message[:id].empty? ? message[:id] : @current_submission
|
90
92
|
resp=JSON.parse Net::HTTP.get URI.parse @base_uri+'api/permlink/'+submission
|
91
93
|
message.reply process(resp['result'])
|