ripl-rack 0.1.0 → 0.2.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.
data/.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
  s.rubyforge_project = 'tagaholic'
15
15
  s.executables = ['ripl-rack']
16
- s.add_dependency 'ripl', '>= 0.2.7'
16
+ s.add_dependency 'ripl', '>= 0.3.5'
17
17
  s.add_dependency 'rack', '>= 1.0'
18
18
  s.add_dependency 'rack-test', '>= 0.5'
19
19
  s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
@@ -0,0 +1,5 @@
1
+ == 0.2.0
2
+ * Add rackit config
3
+
4
+ == 0.1.0
5
+ * First release methinks
@@ -4,7 +4,7 @@ This ripl plugin provides a console for rack apps.
4
4
  == Install
5
5
  Install the gem with:
6
6
 
7
- sudo gem install ripl-rack
7
+ gem install ripl-rack
8
8
 
9
9
  == Usage
10
10
 
@@ -46,5 +46,9 @@ Now let's use it:
46
46
  >> post '/login', :user => 'x', :password => 'y'
47
47
  ....
48
48
 
49
+ To have rack actions in your top-level by default add the following to ~/.riplrc:
50
+
51
+ Ripl.config[:rackit] = true
52
+
49
53
  == Credits
50
54
  * Thanks to racksh for interesting rack-test bits
data/deps.rip CHANGED
@@ -1,3 +1,3 @@
1
- ripl >=0.2.7
1
+ ripl >=0.3.5
2
2
  rack >=1.0
3
3
  rack-test >=0.5
@@ -3,21 +3,19 @@ require 'rack'
3
3
  require 'rack/test'
4
4
 
5
5
  module Ripl::Rack
6
- VERSION = '0.1.0'
6
+ VERSION = '0.2.0'
7
7
 
8
8
  def before_loop
9
9
  Commands.rack
10
+ Commands.rackit! if config[:rackit]
10
11
  puts "Loading #{Commands.rack.env} environment (Rack #{Rack.version})"
11
12
  super
12
13
  end
13
14
 
14
15
  module Commands
15
- def self.rack
16
- @rack ||= Ripl::Rack::App.new
17
- end
18
-
16
+ extend self
19
17
  def rack
20
- Commands.rack
18
+ @rack ||= Ripl::Rack::App.new
21
19
  end
22
20
 
23
21
  def rackit!
@@ -32,12 +30,11 @@ module Ripl::Rack
32
30
  class App
33
31
  include Rack::Test::Methods
34
32
  attr_reader :app, :env
33
+ MESSAGE = "Rack config file '%s' doesn't exist. Specify with ENV['RACK_CONFIG']"
35
34
 
36
35
  def initialize(config_ru=nil)
37
36
  config_ru ||= ENV['RACK_CONFIG'] || 'config.ru'
38
- unless File.exists? config_ru
39
- abort "Rack config file '#{config_ru}' doesn't exist. Specify with ENV['RACK_CONFIG']"
40
- end
37
+ abort(MESSAGE % config_ru) unless File.exists? config_ru
41
38
  @app = Kernel.eval("Rack::Builder.new { #{File.read(config_ru)} }")
42
39
  @env = ENV['RACK_ENV'] || 'development'
43
40
  end
@@ -48,5 +45,5 @@ module Ripl::Rack
48
45
  end
49
46
  end
50
47
 
51
- Ripl::Shell.send :include, Ripl::Rack
52
- Ripl::Commands.send :include, Ripl::Rack::Commands
48
+ Ripl::Shell.include Ripl::Rack
49
+ Ripl::Commands.include Ripl::Rack::Commands
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripl-rack
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabriel Horner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-11 00:00:00 -05:00
18
+ date: 2011-04-05 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -29,9 +29,9 @@ dependencies:
29
29
  hash: 25
30
30
  segments:
31
31
  - 0
32
- - 2
33
- - 7
34
- version: 0.2.7
32
+ - 3
33
+ - 5
34
+ version: 0.3.5
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -77,6 +77,7 @@ files:
77
77
  - lib/ripl/rack.rb
78
78
  - bin/ripl-rack
79
79
  - LICENSE.txt
80
+ - CHANGELOG.rdoc
80
81
  - README.rdoc
81
82
  - deps.rip
82
83
  - Rakefile