pryx 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/irbx +12 -0
- data/bin/pryx +14 -0
- data/lib/pryx/ap_hack.rb +3 -3
- data/lib/pryx/break_hack.rb +4 -0
- data/lib/pryx/pry_hack.rb +25 -11
- data/lib/pryx/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb416c6abf10f2f3445ba1f230cc22f2839fd2056e0eb789d292bc611a463c5
|
4
|
+
data.tar.gz: 560f480272bee2673cb6b415267dc224f30d618015123734f75d9a97ed3be311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f042cb7cbe7d0ca0ceec859a39ef85d90fe871ca45fe1d34151a4fb87f094a9658f0ee35ef70a4900bd1a0f7e957e766127c82e4083f219b46150ba7f9b07b2a
|
7
|
+
data.tar.gz: e695d828a869dd19a654e91d087ea3c3ad777a5c951b2f07cb54e832e721d7a4d0f4f3e54a993cde6dedc86a2957b5f51a0417d5393ef7f43c8d83934e8ec706
|
data/bin/irbx
ADDED
data/bin/pryx
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# (C) John Mair (banisterfiend)
|
5
|
+
# MIT license
|
6
|
+
|
7
|
+
$0 = 'pry'
|
8
|
+
|
9
|
+
require 'pry'
|
10
|
+
require 'pryx'
|
11
|
+
|
12
|
+
# Process command line options and run Pry
|
13
|
+
opts = Pry::CLI.parse_options
|
14
|
+
Pry::CLI.start(opts)
|
data/lib/pryx/ap_hack.rb
CHANGED
data/lib/pryx/break_hack.rb
CHANGED
data/lib/pryx/pry_hack.rb
CHANGED
@@ -93,20 +93,34 @@ end
|
|
93
93
|
|
94
94
|
# Hack for roda/rails, 在每一次发送请求之前,总是设定 ENV['Pry_was_started'] to nil.
|
95
95
|
# 这可以确保,pry! 总是会被拦截,但是仅仅只会被拦截一次。
|
96
|
+
|
97
|
+
class Pryx::PryHackForRodaRailsMiddleware
|
98
|
+
attr_reader :app
|
99
|
+
|
100
|
+
def initialize(app)
|
101
|
+
@app = app
|
102
|
+
end
|
103
|
+
|
104
|
+
def call(env)
|
105
|
+
ENV['Pry_was_started'] = nil
|
106
|
+
@app.call(env)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
96
110
|
begin
|
97
111
|
require 'roda'
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
def initialize(app)
|
102
|
-
@app = app
|
103
|
-
end
|
112
|
+
Roda.use Pryx::PryHackForRodaRailsMiddleware
|
113
|
+
rescue LoadError
|
114
|
+
end
|
104
115
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
116
|
+
begin
|
117
|
+
require 'active_support/lazy_load_hooks'
|
118
|
+
ActiveSupport.on_load(:before_configuration) do
|
119
|
+
# because exits less command error when use in container, use irb instead.
|
120
|
+
# require 'pry'
|
121
|
+
# require 'pryx'
|
122
|
+
# Rails.application.config.console = Pry
|
123
|
+
Rails.application.config.middleware.use Pryx::PryHackForRodaRailsMiddleware
|
109
124
|
end
|
110
|
-
Roda.use PryHackRodaMiddleware
|
111
125
|
rescue LoadError
|
112
126
|
end
|
data/lib/pryx/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pryx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Billy.Zheng(zw963)
|
@@ -140,13 +140,17 @@ description: ''
|
|
140
140
|
email:
|
141
141
|
- vil963@gmail.com
|
142
142
|
executables:
|
143
|
+
- irbx
|
143
144
|
- pry!
|
145
|
+
- pryx
|
144
146
|
extensions: []
|
145
147
|
extra_rdoc_files: []
|
146
148
|
files:
|
147
149
|
- LICENSE
|
148
150
|
- README.md
|
151
|
+
- bin/irbx
|
149
152
|
- bin/pry!
|
153
|
+
- bin/pryx
|
150
154
|
- lib/break/pry/extensions.rb
|
151
155
|
- lib/pry-byebug.rb
|
152
156
|
- lib/pry-byebug/WARN
|
@@ -191,5 +195,5 @@ requirements: []
|
|
191
195
|
rubygems_version: 3.3.3
|
192
196
|
signing_key:
|
193
197
|
specification_version: 4
|
194
|
-
summary:
|
198
|
+
summary: pry extension tools!
|
195
199
|
test_files: []
|