mega-pro-hub 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/mega-pro-hub.gemspec +12 -0
- data/pry-rails-0.3.11/Gemfile +4 -0
- data/pry-rails-0.3.11/LICENCE +20 -0
- data/pry-rails-0.3.11/Rakefile +44 -0
- data/pry-rails-0.3.11/Readme.md +136 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/find_route.rb +84 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/recognize_path.rb +35 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/show_middleware.rb +71 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/show_model.rb +44 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/show_models.rb +84 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands/show_routes.rb +92 -0
- data/pry-rails-0.3.11/lib/pry-rails/commands.rb +11 -0
- data/pry-rails-0.3.11/lib/pry-rails/console.rb +7 -0
- data/pry-rails-0.3.11/lib/pry-rails/model_formatter.rb +111 -0
- data/pry-rails-0.3.11/lib/pry-rails/prompt.rb +51 -0
- data/pry-rails-0.3.11/lib/pry-rails/railtie.rb +50 -0
- data/pry-rails-0.3.11/lib/pry-rails/version.rb +5 -0
- data/pry-rails-0.3.11/lib/pry-rails.rb +11 -0
- data/pry-rails-0.3.11/pry-rails.gemspec +26 -0
- data/pry-rails-0.3.11/scenarios/rails30.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails30.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails30.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails31.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails31.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails31.gemfile +8 -0
- data/pry-rails-0.3.11/scenarios/rails32.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails32.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails32.gemfile +8 -0
- data/pry-rails-0.3.11/scenarios/rails40.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails40.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails40.gemfile +6 -0
- data/pry-rails-0.3.11/scenarios/rails41.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails41.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails41.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails42.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails42.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails42.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails50.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails50.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails50.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails51.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails51.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails51.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails52.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails52.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails52.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios/rails60.docker-compose.yml +15 -0
- data/pry-rails-0.3.11/scenarios/rails60.dockerfile +5 -0
- data/pry-rails-0.3.11/scenarios/rails60.gemfile +7 -0
- data/pry-rails-0.3.11/scenarios.yml +30 -0
- data/pry-rails-0.3.11/spec/config/config.ru +1 -0
- data/pry-rails-0.3.11/spec/config/database.yml +6 -0
- data/pry-rails-0.3.11/spec/config/environment.rb +81 -0
- data/pry-rails-0.3.11/spec/config/routes.rb +5 -0
- data/pry-rails-0.3.11/spec/find_route_spec.rb +44 -0
- data/pry-rails-0.3.11/spec/railtie_spec.rb +41 -0
- data/pry-rails-0.3.11/spec/recognize_path_spec.rb +57 -0
- data/pry-rails-0.3.11/spec/show_middleware_spec.rb +14 -0
- data/pry-rails-0.3.11/spec/show_model_spec.rb +55 -0
- data/pry-rails-0.3.11/spec/show_models_spec.rb +92 -0
- data/pry-rails-0.3.11/spec/show_routes_spec.rb +29 -0
- data/pry-rails-0.3.11/spec/spec_helper.rb +33 -0
- metadata +103 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
require 'rails'
|
|
2
|
+
require 'rails/all'
|
|
3
|
+
require 'active_support/core_ext'
|
|
4
|
+
|
|
5
|
+
require 'pry-rails'
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
require 'mongoid'
|
|
9
|
+
rescue LoadError # Mongoid doesn't support Rails 3.0
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Initialize our test app
|
|
13
|
+
|
|
14
|
+
class TestApp < Rails::Application
|
|
15
|
+
config.active_support.deprecation = :log
|
|
16
|
+
config.eager_load = false
|
|
17
|
+
|
|
18
|
+
config.secret_token = 'a' * 100
|
|
19
|
+
|
|
20
|
+
config.root = File.expand_path('../..', __FILE__)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
TestApp.initialize!
|
|
24
|
+
|
|
25
|
+
# Create in-memory database
|
|
26
|
+
|
|
27
|
+
ActiveRecord::Migration.verbose = false
|
|
28
|
+
|
|
29
|
+
ActiveRecord::Schema.define do
|
|
30
|
+
create_table :pokemons do |t|
|
|
31
|
+
t.string :name
|
|
32
|
+
t.binary :caught
|
|
33
|
+
t.string :species
|
|
34
|
+
t.string :abilities
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
create_table :hackers do |t|
|
|
38
|
+
t.integer :social_ability
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
create_table :beers do |t|
|
|
42
|
+
t.string :name
|
|
43
|
+
t.string :type
|
|
44
|
+
t.integer :rating
|
|
45
|
+
t.integer :ibu
|
|
46
|
+
t.integer :abv
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Define models
|
|
51
|
+
|
|
52
|
+
class Beer < ActiveRecord::Base
|
|
53
|
+
belongs_to :hacker
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
class Hacker < ActiveRecord::Base
|
|
57
|
+
has_many :pokemons
|
|
58
|
+
has_many :beers
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class Pokemon < ActiveRecord::Base
|
|
62
|
+
belongs_to :hacker
|
|
63
|
+
has_many :beers, :through => :hacker
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if defined?(Mongoid)
|
|
67
|
+
class Artist
|
|
68
|
+
include Mongoid::Document
|
|
69
|
+
|
|
70
|
+
field :name, :type => String
|
|
71
|
+
embeds_one :beer
|
|
72
|
+
embeds_many :instruments
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class Instrument
|
|
76
|
+
include Mongoid::Document
|
|
77
|
+
|
|
78
|
+
field :name, :type => String
|
|
79
|
+
embedded_in :artist
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe "find-route" do
|
|
6
|
+
before do
|
|
7
|
+
routes = Rails.application.routes
|
|
8
|
+
routes.draw {
|
|
9
|
+
namespace :admin do
|
|
10
|
+
resources :users
|
|
11
|
+
resources :images
|
|
12
|
+
end
|
|
13
|
+
}
|
|
14
|
+
routes.finalize!
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'returns the route for a single action' do
|
|
18
|
+
output = mock_pry('find-route Admin::UsersController#show', 'exit-all')
|
|
19
|
+
output.must_match(/show GET/)
|
|
20
|
+
output.wont_match(/index GET/)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'returns all the routes for a controller' do
|
|
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/)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'returns all routes for controllers under a namespace' do
|
|
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/)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'returns no routes found when controller is not recognized' do
|
|
41
|
+
output = mock_pry('find-route Foo', 'exit-all')
|
|
42
|
+
output.must_match(/No routes found/)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1) ||
|
|
6
|
+
Rails::VERSION::MAJOR >= 6
|
|
7
|
+
require 'rails/command'
|
|
8
|
+
require 'rails/commands/console/console_command'
|
|
9
|
+
else
|
|
10
|
+
require 'rails/commands/console'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe PryRails::Railtie do
|
|
14
|
+
it 'should start Pry instead of IRB and make the helpers available' do
|
|
15
|
+
# Yes, I know this is horrible.
|
|
16
|
+
begin
|
|
17
|
+
$called_start = false
|
|
18
|
+
real_pry = Pry
|
|
19
|
+
|
|
20
|
+
silence_warnings do
|
|
21
|
+
::Pry = Class.new do
|
|
22
|
+
def self.start(*)
|
|
23
|
+
$called_start = true
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
Rails::Console.start(Rails.application)
|
|
29
|
+
|
|
30
|
+
assert $called_start
|
|
31
|
+
ensure
|
|
32
|
+
silence_warnings do
|
|
33
|
+
::Pry = real_pry
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
%w(app helper reload!).each do |helper|
|
|
38
|
+
TOPLEVEL_BINDING.eval("respond_to?(:#{helper}, true)").must_equal true
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe "recognize-path" do
|
|
6
|
+
before do
|
|
7
|
+
FooController = Class.new(ActionController::Base)
|
|
8
|
+
BoomsController = Class.new(ActionController::Base)
|
|
9
|
+
routes = Rails.application.routes
|
|
10
|
+
routes.draw {
|
|
11
|
+
root(:to => 'foo#index', :constraints => {:host => 'example.com'})
|
|
12
|
+
resources :booms
|
|
13
|
+
}
|
|
14
|
+
routes.finalize!
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after do
|
|
18
|
+
[:FooController, :BoomsController].each { |const|
|
|
19
|
+
Object.__send__(:remove_const, const)
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'fails gracefully if no path is given' do
|
|
24
|
+
output = mock_pry('recognize-path', 'exit-all')
|
|
25
|
+
output.must_equal \
|
|
26
|
+
"Error: The command 'recognize-path' requires an argument.\n"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "prints info about controller/action that is bound to the given path" do
|
|
30
|
+
output = mock_pry('recognize-path example.com', 'exit-all')
|
|
31
|
+
output.must_match(/controller.+foo/)
|
|
32
|
+
output.must_match(/action.+index/)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "accepts short path" do
|
|
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/)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "accepts -m switch" do
|
|
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/)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "doesn't accept unknown methods" do
|
|
49
|
+
output = mock_pry('recognize-path example.com/booms -m posty', 'exit-all')
|
|
50
|
+
output.must_match 'Unknown HTTP method: posty'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it "doesn't accept unknown routes" do
|
|
54
|
+
output = mock_pry('recognize-path bing/bang/bong', 'exit-all')
|
|
55
|
+
output.must_match 'No route matches "http://bing/bang/bong"'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe "show-middleware" do
|
|
6
|
+
it "should print a list of middleware" do
|
|
7
|
+
output = mock_pry('show-middleware', 'exit-all')
|
|
8
|
+
|
|
9
|
+
output.must_match %r{^use ActionDispatch::Static$}
|
|
10
|
+
output.must_match %r{^use ActionDispatch::ShowExceptions$}
|
|
11
|
+
output.must_match %r{^run TestApp.routes\Z}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe "show-model" do
|
|
6
|
+
it "should print one ActiveRecord model" do
|
|
7
|
+
output = mock_pry('show-model Beer', 'exit-all')
|
|
8
|
+
|
|
9
|
+
expected = <<MODEL
|
|
10
|
+
Beer
|
|
11
|
+
id: integer
|
|
12
|
+
name: string
|
|
13
|
+
type: string
|
|
14
|
+
rating: integer
|
|
15
|
+
ibu: integer
|
|
16
|
+
abv: integer
|
|
17
|
+
belongs_to :hacker
|
|
18
|
+
MODEL
|
|
19
|
+
|
|
20
|
+
output.must_equal expected
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
if defined? Mongoid
|
|
24
|
+
it "should print one Mongoid model" do
|
|
25
|
+
output = mock_pry('show-model Artist', 'exit-all')
|
|
26
|
+
|
|
27
|
+
expected = <<MODEL
|
|
28
|
+
Artist
|
|
29
|
+
_id: BSON::ObjectId
|
|
30
|
+
name: String
|
|
31
|
+
embeds_one :beer (validate)
|
|
32
|
+
embeds_many :instruments (validate)
|
|
33
|
+
MODEL
|
|
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
|
|
37
|
+
output.must_equal expected
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "should print an error if the model doesn't exist" do
|
|
42
|
+
output = mock_pry('show-model FloojBulb', 'exit-all')
|
|
43
|
+
output.must_equal "Couldn't find model FloojBulb!\n"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "should print an error if it doesn't know what to do with the model" do
|
|
47
|
+
output = mock_pry('show-model PryRails', 'exit-all')
|
|
48
|
+
output.must_equal "Don't know how to show PryRails!\n"
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it "should print help if no model name is given" do
|
|
52
|
+
output = mock_pry('show-model', 'exit-all')
|
|
53
|
+
output.must_match(/Usage: show-model/)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe "show-models" do
|
|
6
|
+
it "should print a list of models" do
|
|
7
|
+
output = mock_pry('show-models', 'exit-all')
|
|
8
|
+
|
|
9
|
+
ar_models = <<MODELS
|
|
10
|
+
Beer
|
|
11
|
+
id: integer
|
|
12
|
+
name: string
|
|
13
|
+
type: string
|
|
14
|
+
rating: integer
|
|
15
|
+
ibu: integer
|
|
16
|
+
abv: integer
|
|
17
|
+
belongs_to :hacker
|
|
18
|
+
Hacker
|
|
19
|
+
id: integer
|
|
20
|
+
social_ability: integer
|
|
21
|
+
has_many :beers
|
|
22
|
+
has_many :pokemons
|
|
23
|
+
Pokemon
|
|
24
|
+
id: integer
|
|
25
|
+
name: string
|
|
26
|
+
caught: binary
|
|
27
|
+
species: string
|
|
28
|
+
abilities: string
|
|
29
|
+
belongs_to :hacker
|
|
30
|
+
has_many :beers (through :hacker)
|
|
31
|
+
MODELS
|
|
32
|
+
|
|
33
|
+
mongoid_models = <<MODELS
|
|
34
|
+
Artist
|
|
35
|
+
_id: BSON::ObjectId
|
|
36
|
+
name: String
|
|
37
|
+
embeds_one :beer (validate)
|
|
38
|
+
embeds_many :instruments (validate)
|
|
39
|
+
Instrument
|
|
40
|
+
_id: BSON::ObjectId
|
|
41
|
+
name: String
|
|
42
|
+
embedded_in :artist
|
|
43
|
+
MODELS
|
|
44
|
+
|
|
45
|
+
internal_models = <<MODELS
|
|
46
|
+
ActiveRecord::InternalMetadata
|
|
47
|
+
key: string
|
|
48
|
+
value: string
|
|
49
|
+
created_at: datetime
|
|
50
|
+
updated_at: datetime
|
|
51
|
+
MODELS
|
|
52
|
+
|
|
53
|
+
expected_output = ar_models
|
|
54
|
+
|
|
55
|
+
if defined?(Mongoid)
|
|
56
|
+
output.gsub!(/^ *_type: String\n/, '') # mongoid 3.0 and 3.1 differ on this
|
|
57
|
+
output.gsub!(/Moped::BSON/, 'BSON') # mongoid 3 and 4 differ on this
|
|
58
|
+
expected_output += mongoid_models
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if Rails::VERSION::MAJOR >= 5
|
|
62
|
+
expected_output = internal_models + expected_output
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
output.must_equal expected_output
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it "should highlight the given phrase with --grep" do
|
|
69
|
+
begin
|
|
70
|
+
Pry.color = true
|
|
71
|
+
|
|
72
|
+
output = mock_pry('show-models --grep rating', 'exit-all')
|
|
73
|
+
|
|
74
|
+
output.must_include "Beer"
|
|
75
|
+
output.must_include "\e[7mrating\e[27m"
|
|
76
|
+
output.wont_include "Pokemon"
|
|
77
|
+
|
|
78
|
+
if defined?(Mongoid)
|
|
79
|
+
output.wont_include "Artist"
|
|
80
|
+
end
|
|
81
|
+
ensure
|
|
82
|
+
Pry.color = false
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if defined?(Mongoid)
|
|
87
|
+
it "should also filter for mongoid" do
|
|
88
|
+
output = mock_pry('show-models --grep beer', 'exit-all')
|
|
89
|
+
output.must_include 'Artist'
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
# We can just have a smoke test for this one since it's mostly using built-in
|
|
4
|
+
# Rails functionality. Plus the output is a bit different between Rails
|
|
5
|
+
# versions, so that's annoying.
|
|
6
|
+
|
|
7
|
+
require 'spec_helper'
|
|
8
|
+
|
|
9
|
+
describe "show-routes" do
|
|
10
|
+
it "should print a list of routes" do
|
|
11
|
+
output = mock_pry('show-routes', 'exit-all')
|
|
12
|
+
|
|
13
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should print a list of routes which include grep option" do
|
|
17
|
+
output = mock_pry('show-routes -G edit', 'exit-all')
|
|
18
|
+
|
|
19
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
|
20
|
+
output.must_match %r{ edit_beer GET /beer/edit}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "should filter list based on multiple grep options" do
|
|
24
|
+
output = mock_pry('show-routes -G edit -G pokemon', 'exit-all')
|
|
25
|
+
|
|
26
|
+
output.must_match %r{edit_pokemon GET /pokemon/edit}
|
|
27
|
+
output.wont_match %r{edit_beer}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'minitest/autorun'
|
|
2
|
+
require 'config/environment'
|
|
3
|
+
|
|
4
|
+
# Pry testing stuff (taken from Pry itself)
|
|
5
|
+
|
|
6
|
+
Pry.color = false
|
|
7
|
+
|
|
8
|
+
def redirect_pry_io(new_in, new_out = StringIO.new)
|
|
9
|
+
old_in = Pry.input
|
|
10
|
+
old_out = Pry.output
|
|
11
|
+
|
|
12
|
+
Pry.input = new_in
|
|
13
|
+
Pry.output = new_out
|
|
14
|
+
|
|
15
|
+
begin
|
|
16
|
+
yield
|
|
17
|
+
ensure
|
|
18
|
+
Pry.input = old_in
|
|
19
|
+
Pry.output = old_out
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def mock_pry(*args)
|
|
24
|
+
binding = args.first.is_a?(Binding) ? args.shift : binding()
|
|
25
|
+
input = StringIO.new(args.join("\n"))
|
|
26
|
+
output = StringIO.new
|
|
27
|
+
|
|
28
|
+
redirect_pry_io(input, output) do
|
|
29
|
+
Pry.start(binding, :hooks => Pry::Hooks.new)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
output.string
|
|
33
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mega-pro-hub
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Andrey78
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2026-07-05 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: University research based on pry-rails
|
|
13
|
+
email:
|
|
14
|
+
- cakoc614@gmail.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- mega-pro-hub.gemspec
|
|
20
|
+
- pry-rails-0.3.11/Gemfile
|
|
21
|
+
- pry-rails-0.3.11/LICENCE
|
|
22
|
+
- pry-rails-0.3.11/Rakefile
|
|
23
|
+
- pry-rails-0.3.11/Readme.md
|
|
24
|
+
- pry-rails-0.3.11/lib/pry-rails.rb
|
|
25
|
+
- pry-rails-0.3.11/lib/pry-rails/commands.rb
|
|
26
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/find_route.rb
|
|
27
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/recognize_path.rb
|
|
28
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/show_middleware.rb
|
|
29
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/show_model.rb
|
|
30
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/show_models.rb
|
|
31
|
+
- pry-rails-0.3.11/lib/pry-rails/commands/show_routes.rb
|
|
32
|
+
- pry-rails-0.3.11/lib/pry-rails/console.rb
|
|
33
|
+
- pry-rails-0.3.11/lib/pry-rails/model_formatter.rb
|
|
34
|
+
- pry-rails-0.3.11/lib/pry-rails/prompt.rb
|
|
35
|
+
- pry-rails-0.3.11/lib/pry-rails/railtie.rb
|
|
36
|
+
- pry-rails-0.3.11/lib/pry-rails/version.rb
|
|
37
|
+
- pry-rails-0.3.11/pry-rails.gemspec
|
|
38
|
+
- pry-rails-0.3.11/scenarios.yml
|
|
39
|
+
- pry-rails-0.3.11/scenarios/rails30.docker-compose.yml
|
|
40
|
+
- pry-rails-0.3.11/scenarios/rails30.dockerfile
|
|
41
|
+
- pry-rails-0.3.11/scenarios/rails30.gemfile
|
|
42
|
+
- pry-rails-0.3.11/scenarios/rails31.docker-compose.yml
|
|
43
|
+
- pry-rails-0.3.11/scenarios/rails31.dockerfile
|
|
44
|
+
- pry-rails-0.3.11/scenarios/rails31.gemfile
|
|
45
|
+
- pry-rails-0.3.11/scenarios/rails32.docker-compose.yml
|
|
46
|
+
- pry-rails-0.3.11/scenarios/rails32.dockerfile
|
|
47
|
+
- pry-rails-0.3.11/scenarios/rails32.gemfile
|
|
48
|
+
- pry-rails-0.3.11/scenarios/rails40.docker-compose.yml
|
|
49
|
+
- pry-rails-0.3.11/scenarios/rails40.dockerfile
|
|
50
|
+
- pry-rails-0.3.11/scenarios/rails40.gemfile
|
|
51
|
+
- pry-rails-0.3.11/scenarios/rails41.docker-compose.yml
|
|
52
|
+
- pry-rails-0.3.11/scenarios/rails41.dockerfile
|
|
53
|
+
- pry-rails-0.3.11/scenarios/rails41.gemfile
|
|
54
|
+
- pry-rails-0.3.11/scenarios/rails42.docker-compose.yml
|
|
55
|
+
- pry-rails-0.3.11/scenarios/rails42.dockerfile
|
|
56
|
+
- pry-rails-0.3.11/scenarios/rails42.gemfile
|
|
57
|
+
- pry-rails-0.3.11/scenarios/rails50.docker-compose.yml
|
|
58
|
+
- pry-rails-0.3.11/scenarios/rails50.dockerfile
|
|
59
|
+
- pry-rails-0.3.11/scenarios/rails50.gemfile
|
|
60
|
+
- pry-rails-0.3.11/scenarios/rails51.docker-compose.yml
|
|
61
|
+
- pry-rails-0.3.11/scenarios/rails51.dockerfile
|
|
62
|
+
- pry-rails-0.3.11/scenarios/rails51.gemfile
|
|
63
|
+
- pry-rails-0.3.11/scenarios/rails52.docker-compose.yml
|
|
64
|
+
- pry-rails-0.3.11/scenarios/rails52.dockerfile
|
|
65
|
+
- pry-rails-0.3.11/scenarios/rails52.gemfile
|
|
66
|
+
- pry-rails-0.3.11/scenarios/rails60.docker-compose.yml
|
|
67
|
+
- pry-rails-0.3.11/scenarios/rails60.dockerfile
|
|
68
|
+
- pry-rails-0.3.11/scenarios/rails60.gemfile
|
|
69
|
+
- pry-rails-0.3.11/spec/config/config.ru
|
|
70
|
+
- pry-rails-0.3.11/spec/config/database.yml
|
|
71
|
+
- pry-rails-0.3.11/spec/config/environment.rb
|
|
72
|
+
- pry-rails-0.3.11/spec/config/routes.rb
|
|
73
|
+
- pry-rails-0.3.11/spec/find_route_spec.rb
|
|
74
|
+
- pry-rails-0.3.11/spec/railtie_spec.rb
|
|
75
|
+
- pry-rails-0.3.11/spec/recognize_path_spec.rb
|
|
76
|
+
- pry-rails-0.3.11/spec/show_middleware_spec.rb
|
|
77
|
+
- pry-rails-0.3.11/spec/show_model_spec.rb
|
|
78
|
+
- pry-rails-0.3.11/spec/show_models_spec.rb
|
|
79
|
+
- pry-rails-0.3.11/spec/show_routes_spec.rb
|
|
80
|
+
- pry-rails-0.3.11/spec/spec_helper.rb
|
|
81
|
+
homepage: https://rubygems.org/profiles/Andrey78
|
|
82
|
+
licenses:
|
|
83
|
+
- MIT
|
|
84
|
+
metadata:
|
|
85
|
+
source_code_uri: https://github.com/Andrey78/mega-pro-hub
|
|
86
|
+
rdoc_options: []
|
|
87
|
+
require_paths:
|
|
88
|
+
- lib
|
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - ">="
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '0'
|
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
|
+
requirements:
|
|
96
|
+
- - ">="
|
|
97
|
+
- !ruby/object:Gem::Version
|
|
98
|
+
version: '0'
|
|
99
|
+
requirements: []
|
|
100
|
+
rubygems_version: 3.6.2
|
|
101
|
+
specification_version: 4
|
|
102
|
+
summary: Research test
|
|
103
|
+
test_files: []
|