racksh 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +27 -0
- data/README.markdown +11 -3
- data/bin/racksh +3 -1
- data/lib/racksh/init.rb +9 -6
- data/lib/racksh/version.rb +1 -1
- metadata +3 -2
data/CHANGELOG.txt
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
=== 0.9.5 / 2010-01-31
|
2
|
+
|
3
|
+
* added application reloading with "reload!"
|
4
|
+
|
5
|
+
=== 0.9.4 / 2009-11-19
|
6
|
+
|
7
|
+
* added loading irb/completion
|
8
|
+
* added support for session setup, loaded from .rackshrc in user's home directory and app's directory
|
9
|
+
* prevented STDOUT & STDERR to be reopened
|
10
|
+
* added showing simple prompt (>>) like Rails console
|
11
|
+
* added printing startup info in colors
|
12
|
+
|
13
|
+
=== 0.9.3 / 2009-11-17
|
14
|
+
|
15
|
+
* exposed Rack::Test::Methods via $rack variable
|
16
|
+
|
17
|
+
=== 0.9.2 / 2009-11-15
|
18
|
+
|
19
|
+
* irb require uses absolute path (for users without rubygems required in their .irbrc)
|
20
|
+
|
21
|
+
=== 0.9.1 / 2009-11-15
|
22
|
+
|
23
|
+
* added showing name of loaded rack env
|
24
|
+
|
25
|
+
=== 0.9 / 2009-11-15
|
26
|
+
|
27
|
+
* initial release
|
data/README.markdown
CHANGED
@@ -29,7 +29,7 @@ Additionally it exposes _$rack_ variable which allows you to make simulated HTTP
|
|
29
29
|
To start racksh session run following inside rack application directory (containing config.ru file):
|
30
30
|
|
31
31
|
% racksh
|
32
|
-
Rack::Shell v0.9.
|
32
|
+
Rack::Shell v0.9.5 started in development environment.
|
33
33
|
>>
|
34
34
|
|
35
35
|
Specifying location of config.ru:
|
@@ -44,13 +44,13 @@ Executing ruby code inside application environment and printing results:
|
|
44
44
|
Specifying Rack environment (default is development):
|
45
45
|
|
46
46
|
% RACK_ENV=production racksh
|
47
|
-
Rack::Shell v0.9.
|
47
|
+
Rack::Shell v0.9.5 started in production environment.
|
48
48
|
>>
|
49
49
|
|
50
50
|
### Making simulated HTTP requests to your app
|
51
51
|
|
52
52
|
% racksh
|
53
|
-
Rack::Shell v0.9.
|
53
|
+
Rack::Shell v0.9.5 started in development environment.
|
54
54
|
>> $rack.get "/"
|
55
55
|
=> #<Rack::MockResponse:0xb68fa7bc @body="<html>...", @headers={"Content-Type"=>"text/html", "Content-Length"=>"1812"}, @status=200, ...
|
56
56
|
|
@@ -124,6 +124,14 @@ You can also make requests:
|
|
124
124
|
|
125
125
|
This will ensure you are always logged in when you start _racksh_.
|
126
126
|
|
127
|
+
### Reloading
|
128
|
+
|
129
|
+
If you've made some changes to your app and you want to reload it type:
|
130
|
+
|
131
|
+
reload!
|
132
|
+
|
133
|
+
It will reload (actually restart) whole Rack application in new process.
|
134
|
+
|
127
135
|
## Bugs & feature requests
|
128
136
|
|
129
137
|
Please report bugs and/or feature requests on the github issue tracker for the project located [here](http://github.com/sickill/racksh/issues).
|
data/bin/racksh
CHANGED
@@ -12,14 +12,16 @@ def STDERR.reopen(*args); end
|
|
12
12
|
if ARGV.empty?
|
13
13
|
require "irb"
|
14
14
|
require "irb/completion"
|
15
|
+
reloaded = false
|
15
16
|
loop do
|
16
17
|
pid = fork do
|
17
|
-
Rack::Shell.init
|
18
|
+
Rack::Shell.init(!reloaded)
|
18
19
|
IRB.conf[:PROMPT_MODE] = :SIMPLE
|
19
20
|
IRB.start
|
20
21
|
end
|
21
22
|
Process.wait(pid)
|
22
23
|
break unless $?.exitstatus == 255
|
24
|
+
reloaded = true
|
23
25
|
end
|
24
26
|
else
|
25
27
|
Rack::Shell.init
|
data/lib/racksh/init.rb
CHANGED
@@ -11,7 +11,7 @@ module Rack
|
|
11
11
|
module Shell
|
12
12
|
File = ::File
|
13
13
|
|
14
|
-
def self.init
|
14
|
+
def self.init(print_startup_info=true)
|
15
15
|
config_ru = ENV['CONFIG_RU']
|
16
16
|
|
17
17
|
# build Rack app
|
@@ -27,11 +27,14 @@ module Rack
|
|
27
27
|
eval(File.read(rcfile)) if File.exists?(rcfile)
|
28
28
|
|
29
29
|
# print startup info
|
30
|
-
if
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
if print_startup_info
|
31
|
+
if STDOUT.tty? && ENV['TERM'] != 'dumb' # we have color terminal, let's pimp our info!
|
32
|
+
env_color = ($rack.env == 'production' ? "\e[31m\e[1m" : "\e[36m\e[1m")
|
33
|
+
puts "\e[32m\e[1mRack\e[0m\e[33m\e[1m::\e[0m\e[32m\e[1mShell\e[0m v#{VERSION} started in #{env_color}#{$rack.env}\e[0m environment."
|
34
|
+
else
|
35
|
+
puts "Rack::Shell v#{VERSION} started in #{$rack.env} environment."
|
36
|
+
end
|
37
|
+
@reloaded = true
|
35
38
|
end
|
36
39
|
rescue Errno::ENOENT => e
|
37
40
|
if e.message =~ /config\.ru$/
|
data/lib/racksh/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: racksh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Kulik
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01
|
12
|
+
date: 2010-02-01 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/racksh/session.rb
|
47
47
|
- lib/racksh/init.rb
|
48
48
|
- README.markdown
|
49
|
+
- CHANGELOG.txt
|
49
50
|
has_rdoc: true
|
50
51
|
homepage: http://github.com/sickill/racksh
|
51
52
|
licenses: []
|