startbrick 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
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://#{BindAddress}:#{Port}"
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
- cmd = "rails s #{ARGV.join(' ').strip}"
18
+ SCRIPT_FILE = '.startbrick'
20
19
 
21
20
  open_cmd = "open 'http://#{options[:Host]}:#{options[:Port]}'"
22
- puts open_cmd
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 'opening browser'; #{open_cmd}`
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
@@ -1,3 +1,3 @@
1
1
  module Startbrick
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: startbrick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: