rack-console 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 12532ec52c1c2c4047f90eb1656df2e9e45d1506
4
+ data.tar.gz: 57c3c82725f0f2fe1e4e340fcc6839469a5391d3
5
+ SHA512:
6
+ metadata.gz: 0437e4133e6750e6cf74932f1625ce826353cbec5f76096b3e341ef74de68f8fae5f2507fc9da2ca25b3a0f3903210af7c5333179b271f9e35928250ecbd8104
7
+ data.tar.gz: d934ee2daa7d4c8920cf667b825ba4e0f3e1540a8248370149ac34e69778d064ed9b579046b8f15e2489520dd03fb4f469c6c14b908531bafca415e6770d1ac5
@@ -0,0 +1 @@
1
+ require 'rack/console'
@@ -0,0 +1,19 @@
1
+ require 'rack/builder'
2
+
3
+ require 'rack/console/version'
4
+
5
+ module Rack
6
+ class Console
7
+ def self.start
8
+ Rack::Builder.parse_file('config.ru')
9
+
10
+ begin
11
+ require 'pry'
12
+ Pry.start
13
+ rescue LoadError
14
+ require 'irb'
15
+ IRB.start
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module Rack
2
+ class Console
3
+ class Version
4
+ MAJOR = 1
5
+ MINOR = 0
6
+ PATCH = 0
7
+
8
+ def self.to_s
9
+ [MAJOR, MINOR, PATCH].join('.')
10
+ end
11
+ end
12
+
13
+ VERSION = Version.to_s
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ require 'rack/console'
2
+ require 'irb'
3
+
4
+ describe Rack::Console do
5
+ before { Dir.chdir 'spec/support' }
6
+
7
+ it 'parses config.ru in the current working directory' do
8
+ expect(Rack::Builder).to receive(:parse_file).with('config.ru')
9
+ expect(IRB).to receive(:start)
10
+
11
+ Rack::Console.start
12
+ end
13
+ end
@@ -0,0 +1,49 @@
1
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
2
+ RSpec.configure do |config|
3
+ # Allow more verbose output when running an individual spec file.
4
+ if config.files_to_run.one?
5
+ # Use the documentation formatter for detailed output, unless a formatter
6
+ # has already been configured (e.g. via a command-line flag).
7
+ config.default_formatter = 'doc'
8
+ end
9
+
10
+ # Print the 10 slowest examples and example groups at the
11
+ # end of the spec run, to help surface which specs are running
12
+ # particularly slow.
13
+ config.profile_examples = 10
14
+
15
+ # Run specs in random order to surface order dependencies. If you find an
16
+ # order dependency and want to debug it, you can fix the order by providing
17
+ # the seed, which is printed after each run.
18
+ # --seed 1234
19
+ config.order = :random
20
+
21
+ # Seed global randomization in this process using the `--seed` CLI option.
22
+ # Setting this allows you to use `--seed` to deterministically reproduce
23
+ # test failures related to randomization by passing the same `--seed` value
24
+ # as the one that triggered the failure.
25
+ Kernel.srand config.seed
26
+
27
+ # rspec-expectations config goes here. You can use an alternate
28
+ # assertion/expectation library such as wrong or the stdlib/minitest
29
+ # assertions if you prefer.
30
+ config.expect_with :rspec do |expectations|
31
+ # Enable only the newer, non-monkey-patching expect syntax.
32
+ # For more details, see:
33
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
34
+ expectations.syntax = :expect
35
+ end
36
+
37
+ # rspec-mocks config goes here. You can use an alternate test double
38
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
39
+ config.mock_with :rspec do |mocks|
40
+ # Enable only the newer, non-monkey-patching expect syntax.
41
+ # For more details, see:
42
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
43
+ mocks.syntax = :expect
44
+
45
+ # Prevents you from mocking or stubbing a method that does not exist on
46
+ # a real object. This is generally recommended.
47
+ mocks.verify_partial_doubles = true
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rack-console
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - David Celis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ description: |
42
+ Find yourself missing a `rails console` analogue in your other Ruby web
43
+ applications? This lightweight gem provides a Rack::Console that will load
44
+ your Rack application's code and environment into an IRB or Pry session.
45
+ email:
46
+ - me@davidcel.is
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - lib/rack-console.rb
52
+ - lib/rack/console.rb
53
+ - lib/rack/console/version.rb
54
+ - spec/rack/console_spec.rb
55
+ - spec/spec_helper.rb
56
+ homepage: https://github.com/davidcelis/rack-console
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.3.0
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: "`rails console` for your Rack applications"
80
+ test_files:
81
+ - spec/rack/console_spec.rb
82
+ - spec/spec_helper.rb
83
+ has_rdoc: