pry-rails 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Gemfile +1 -1
  4. data/Rakefile +7 -1
  5. data/Readme.md +19 -7
  6. data/lib/pry-rails/model_formatter.rb +22 -12
  7. data/lib/pry-rails/prompt.rb +24 -18
  8. data/lib/pry-rails/railtie.rb +4 -2
  9. data/lib/pry-rails/version.rb +1 -1
  10. data/scenarios.yml +27 -0
  11. data/scenarios/rails30.docker-compose.yml +15 -0
  12. data/scenarios/rails30.dockerfile +5 -0
  13. data/scenarios/rails30.gemfile +7 -0
  14. data/scenarios/rails31.docker-compose.yml +15 -0
  15. data/scenarios/rails31.dockerfile +5 -0
  16. data/scenarios/rails31.gemfile +8 -0
  17. data/scenarios/rails32.docker-compose.yml +15 -0
  18. data/scenarios/rails32.dockerfile +5 -0
  19. data/scenarios/rails32.gemfile +8 -0
  20. data/scenarios/rails40.docker-compose.yml +15 -0
  21. data/scenarios/rails40.dockerfile +5 -0
  22. data/scenarios/rails40.gemfile +6 -0
  23. data/scenarios/rails41.docker-compose.yml +15 -0
  24. data/scenarios/rails41.dockerfile +5 -0
  25. data/scenarios/rails41.gemfile +7 -0
  26. data/scenarios/rails42.docker-compose.yml +15 -0
  27. data/scenarios/rails42.dockerfile +5 -0
  28. data/scenarios/rails42.gemfile +7 -0
  29. data/scenarios/rails50.docker-compose.yml +15 -0
  30. data/scenarios/rails50.dockerfile +5 -0
  31. data/scenarios/rails50.gemfile +7 -0
  32. data/scenarios/rails51.docker-compose.yml +15 -0
  33. data/scenarios/rails51.dockerfile +5 -0
  34. data/scenarios/rails51.gemfile +7 -0
  35. data/spec/config/environment.rb +6 -4
  36. data/spec/find_route_spec.rb +12 -12
  37. data/spec/railtie_spec.rb +7 -1
  38. data/spec/recognize_path_spec.rb +7 -7
  39. data/spec/show_model_spec.rb +3 -3
  40. metadata +28 -11
  41. data/Appraisals +0 -40
  42. data/gemfiles/rails30.gemfile +0 -8
  43. data/gemfiles/rails31.gemfile +0 -9
  44. data/gemfiles/rails32.gemfile +0 -9
  45. data/gemfiles/rails40.gemfile +0 -9
  46. data/gemfiles/rails41.gemfile +0 -9
  47. data/gemfiles/rails42.gemfile +0 -9
  48. data/gemfiles/rails50.gemfile +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 872ce478163eb40d95c6eeb4fe9e937e36b650b8
4
- data.tar.gz: 24b1c4fba3bd4bb30c47e9a092d0df98c035b9f8
3
+ metadata.gz: f3842beaf1c495fc474c8f601bc68430d5897855
4
+ data.tar.gz: 5f00502e1e79c391c9432a141d18e4b9e76f79db
5
5
  SHA512:
6
- metadata.gz: 65684708da223b83ae7a56a9cedb0c44249c2e791194831ea7b4d2d7e148e3cd38dd1f26d07938cf81b90be539cffb98ff4cd4641bb81c52e01481ca29218702
7
- data.tar.gz: 329c7a447152cb95becaf837e3239b43698b449dcf67c9354d9d658f82e0e040697153f6595d0170cef186f1469694c7d77200dfe889ef0a5e57b81a6291b552
6
+ metadata.gz: 542b7249eae25a491004cb5d3a515b99ba1b4616e8fdbac95ded9c77924175118e80e934505428d595dfdfc1c464b2129a6c192e2cf3f542aa7c60799efab0ec
7
+ data.tar.gz: 2c3c43bab0d9d0883cbb46dcb1497665edf030af26063356ec8c671de249b074411f43eff050048c3878b71a1186a51d7f168693eb73a361fa3eacaa9d617192
data/.gitignore CHANGED
@@ -4,4 +4,4 @@ Gemfile.lock
4
4
  pkg/*
5
5
  spec/log
6
6
  spec/tmp
7
- gemfiles/*.lock
7
+ scenarios/*.lock
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in pry-rails.gemspec
4
4
  gemspec
data/Rakefile CHANGED
@@ -23,7 +23,13 @@ end
23
23
 
24
24
  desc 'Start the Rails console'
25
25
  task :console => :development_env do
26
- require 'rails/commands/console'
26
+ if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1)
27
+ require 'rails/command'
28
+ require 'rails/commands/console/console_command'
29
+ else
30
+ require 'rails/commands/console'
31
+ end
32
+
27
33
  Rails::Console.start(Rails.application)
28
34
  end
29
35
 
data/Readme.md CHANGED
@@ -88,15 +88,27 @@ end
88
88
 
89
89
  # Developing and Testing
90
90
 
91
- To generate Gemfiles for Rails 3.0, 3.1, 3.2, 4.0, 4.1, and 4.2, run `rake
92
- appraisal:gemfiles appraisal:install`.
91
+ This repo uses [Roadshow] to generate a [Docker Compose] file for each
92
+ supported version of Rails (with a compatible version of Ruby for each one).
93
93
 
94
- You can then run the tests across all four versions with `rake appraisal`. You
95
- can also manually run the Rails console and server with `rake appraisal
96
- console` and `rake appraisal server`.
94
+ To run specs across all versions, you can either [get the Roadshow tool] and
95
+ run `roadshow run`, or use Docker Compose directly:
97
96
 
98
- For a specific version of Rails, use `rake appraisal:rails30`, `rake
99
- appraisal:rails31`, `rake appraisal:rails32`, etc.
97
+ ```
98
+ $ for fn in scenarios/*.docker-compose-yml; do docker-compose -f $fn run --rm scenario; done
99
+ ```
100
+
101
+ You can also manually run the Rails console and server on each version with
102
+ `roadshow run rake console` and `roadshow run rake server`, or run them on a
103
+ specific version with, e.g., `roadshow run -s rails40 rake console`.
104
+
105
+ To update the set of scenarios, edit `scenarios.yml` and run `roadshow
106
+ generate`, although the Gemfiles in the `scenarios` directory need to be
107
+ maintained manually.
108
+
109
+ [Roadshow]: https://github.com/rf-/roadshow
110
+ [Docker Compose]: https://docs.docker.com/compose/
111
+ [get the Roadshow tool]: https://github.com/rf-/roadshow/releases
100
112
 
101
113
  # Alternative
102
114
 
@@ -49,12 +49,12 @@ module PryRails
49
49
 
50
50
  model.relations.each do |other_model, ref|
51
51
  options = []
52
- options << 'autosave' if ref.options[:autosave]
53
- options << 'autobuild' if ref.options[:autobuild]
54
- options << 'validate' if ref.options[:validate]
52
+ options << 'autosave' if ref.options[:autosave] || ref.autosave?
53
+ options << 'autobuild' if ref.options[:autobuild] || ref.autobuilding?
54
+ options << 'validate' if ref.options[:validate] || ref.validate?
55
55
 
56
- if ref.options[:dependent]
57
- options << "dependent-#{ref.options[:dependent]}"
56
+ if ref.options[:dependent] || ref.dependent
57
+ options << "dependent-#{ref.options[:dependent] || ref.dependent}"
58
58
  end
59
59
 
60
60
  out.push format_association \
@@ -82,13 +82,23 @@ module PryRails
82
82
  end
83
83
 
84
84
  def kind_of_relation(relation)
85
- case relation.to_s.sub(/^Mongoid::Relations::/, '')
86
- when 'Referenced::Many' then 'has_many'
87
- when 'Referenced::One' then 'has_one'
88
- when 'Referenced::In' then 'belongs_to'
89
- when 'Embedded::Many' then 'embeds_many'
90
- when 'Embedded::One' then 'embeds_one'
91
- when 'Embedded::In' then 'embedded_in'
85
+ case relation.to_s.sub(/^Mongoid::(Relations::|Association::)/, '')
86
+ when 'Referenced::Many', 'Referenced::HasMany::Proxy'
87
+ 'has_many'
88
+ when 'Referenced::One', 'Referenced::HasOne::Proxy'
89
+ 'has_one'
90
+ when 'Referenced::In', 'Referenced::BelongsTo::Proxy'
91
+ 'belongs_to'
92
+ when 'Referenced::HasAndBelongsToMany::Proxy'
93
+ 'has_and_belongs_to_many'
94
+ when 'Embedded::Many', 'Embedded::EmbedsMany::Proxy'
95
+ 'embeds_many'
96
+ when 'Embedded::One', 'Embedded::EmbedsOne::Proxy'
97
+ 'embeds_one'
98
+ when 'Embedded::In', 'Embedded::EmbeddedIn::Proxy'
99
+ 'embedded_in'
100
+ else
101
+ '(unknown relation)'
92
102
  end
93
103
  end
94
104
 
@@ -18,24 +18,30 @@ module PryRails
18
18
  end
19
19
  end
20
20
 
21
- RAILS_PROMPT = [
22
- proc do |target_self, nest_level, pry|
23
- "[#{pry.input_array.size}] " \
24
- "[#{Prompt.project_name}][#{Prompt.formatted_env}] " \
25
- "#{Pry.config.prompt_name}(#{Pry.view_clip(target_self)})" \
26
- "#{":#{nest_level}" unless nest_level.zero?}> "
27
- end,
28
- proc do |target_self, nest_level, pry|
21
+ desc = "Includes the current Rails environment and project folder name.\n" \
22
+ "[1] [project_name][Rails.env] pry(main)>"
23
+ if Pry::Prompt.respond_to?(:add)
24
+ Pry::Prompt.add 'rails', desc, %w(> *) do |target_self, nest_level, pry, sep|
25
+ "[#{pry.input_ring.size}] " \
26
+ "[#{Prompt.project_name}][#{Prompt.formatted_env}] " \
27
+ "#{pry.config.prompt_name}(#{Pry.view_clip(target_self)})" \
28
+ "#{":#{nest_level}" unless nest_level.zero?}#{sep} "
29
+ end
30
+ else
31
+ draw_prompt = lambda do |target_self, nest_level, pry, sep|
29
32
  "[#{pry.input_array.size}] " \
30
- "[#{Prompt.project_name}][#{Prompt.formatted_env}] " \
31
- "#{Pry.config.prompt_name}(#{Pry.view_clip(target_self)})" \
32
- "#{":#{nest_level}" unless nest_level.zero?}* "
33
+ "[#{Prompt.project_name}][#{Prompt.formatted_env}] " \
34
+ "#{pry.config.prompt_name}(#{Pry.view_clip(target_self)})" \
35
+ "#{":#{nest_level}" unless nest_level.zero?}#{sep} "
33
36
  end
34
- ]
35
-
36
- Pry::Prompt::MAP["rails"] = {
37
- value: RAILS_PROMPT,
38
- description: "Includes the current Rails environment and project folder name.\n" \
39
- "[1] [project_name][Rails.env] pry(main)>"
40
- }
37
+ prompts = [
38
+ proc do |target_self, nest_level, pry|
39
+ draw_prompt.call(target_self, nest_level, pry, '>')
40
+ end,
41
+ proc do |target_self, nest_level, pry|
42
+ draw_prompt.call(target_self, nest_level, pry, '*')
43
+ end
44
+ ]
45
+ Pry::Prompt::MAP["rails"] = {value: prompts, description: desc}
46
+ end
41
47
  end
@@ -14,12 +14,14 @@ module PryRails
14
14
  end
15
15
  end
16
16
 
17
- if Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
17
+ if Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5 ||
18
+ Rails::VERSION::MAJOR == 6
18
19
  Rails.application.config.console = Pry
19
20
  end
20
21
 
21
22
  if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) ||
22
- Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
23
+ Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5 ||
24
+ Rails::VERSION::MAJOR == 6
23
25
  require "rails/console/app"
24
26
  require "rails/console/helpers"
25
27
  TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module PryRails
4
- VERSION = "0.3.6"
4
+ VERSION = "0.3.7"
5
5
  end
@@ -0,0 +1,27 @@
1
+ project: pryrails
2
+
3
+ shared:
4
+ from: ruby:2.4
5
+ cmd: "(bundle check || bundle install) && bundle exec rake"
6
+ service:
7
+ volumes:
8
+ - bundle_{{scenario_name}}:/usr/local/bundle
9
+ environment:
10
+ BUNDLE_GEMFILE: scenarios/{{scenario_name}}.gemfile
11
+ volumes:
12
+ bundle_{{scenario_name}}:
13
+
14
+ scenarios:
15
+ rails30:
16
+ from: ruby:2.0
17
+ rails31:
18
+ from: ruby:2.0
19
+ rails32:
20
+ from: ruby:2.0
21
+ rails40:
22
+ from: ruby:2.3
23
+ rails41:
24
+ from: ruby:2.3
25
+ rails42: {}
26
+ rails50: {}
27
+ rails51: {}
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails30.dockerfile
8
+ image: pryrails_scenario_rails30
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails30:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails30.gemfile
14
+ volumes:
15
+ bundle_rails30: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.0
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 3.0.0"
4
+ gem "sqlite3"
5
+ gem "test-unit"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails31.dockerfile
8
+ image: pryrails_scenario_rails31
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails31:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails31.gemfile
14
+ volumes:
15
+ bundle_rails31: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.0
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 3.1.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+ gem "test-unit"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails32.dockerfile
8
+ image: pryrails_scenario_rails32
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails32:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails32.gemfile
14
+ volumes:
15
+ bundle_rails32: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.0
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 3.2.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+ gem "test-unit"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails40.dockerfile
8
+ image: pryrails_scenario_rails40
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails40:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails40.gemfile
14
+ volumes:
15
+ bundle_rails40: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.3
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.0.0"
4
+ gem "sqlite3"
5
+
6
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails41.dockerfile
8
+ image: pryrails_scenario_rails41
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails41:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails41.gemfile
14
+ volumes:
15
+ bundle_rails41: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.3
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.1.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails42.dockerfile
8
+ image: pryrails_scenario_rails42
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails42:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails42.gemfile
14
+ volumes:
15
+ bundle_rails42: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.4
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 4.2.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails50.dockerfile
8
+ image: pryrails_scenario_rails50
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails50:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails50.gemfile
14
+ volumes:
15
+ bundle_rails50: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.4
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ ---
2
+ version: "2"
3
+ services:
4
+ scenario:
5
+ build:
6
+ context: ..
7
+ dockerfile: scenarios/rails51.dockerfile
8
+ image: pryrails_scenario_rails51
9
+ volumes:
10
+ - "..:/scenario"
11
+ - "bundle_rails51:/usr/local/bundle"
12
+ environment:
13
+ BUNDLE_GEMFILE: scenarios/rails51.gemfile
14
+ volumes:
15
+ bundle_rails51: {}
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.4
2
+ RUN mkdir -p /scenario
3
+ WORKDIR /scenario
4
+ ENV LANG=C.UTF-8
5
+ CMD (bundle check || bundle install) && bundle exec rake
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.1.0"
4
+ gem "mongoid"
5
+ gem "sqlite3"
6
+
7
+ gemspec :path => "../"
@@ -4,6 +4,11 @@ require 'active_support/core_ext'
4
4
 
5
5
  require 'pry-rails'
6
6
 
7
+ begin
8
+ require 'mongoid'
9
+ rescue LoadError # Mongoid doesn't support Rails 3.0
10
+ end
11
+
7
12
  # Initialize our test app
8
13
 
9
14
  class TestApp < Rails::Application
@@ -58,9 +63,7 @@ class Pokemon < ActiveRecord::Base
58
63
  has_many :beers, :through => :hacker
59
64
  end
60
65
 
61
- begin
62
- require 'mongoid'
63
-
66
+ if defined?(Mongoid)
64
67
  class Artist
65
68
  include Mongoid::Document
66
69
 
@@ -75,5 +78,4 @@ begin
75
78
  field :name, :type => String
76
79
  embedded_in :artist
77
80
  end
78
- rescue LoadError # Mongoid doesn't support Rails 3.0
79
81
  end
@@ -16,29 +16,29 @@ describe "find-route" do
16
16
 
17
17
  it 'returns the route for a single action' do
18
18
  output = mock_pry('find-route Admin::UsersController#show', 'exit-all')
19
- output.must_match /show GET/
20
- output.wont_match /index GET/
19
+ output.must_match(/show GET/)
20
+ output.wont_match(/index GET/)
21
21
  end
22
22
 
23
23
  it 'returns all the routes for a controller' do
24
24
  output = mock_pry('find-route Admin::UsersController', 'exit-all')
25
- output.must_match /index GET/
26
- output.must_match /show GET/
27
- output.must_match /new GET/
28
- output.must_match /edit GET/
29
- output.must_match /update (PATCH|PUT)/
30
- output.must_match /update PUT/
31
- output.must_match /destroy DELETE/
25
+ output.must_match(/index GET/)
26
+ output.must_match(/show GET/)
27
+ output.must_match(/new GET/)
28
+ output.must_match(/edit GET/)
29
+ output.must_match(/update (PATCH|PUT)/)
30
+ output.must_match(/update PUT/)
31
+ output.must_match(/destroy DELETE/)
32
32
  end
33
33
 
34
34
  it 'returns all routes for controllers under a namespace' do
35
35
  output = mock_pry('find-route Admin', 'exit-all')
36
- output.must_match /Routes for Admin::UsersController/
37
- output.must_match /Routes for Admin::ImagesController/
36
+ output.must_match(/Routes for Admin::UsersController/)
37
+ output.must_match(/Routes for Admin::ImagesController/)
38
38
  end
39
39
 
40
40
  it 'returns no routes found when controller is not recognized' do
41
41
  output = mock_pry('find-route Foo', 'exit-all')
42
- output.must_match /No routes found/
42
+ output.must_match(/No routes found/)
43
43
  end
44
44
  end
@@ -1,7 +1,13 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  require 'spec_helper'
4
- require 'rails/commands/console'
4
+
5
+ if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1)
6
+ require 'rails/command'
7
+ require 'rails/commands/console/console_command'
8
+ else
9
+ require 'rails/commands/console'
10
+ end
5
11
 
6
12
  describe PryRails::Railtie do
7
13
  it 'should start Pry instead of IRB and make the helpers available' do
@@ -28,21 +28,21 @@ describe "recognize-path" do
28
28
 
29
29
  it "prints info about controller/action that is bound to the given path" do
30
30
  output = mock_pry('recognize-path example.com', 'exit-all')
31
- output.must_match /controller.+foo/
32
- output.must_match /action.+index/
31
+ output.must_match(/controller.+foo/)
32
+ output.must_match(/action.+index/)
33
33
  end
34
34
 
35
35
  it "accepts short path" do
36
36
  output = mock_pry('recognize-path /booms/1/edit', 'exit-all')
37
- output.must_match /action.+edit/
38
- output.must_match /controller.+booms/
39
- output.must_match /id.+1/
37
+ output.must_match(/action.+edit/)
38
+ output.must_match(/controller.+booms/)
39
+ output.must_match(/id.+1/)
40
40
  end
41
41
 
42
42
  it "accepts -m switch" do
43
43
  output = mock_pry('recognize-path example.com/booms -m post', 'exit-all')
44
- output.must_match /controller.+booms/
45
- output.must_match /action.+create/
44
+ output.must_match(/controller.+booms/)
45
+ output.must_match(/action.+create/)
46
46
  end
47
47
 
48
48
  it "doesn't accept unknown methods" do
@@ -32,8 +32,8 @@ Artist
32
32
  embeds_many :instruments (validate)
33
33
  MODEL
34
34
 
35
- output.gsub! /^ *_type: String\n/, '' # mongoid 3.0 and 3.1 differ on this
36
- output.gsub! /Moped::BSON/, 'BSON' # mongoid 3 and 4 differ on this
35
+ output.gsub!(/^ *_type: String\n/, '') # mongoid 3.0 and 3.1 differ on this
36
+ output.gsub!(/Moped::BSON/, 'BSON') # mongoid 3 and 4 differ on this
37
37
  output.must_equal expected
38
38
  end
39
39
  end
@@ -50,6 +50,6 @@ MODEL
50
50
 
51
51
  it "should print help if no model name is given" do
52
52
  output = mock_pry('show-model', 'exit-all')
53
- output.must_match /Usage: show-model/
53
+ output.must_match(/Usage: show-model/)
54
54
  end
55
55
  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.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Wenglewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-26 00:00:00.000000000 Z
11
+ date: 2018-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -60,18 +60,10 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
- - Appraisals
64
63
  - Gemfile
65
64
  - LICENCE
66
65
  - Rakefile
67
66
  - Readme.md
68
- - gemfiles/rails30.gemfile
69
- - gemfiles/rails31.gemfile
70
- - gemfiles/rails32.gemfile
71
- - gemfiles/rails40.gemfile
72
- - gemfiles/rails41.gemfile
73
- - gemfiles/rails42.gemfile
74
- - gemfiles/rails50.gemfile
75
67
  - lib/pry-rails.rb
76
68
  - lib/pry-rails/commands.rb
77
69
  - lib/pry-rails/commands/find_route.rb
@@ -86,6 +78,31 @@ files:
86
78
  - lib/pry-rails/railtie.rb
87
79
  - lib/pry-rails/version.rb
88
80
  - pry-rails.gemspec
81
+ - scenarios.yml
82
+ - scenarios/rails30.docker-compose.yml
83
+ - scenarios/rails30.dockerfile
84
+ - scenarios/rails30.gemfile
85
+ - scenarios/rails31.docker-compose.yml
86
+ - scenarios/rails31.dockerfile
87
+ - scenarios/rails31.gemfile
88
+ - scenarios/rails32.docker-compose.yml
89
+ - scenarios/rails32.dockerfile
90
+ - scenarios/rails32.gemfile
91
+ - scenarios/rails40.docker-compose.yml
92
+ - scenarios/rails40.dockerfile
93
+ - scenarios/rails40.gemfile
94
+ - scenarios/rails41.docker-compose.yml
95
+ - scenarios/rails41.dockerfile
96
+ - scenarios/rails41.gemfile
97
+ - scenarios/rails42.docker-compose.yml
98
+ - scenarios/rails42.dockerfile
99
+ - scenarios/rails42.gemfile
100
+ - scenarios/rails50.docker-compose.yml
101
+ - scenarios/rails50.dockerfile
102
+ - scenarios/rails50.gemfile
103
+ - scenarios/rails51.docker-compose.yml
104
+ - scenarios/rails51.dockerfile
105
+ - scenarios/rails51.gemfile
89
106
  - spec/config/config.ru
90
107
  - spec/config/database.yml
91
108
  - spec/config/environment.rb
@@ -118,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
135
  version: '0'
119
136
  requirements: []
120
137
  rubyforge_project:
121
- rubygems_version: 2.6.8
138
+ rubygems_version: 2.6.14.3
122
139
  signing_key:
123
140
  specification_version: 4
124
141
  summary: Use Pry as your rails console
data/Appraisals DELETED
@@ -1,40 +0,0 @@
1
- appraise "rails30" do
2
- gem "rails", "3.0.20"
3
- gem "sqlite3"
4
- end
5
-
6
- appraise "rails31" do
7
- gem "rails", "3.1.12"
8
- gem "mongoid"
9
- gem "sqlite3"
10
- end
11
-
12
- appraise "rails32" do
13
- gem "rails", "3.2.21"
14
- gem "mongoid"
15
- gem "sqlite3"
16
- end
17
-
18
- appraise "rails40" do
19
- gem "rails", "4.0.13"
20
- gem "mongoid"
21
- gem "sqlite3"
22
- end
23
-
24
- appraise "rails41" do
25
- gem "rails", "4.1.9"
26
- gem "mongoid"
27
- gem "sqlite3"
28
- end
29
-
30
- appraise "rails42" do
31
- gem "rails", "4.2.0"
32
- gem "mongoid"
33
- gem "sqlite3"
34
- end
35
-
36
- appraise "rails50" do
37
- gem "rails", github: "rails/rails"
38
- gem 'arel', github: "rails/arel"
39
- gem "sqlite3"
40
- end
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "3.0.20"
6
- gem "sqlite3"
7
-
8
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "3.1.12"
6
- gem "mongoid"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "3.2.21"
6
- gem "mongoid"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "4.0.13"
6
- gem "mongoid"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "4.1.9"
6
- gem "mongoid"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "4.2.0"
6
- gem "mongoid"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", :github => "rails/rails"
6
- gem "arel", :github => "rails/arel"
7
- gem "sqlite3"
8
-
9
- gemspec :path => "../"