startbrick 0.0.6 → 0.0.7
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/README.md +4 -5
- data/bin/startbrick +10 -5
- data/lib/startbrick/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -42,15 +42,14 @@ requests.
|
|
42
42
|
You can add any of the arguments that you can pass to the `rails s`
|
43
43
|
command.
|
44
44
|
|
45
|
+
|
45
46
|
## Optional .startbrick script
|
46
47
|
|
47
48
|
By default, Startbrick runs this shell command when the Rails server is
|
48
49
|
ready for requests:
|
49
50
|
|
50
|
-
open "http://#{
|
51
|
-
|
52
|
-
You can override this by putting your own shell script in a `.startbrick` file
|
53
|
-
in your Rails root directory.
|
54
|
-
|
51
|
+
open "http://#{Host}:#{Port}"
|
55
52
|
|
53
|
+
You can override this by putting your own commands in a shell script in
|
54
|
+
a `.startbrick` file in your Rails root directory.
|
56
55
|
|
data/bin/startbrick
CHANGED
@@ -14,16 +14,21 @@ opt_parser = OptionParser.new do |opts|
|
|
14
14
|
end
|
15
15
|
|
16
16
|
opt_parser.parse! args
|
17
|
-
puts options.inspect
|
18
17
|
|
19
|
-
|
18
|
+
SCRIPT_FILE = '.startbrick'
|
20
19
|
|
21
20
|
open_cmd = "open 'http://#{options[:Host]}:#{options[:Port]}'"
|
22
|
-
|
21
|
+
|
22
|
+
if File.size?(SCRIPT_FILE)
|
23
|
+
open_cmd = "bash #{SCRIPT_FILE}"
|
24
|
+
end
|
25
|
+
|
26
|
+
puts "Post startup command: #{open_cmd}"
|
27
|
+
|
23
28
|
fork do
|
24
|
-
`while ! nc -z localhost #{options[:Port]}; do sleep 0.1; done; echo '
|
29
|
+
`while ! nc -z localhost #{options[:Port]}; do sleep 0.1; done; echo 'Running #{open_cmd}'; #{open_cmd}`
|
25
30
|
end
|
26
31
|
|
32
|
+
cmd = "rails s #{ARGV.join(' ').strip}"
|
27
33
|
puts cmd
|
28
|
-
|
29
34
|
exec cmd
|
data/lib/startbrick/version.rb
CHANGED