rack_web_console 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b8df7ebd7c2bf7f065af4d93d02aca882aa895bf
4
- data.tar.gz: 11657a6c47ccb675fe17b308e292ef54f9f6fb2a
2
+ SHA256:
3
+ metadata.gz: 149b958c664ecf146ab6a5ef125b18a0284fc39da5f5d97f2cad19f56cbba14a
4
+ data.tar.gz: 0b8d95d928f868ee2ab240a31da3278e85890b0acc2144685334f37b5de8cd52
5
5
  SHA512:
6
- metadata.gz: 23825c6773b9cfeb8cfda5f28cda42b9f5b96c690eb233e90625742fb1cb3a491c9599f1545a359efbda2de49ba6579eddfce8fb409d9b1e1b278f5692a6e96c
7
- data.tar.gz: 69ddee769f14e56eac0976f8159d84ae3a4af541f2454fa3a616ab89a3bc92e5cd29f28bca430b2b3df8e3b08324636d0e69574cd38099a505cc237ad2c0f5b5
6
+ metadata.gz: 58e7a0c1cd2044bbb9ee24ebee8ba2582df912d07e66183300d56dd2311e8b1a2924928810c326dfabd39fdeb362f15fbab729c71617315b2b5a50c141f08556
7
+ data.tar.gz: 25042555f4c32705431ff7457e37afd109ee3a8d0591798ae2164e420608e2a5e5556745a6815ba234678c70e16ee4e4b03b4fdcfc70a14d65e865b7692e0d0d
data/.gitignore CHANGED
@@ -6,4 +6,6 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
+ /spec/log/
10
+ /spec/tmp/
9
11
  /tmp/
data/README.md CHANGED
@@ -57,12 +57,12 @@ you may have to do this:
57
57
  # app/controllers/console_controller.rb:
58
58
  require 'rack_web_console'
59
59
  class ConsoleController < ApplicationController
60
- skip_before_action :verify_authenticity_token
60
+ skip_forgery_protection
61
61
 
62
62
  def index
63
- status, headers, body = RackConsole.new(binding).call(env)
64
- response.headers.merge headers
65
- render inline: body.join("\n"), status: status
63
+ status, headers, body = RackConsole.new(binding).call(request.env)
64
+ response.headers.merge! headers
65
+ render html: body.join("\n").html_safe, status: status
66
66
  end
67
67
  end
68
68
 
@@ -73,9 +73,9 @@ Rails.application.routes.draw do
73
73
  end
74
74
  ```
75
75
 
76
- The `rails-web-console` gem is probably a better gem to use with Rails but this example should
77
- demonstrate how it could be used with basically any framework. If you're not really interested
78
- on some specific binding, you can simply mount it directly in config.ru:
76
+ This example demonstrates how to use it with a Rails project, but it could be used with basically
77
+ any framework. If you're not really interested on some specific binding, you can simply mount it
78
+ directly in config.ru:
79
79
 
80
80
  ```ruby
81
81
  # config.ru
@@ -1,3 +1,3 @@
1
1
  class RackConsole
2
- VERSION = '0.1.4'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -21,7 +21,9 @@ class RackConsole
21
21
  private
22
22
 
23
23
  def process_script(env)
24
- params = CGI.parse env['rack.input'].read
24
+ rack_input = env['rack.input']
25
+ rack_input.rewind
26
+ params = CGI.parse rack_input.read
25
27
  token = params['token']&.first.to_s
26
28
  return [403, {}, []] unless same_origin?(env) && token == @@token
27
29
  script = params['script'].first
@@ -16,8 +16,10 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_development_dependency 'bundler', '~> 1.12'
20
- spec.add_development_dependency 'rake', '~> 10.0'
21
- spec.add_development_dependency 'rspec', '~> 3.0'
22
- spec.add_development_dependency 'rack'
19
+ spec.add_development_dependency 'bundler', '~> 2.5'
20
+ spec.add_development_dependency 'rake', '~> 13.2'
21
+ spec.add_development_dependency 'rspec', '~> 3.13.0'
22
+ spec.add_development_dependency 'rack', '~> 3.1'
23
+ spec.add_development_dependency 'puma', '~> 6.4.3'
24
+ spec.add_development_dependency 'rails', '~> 7.2.1'
23
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack_web_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Rosenfeld Rosas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2024-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,57 +16,85 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '2.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '2.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: 3.13.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: 3.13.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: puma
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: 6.4.3
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 6.4.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 7.2.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '0'
69
- description:
96
+ version: 7.2.1
97
+ description:
70
98
  email:
71
99
  - rr.rosas@gmail.com
72
100
  executables: []
@@ -93,7 +121,7 @@ homepage: https://github.com/rosenfeld/rack_web_console
93
121
  licenses:
94
122
  - MIT
95
123
  metadata: {}
96
- post_install_message:
124
+ post_install_message:
97
125
  rdoc_options: []
98
126
  require_paths:
99
127
  - lib
@@ -108,9 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
136
  - !ruby/object:Gem::Version
109
137
  version: '0'
110
138
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.6.8
113
- signing_key:
139
+ rubygems_version: 3.5.16
140
+ signing_key:
114
141
  specification_version: 4
115
142
  summary: A web console for Rack apps.
116
143
  test_files: []