whatdidconsole 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -0
- data/lib/whatdidconsole.rb +8 -5
- data/lib/whatdidconsole/version.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec5af8b521bc90d39b304e5af0786bb6ac358053fe283d3973c800bcdc1d2f7
|
4
|
+
data.tar.gz: 0c344d98be581aad73d7d1bed28dd4caf3814b9fa0877b588fbda7be0f87593a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ec475aa9ae265fffa658d30c387ee3cf39af480f1970e4d620fb6b98637361884115e40815f7e36d180bd71605953de82a37340b41a0ab1fb9f24105ca050e
|
7
|
+
data.tar.gz: 6c239c6859174db0019b2997564763ab0eaad40594572615d748daa009790b5c69069d816dd85ec6b3c88521daec351ff2c305624ad300ef4b0ee541d10b48e7
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
whatdidconsole (0.2.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
minitest (5.14.4)
|
10
|
+
rake (13.0.6)
|
11
|
+
|
12
|
+
PLATFORMS
|
13
|
+
x86_64-darwin-20
|
14
|
+
|
15
|
+
DEPENDENCIES
|
16
|
+
minitest (~> 5.0)
|
17
|
+
rake (~> 13.0)
|
18
|
+
whatdidconsole!
|
19
|
+
|
20
|
+
BUNDLED WITH
|
21
|
+
2.2.15
|
data/lib/whatdidconsole.rb
CHANGED
@@ -17,7 +17,6 @@ module Whatdidconsole
|
|
17
17
|
IRB::Context.class_eval do
|
18
18
|
alias wdc_old_evaluate evaluate
|
19
19
|
alias wdc_old_initialize initialize
|
20
|
-
alias wdc_old_exit exit
|
21
20
|
|
22
21
|
def initialize(irb, workspace = nil, input_method = nil)
|
23
22
|
begin
|
@@ -31,6 +30,7 @@ module Whatdidconsole
|
|
31
30
|
|
32
31
|
http = Net::HTTP.new(uri.host, uri.port)
|
33
32
|
http.use_ssl = true
|
33
|
+
http.read_timeout = 2
|
34
34
|
request = Net::HTTP::Post.new(uri.request_uri)
|
35
35
|
request["Content-Type"] = "application/json"
|
36
36
|
request.basic_auth($wdc_config.application_id, $wdc_config.access_token)
|
@@ -38,6 +38,10 @@ module Whatdidconsole
|
|
38
38
|
response = http.request(request)
|
39
39
|
data = JSON.parse(response.body)
|
40
40
|
$wdc_session_id = data.fetch("session").fetch("id")
|
41
|
+
|
42
|
+
at_exit {
|
43
|
+
__wdc_send_session
|
44
|
+
}
|
41
45
|
rescue StandardError => e
|
42
46
|
puts "Failed to initialize Whatdidconsole: #{e}"
|
43
47
|
end
|
@@ -49,7 +53,7 @@ module Whatdidconsole
|
|
49
53
|
wdc_old_evaluate(line, line_no, exception: exception)
|
50
54
|
end
|
51
55
|
|
52
|
-
def
|
56
|
+
def __wdc_send_session
|
53
57
|
begin
|
54
58
|
uri =
|
55
59
|
URI::HTTP.build(
|
@@ -59,6 +63,7 @@ module Whatdidconsole
|
|
59
63
|
path: "/api/v0/applications/sessions/#{$wdc_session_id}/close"
|
60
64
|
)
|
61
65
|
http = Net::HTTP.new(uri.host, uri.port)
|
66
|
+
http.read_timeout = 2
|
62
67
|
http.use_ssl = true
|
63
68
|
request = Net::HTTP::Post.new(uri.request_uri)
|
64
69
|
request["Content-Type"] = "application/json"
|
@@ -69,9 +74,7 @@ module Whatdidconsole
|
|
69
74
|
rescue StandardError => e
|
70
75
|
puts "Failed to push session to Whatdidconsole: #{e}"
|
71
76
|
end
|
72
|
-
|
73
|
-
wdc_old_exit(ret)
|
74
77
|
end
|
75
78
|
end
|
76
79
|
end
|
77
|
-
end
|
80
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatdidconsole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan FRIMIN, Charly POLY, David RUYER
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Keep track of production accesses and actions. Your team get notified
|
14
14
|
of any production changes, making it easier to mitigate security issues and production
|
@@ -20,6 +20,7 @@ extra_rdoc_files: []
|
|
20
20
|
files:
|
21
21
|
- ".gitignore"
|
22
22
|
- Gemfile
|
23
|
+
- Gemfile.lock
|
23
24
|
- README.md
|
24
25
|
- Rakefile
|
25
26
|
- lib/whatdidconsole.rb
|