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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 41aa1ef9e06430dee0459e3bd3d33e532917e53b
4
- data.tar.gz: ba1c80d4a6d03aacd095cb8d809ac26666dd4c10
2
+ SHA256:
3
+ metadata.gz: 232ea3eb5e6e34f334af41ea551c1b4f4dd0bd05b60c163a31e110d7db97ad3d
4
+ data.tar.gz: 442f1fb8e3daa1bc5d73b053def6f129f9af1e9f795651cb967cb9b31cbc2707
5
5
  SHA512:
6
- metadata.gz: 4a454d20554dde8a311f9d30d839ea768b5906e4cad43c758d6783d972744aca56cd0c75ed7df56449fc18aca8b882c32df7b59266980d3ec0c79258a96c7cd0
7
- data.tar.gz: cc3610d5d6e7691dc34f4f2f0f668fc4e0af999956fab25cfc6fb200347df8e9346d222aa94fd92066d4e9aa29382c8e566d232427c4ea77e99f35965ea0912e
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](http://pry.github.com/). It therefore depends on *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][:value]
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][:value]
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-yml; do docker-compose -f $fn run --rm scenario; done
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
@@ -18,12 +18,33 @@ module PryRails
18
18
  Rails.application.config.console = Pry
19
19
  end
20
20
 
21
- if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) ||
22
- Rails::VERSION::MAJOR >= 4
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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module PryRails
4
- VERSION = "0.3.9"
4
+ VERSION = "0.3.10"
5
5
  end
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.10.4"
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.9
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: 2018-12-30 00:00:00.000000000 Z
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.10.4
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.10.4
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
- rubyforge_project:
144
- rubygems_version: 2.6.8
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: