pry-rails 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Readme.md +16 -7
- data/lib/pry-rails/railtie.rb +23 -2
- data/lib/pry-rails/version.rb +1 -1
- data/pry-rails.gemspec +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 232ea3eb5e6e34f334af41ea551c1b4f4dd0bd05b60c163a31e110d7db97ad3d
|
4
|
+
data.tar.gz: 442f1fb8e3daa1bc5d73b053def6f129f9af1e9f795651cb967cb9b31cbc2707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2305eb1182638ebddf49bf5f6b628e47ccf174a7694b057de64ac86fc81fabb1013ab86e9ac5a2ddd7d2aac57a2359a831d4a4960aacc2a693c81a2d1659c02c
|
7
|
+
data.tar.gz: 8b926a5d9de78e44c507812ff4d5b245814d8be3596c509429d765f2108667afaaa2407fdc9099afe487c175f8d460349c750a6f67988d94df4ef649e92a891c
|
data/Readme.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
This project is not actively maintained and looking for a maintainer!
|
2
|
+
|
3
|
+
|
1
4
|
# Description
|
2
5
|
|
3
6
|
Avoid repeating yourself, use pry-rails instead of copying the initializer to every rails project.
|
4
|
-
This is a small gem which causes `rails console` to open [pry](
|
7
|
+
This is a small gem which causes `rails console` to open [pry](https://pry.github.io/). It therefore depends on *pry*.
|
5
8
|
|
6
9
|
# Prerequisites
|
7
10
|
|
@@ -71,9 +74,6 @@ Pokemon
|
|
71
74
|
updated_at: datetime
|
72
75
|
belongs_to hacker
|
73
76
|
has_many beers through hacker
|
74
|
-
|
75
|
-
$ DISABLE_PRY_RAILS=1 rails console
|
76
|
-
irb(main):001:0>
|
77
77
|
```
|
78
78
|
|
79
79
|
## Custom Rails prompt
|
@@ -82,7 +82,7 @@ If you want to permanently include the current Rails environment and project nam
|
|
82
82
|
in the Pry prompt, put the following lines in your project's `.pryrc`:
|
83
83
|
|
84
84
|
```ruby
|
85
|
-
Pry.config.prompt = Pry::Prompt[:rails]
|
85
|
+
Pry.config.prompt = Pry::Prompt[:rails]
|
86
86
|
```
|
87
87
|
|
88
88
|
If `.pryrc` could be loaded without pry-rails being available or installed,
|
@@ -90,13 +90,22 @@ guard against setting `Pry.config.prompt` to `nil`:
|
|
90
90
|
|
91
91
|
```ruby
|
92
92
|
if Pry::Prompt[:rails]
|
93
|
-
Pry.config.prompt = Pry::Prompt[:rails]
|
93
|
+
Pry.config.prompt = Pry::Prompt[:rails]
|
94
94
|
end
|
95
95
|
```
|
96
96
|
|
97
97
|
Check out `change-prompt --help` for information about temporarily
|
98
98
|
changing the prompt for the current Pry session.
|
99
99
|
|
100
|
+
## Disabling pry-rails
|
101
|
+
|
102
|
+
If pry-rails is included in your application but you would prefer not to use it, you may run the following command to set the appropriate environment variable to disable initialization and fall back to the default IRB console:
|
103
|
+
```shell
|
104
|
+
DISABLE_PRY_RAILS=1 rails console
|
105
|
+
```
|
106
|
+
|
107
|
+
Note that you may need to run `spring stop` first.
|
108
|
+
|
100
109
|
# Developing and Testing
|
101
110
|
|
102
111
|
This repo uses [Roadshow] to generate a [Docker Compose] file for each
|
@@ -106,7 +115,7 @@ To run specs across all versions, you can either [get the Roadshow tool] and
|
|
106
115
|
run `roadshow run`, or use Docker Compose directly:
|
107
116
|
|
108
117
|
```
|
109
|
-
$ for fn in scenarios/*.docker-compose
|
118
|
+
$ for fn in scenarios/*.docker-compose.yml; do docker-compose -f $fn run --rm scenario; done
|
110
119
|
```
|
111
120
|
|
112
121
|
You can also manually run the Rails console and server on each version with
|
data/lib/pry-rails/railtie.rb
CHANGED
@@ -18,12 +18,33 @@ module PryRails
|
|
18
18
|
Rails.application.config.console = Pry
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
major = Rails::VERSION::MAJOR
|
22
|
+
minor = Rails::VERSION::MINOR
|
23
|
+
|
24
|
+
if (major == 3 && minor >= 2) || (major >= 4 && (major < 7 || (major == 7 && minor < 2)))
|
23
25
|
require "rails/console/app"
|
24
26
|
require "rails/console/helpers"
|
25
27
|
TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
|
26
28
|
end
|
29
|
+
|
30
|
+
if major > 7 || (major == 7 && minor >= 2)
|
31
|
+
require "rails/commands/console/irb_console"
|
32
|
+
|
33
|
+
Module.new do
|
34
|
+
def reload!
|
35
|
+
puts "Reloading..."
|
36
|
+
Rails.application.reloader.reload!
|
37
|
+
end
|
38
|
+
|
39
|
+
::IRB::HelperMethod.helper_methods.each do |name, helper_method_class|
|
40
|
+
define_method name do |*args, **opts, &block|
|
41
|
+
helper_method_class.instance.execute(*args, **opts, &block)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
TOPLEVEL_BINDING.eval("self").extend self
|
46
|
+
end
|
47
|
+
end
|
27
48
|
end
|
28
49
|
end
|
29
50
|
end
|
data/lib/pry-rails/version.rb
CHANGED
data/pry-rails.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_dependency "pry", ">= 0.
|
23
|
+
s.add_dependency "pry", ">= 0.13.0"
|
24
24
|
s.add_development_dependency "appraisal"
|
25
25
|
s.add_development_dependency "minitest"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wenglewski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.13.0
|
20
20
|
type: :runtime
|
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: 0.
|
26
|
+
version: 0.13.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: appraisal
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- robin@wenglewski.de
|
58
58
|
executables: []
|
@@ -125,7 +125,7 @@ homepage: https://github.com/rweng/pry-rails
|
|
125
125
|
licenses:
|
126
126
|
- MIT
|
127
127
|
metadata: {}
|
128
|
-
post_install_message:
|
128
|
+
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
|
144
|
-
|
145
|
-
signing_key:
|
143
|
+
rubygems_version: 3.4.1
|
144
|
+
signing_key:
|
146
145
|
specification_version: 4
|
147
146
|
summary: Use Pry as your rails console
|
148
147
|
test_files:
|