pry-rails 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -1
- data/lib/pry-rails/commands/show_models.rb +4 -0
- data/lib/pry-rails/commands/show_routes.rb +20 -4
- data/lib/pry-rails/prompt.rb +5 -1
- data/lib/pry-rails/railtie.rb +2 -4
- data/lib/pry-rails/version.rb +1 -1
- data/scenarios.yml +4 -1
- data/scenarios/rails30.dockerfile +1 -1
- data/scenarios/rails31.dockerfile +1 -1
- data/scenarios/rails32.dockerfile +1 -1
- data/scenarios/rails40.dockerfile +1 -1
- data/scenarios/rails41.dockerfile +1 -1
- data/scenarios/rails42.dockerfile +1 -1
- data/scenarios/rails50.dockerfile +1 -1
- data/scenarios/rails51.dockerfile +1 -1
- data/scenarios/rails52.docker-compose.yml +15 -0
- data/scenarios/rails52.dockerfile +5 -0
- data/scenarios/rails52.gemfile +7 -0
- data/scenarios/rails60.docker-compose.yml +15 -0
- data/scenarios/rails60.dockerfile +5 -0
- data/scenarios/rails60.gemfile +7 -0
- data/spec/railtie_spec.rb +2 -1
- data/spec/show_models_spec.rb +1 -1
- data/spec/show_routes_spec.rb +4 -4
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41aa1ef9e06430dee0459e3bd3d33e532917e53b
|
4
|
+
data.tar.gz: ba1c80d4a6d03aacd095cb8d809ac26666dd4c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a454d20554dde8a311f9d30d839ea768b5906e4cad43c758d6783d972744aca56cd0c75ed7df56449fc18aca8b882c32df7b59266980d3ec0c79258a96c7cd0
|
7
|
+
data.tar.gz: cc3610d5d6e7691dc34f4f2f0f668fc4e0af999956fab25cfc6fb200347df8e9346d222aa94fd92066d4e9aa29382c8e566d232427c4ea77e99f35965ea0912e
|
data/Rakefile
CHANGED
@@ -23,7 +23,8 @@ end
|
|
23
23
|
|
24
24
|
desc 'Start the Rails console'
|
25
25
|
task :console => :development_env do
|
26
|
-
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1)
|
26
|
+
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1) ||
|
27
|
+
Rails::VERSION::MAJOR >= 6
|
27
28
|
require 'rails/command'
|
28
29
|
require 'rails/commands/console/console_command'
|
29
30
|
else
|
@@ -40,6 +40,10 @@ class PryRails::ShowModels < Pry::ClassCommand
|
|
40
40
|
models = []
|
41
41
|
|
42
42
|
ObjectSpace.each_object do |o|
|
43
|
+
# If this is deprecated, calling any methods on it will emit a warning,
|
44
|
+
# so just back away slowly.
|
45
|
+
next if ActiveSupport::Deprecation::DeprecationProxy === o
|
46
|
+
|
43
47
|
is_model = false
|
44
48
|
|
45
49
|
begin
|
@@ -17,10 +17,12 @@ class PryRails::ShowRoutes < Pry::ClassCommand
|
|
17
17
|
Rails.application.reload_routes!
|
18
18
|
all_routes = Rails.application.routes.routes
|
19
19
|
|
20
|
-
formatted =
|
21
|
-
|
20
|
+
formatted =
|
21
|
+
if Rails::VERSION::MAJOR >= 6
|
22
|
+
process_rails_6_and_higher(all_routes)
|
23
|
+
elsif Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
|
22
24
|
process_rails_4_and_5(all_routes)
|
23
|
-
|
25
|
+
elsif Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 2
|
24
26
|
process_rails_3_2(all_routes)
|
25
27
|
else
|
26
28
|
process_rails_3_0_and_3_1(all_routes)
|
@@ -64,12 +66,26 @@ class PryRails::ShowRoutes < Pry::ClassCommand
|
|
64
66
|
|
65
67
|
def process_rails_3_2(all_routes)
|
66
68
|
require 'rails/application/route_inspector'
|
69
|
+
|
67
70
|
Rails::Application::RouteInspector.new.format(all_routes)
|
68
71
|
end
|
69
72
|
|
70
73
|
def process_rails_4_and_5(all_routes)
|
71
74
|
require 'action_dispatch/routing/inspector'
|
72
|
-
|
75
|
+
|
76
|
+
ActionDispatch::Routing::RoutesInspector.
|
77
|
+
new(all_routes).
|
78
|
+
format(ActionDispatch::Routing::ConsoleFormatter.new).
|
79
|
+
split(/\n/)
|
80
|
+
end
|
81
|
+
|
82
|
+
def process_rails_6_and_higher(all_routes)
|
83
|
+
require 'action_dispatch/routing/inspector'
|
84
|
+
|
85
|
+
ActionDispatch::Routing::RoutesInspector.
|
86
|
+
new(all_routes).
|
87
|
+
format(ActionDispatch::Routing::ConsoleFormatter::Sheet.new).
|
88
|
+
split(/\n/)
|
73
89
|
end
|
74
90
|
|
75
91
|
PryRails::Commands.add_command(self)
|
data/lib/pry-rails/prompt.rb
CHANGED
@@ -13,7 +13,11 @@ module PryRails
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def project_name
|
16
|
-
Rails
|
16
|
+
if Rails::VERSION::MAJOR >= 6
|
17
|
+
Rails.application.class.module_parent_name.underscore
|
18
|
+
else
|
19
|
+
Rails.application.class.parent_name.underscore
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
data/lib/pry-rails/railtie.rb
CHANGED
@@ -14,14 +14,12 @@ module PryRails
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
if Rails::VERSION::MAJOR
|
18
|
-
Rails::VERSION::MAJOR == 6
|
17
|
+
if Rails::VERSION::MAJOR >= 4
|
19
18
|
Rails.application.config.console = Pry
|
20
19
|
end
|
21
20
|
|
22
21
|
if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) ||
|
23
|
-
Rails::VERSION::MAJOR
|
24
|
-
Rails::VERSION::MAJOR == 6
|
22
|
+
Rails::VERSION::MAJOR >= 4
|
25
23
|
require "rails/console/app"
|
26
24
|
require "rails/console/helpers"
|
27
25
|
TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
|
data/lib/pry-rails/version.rb
CHANGED
data/scenarios.yml
CHANGED
@@ -2,7 +2,7 @@ project: pryrails
|
|
2
2
|
|
3
3
|
shared:
|
4
4
|
from: ruby:2.4
|
5
|
-
cmd: "(bundle check || bundle install) && bundle exec rake"
|
5
|
+
cmd: "(bundle check || (gem install bundler && bundle install)) && bundle exec rake"
|
6
6
|
service:
|
7
7
|
volumes:
|
8
8
|
- bundle_{{scenario_name}}:/usr/local/bundle
|
@@ -25,3 +25,6 @@ scenarios:
|
|
25
25
|
rails42: {}
|
26
26
|
rails50: {}
|
27
27
|
rails51: {}
|
28
|
+
rails52: {}
|
29
|
+
rails60:
|
30
|
+
from: ruby:2.5
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
version: "2"
|
3
|
+
services:
|
4
|
+
scenario:
|
5
|
+
build:
|
6
|
+
context: ..
|
7
|
+
dockerfile: scenarios/rails52.dockerfile
|
8
|
+
image: pryrails_scenario_rails52
|
9
|
+
volumes:
|
10
|
+
- "..:/scenario"
|
11
|
+
- "bundle_rails52:/usr/local/bundle"
|
12
|
+
environment:
|
13
|
+
BUNDLE_GEMFILE: scenarios/rails52.gemfile
|
14
|
+
volumes:
|
15
|
+
bundle_rails52: {}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
version: "2"
|
3
|
+
services:
|
4
|
+
scenario:
|
5
|
+
build:
|
6
|
+
context: ..
|
7
|
+
dockerfile: scenarios/rails60.dockerfile
|
8
|
+
image: pryrails_scenario_rails60
|
9
|
+
volumes:
|
10
|
+
- "..:/scenario"
|
11
|
+
- "bundle_rails60:/usr/local/bundle"
|
12
|
+
environment:
|
13
|
+
BUNDLE_GEMFILE: scenarios/rails60.gemfile
|
14
|
+
volumes:
|
15
|
+
bundle_rails60: {}
|
data/spec/railtie_spec.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1)
|
5
|
+
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1) ||
|
6
|
+
Rails::VERSION::MAJOR >= 6
|
6
7
|
require 'rails/command'
|
7
8
|
require 'rails/commands/console/console_command'
|
8
9
|
else
|
data/spec/show_models_spec.rb
CHANGED
data/spec/show_routes_spec.rb
CHANGED
@@ -10,20 +10,20 @@ describe "show-routes" do
|
|
10
10
|
it "should print a list of routes" do
|
11
11
|
output = mock_pry('show-routes', 'exit-all')
|
12
12
|
|
13
|
-
output.must_match %r{
|
13
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should print a list of routes which include grep option" do
|
17
17
|
output = mock_pry('show-routes -G edit', 'exit-all')
|
18
18
|
|
19
|
-
output.must_match %r{
|
20
|
-
output.must_match %r{
|
19
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
20
|
+
output.must_match %r{ edit_beer GET /beer/edit}
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should filter list based on multiple grep options" do
|
24
24
|
output = mock_pry('show-routes -G edit -G pokemon', 'exit-all')
|
25
25
|
|
26
|
-
output.must_match %r{
|
26
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
27
27
|
output.wont_match %r{edit_beer}
|
28
28
|
end
|
29
29
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wenglewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -103,6 +103,12 @@ files:
|
|
103
103
|
- scenarios/rails51.docker-compose.yml
|
104
104
|
- scenarios/rails51.dockerfile
|
105
105
|
- scenarios/rails51.gemfile
|
106
|
+
- scenarios/rails52.docker-compose.yml
|
107
|
+
- scenarios/rails52.dockerfile
|
108
|
+
- scenarios/rails52.gemfile
|
109
|
+
- scenarios/rails60.docker-compose.yml
|
110
|
+
- scenarios/rails60.dockerfile
|
111
|
+
- scenarios/rails60.gemfile
|
106
112
|
- spec/config/config.ru
|
107
113
|
- spec/config/database.yml
|
108
114
|
- spec/config/environment.rb
|
@@ -135,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
141
|
version: '0'
|
136
142
|
requirements: []
|
137
143
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.6.
|
144
|
+
rubygems_version: 2.6.8
|
139
145
|
signing_key:
|
140
146
|
specification_version: 4
|
141
147
|
summary: Use Pry as your rails console
|