tipsy 0.1.2 → 0.1.3
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/bin/tipsy +1 -2
- data/lib/tipsy/server.rb +17 -3
- data/lib/tipsy/utils/logger.rb +2 -2
- data/lib/tipsy/version.rb +1 -1
- metadata +1 -1
data/bin/tipsy
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
libdir = File.expand_path('../lib', File.dirname(__FILE__))
|
4
|
-
puts "Load from #{libdir}"
|
5
4
|
if File.file?(libdir + '/tipsy/version.rb')
|
6
5
|
$LOAD_PATH.unshift(libdir)
|
7
6
|
end
|
@@ -20,5 +19,5 @@ if File.exists?(File.join(File.expand_path('.'), 'Gemfile'))
|
|
20
19
|
Bundler.require(:default)
|
21
20
|
end
|
22
21
|
|
23
|
-
require "
|
22
|
+
require "tipsy/runner"
|
24
23
|
Tipsy::Runner.new(ARGV, STDIN)
|
data/lib/tipsy/server.rb
CHANGED
@@ -19,25 +19,39 @@ module Tipsy
|
|
19
19
|
begin
|
20
20
|
handler = Rack::Handler.get('thin')
|
21
21
|
handler.run app, options do |server|
|
22
|
-
|
22
|
+
banner("Thin (#{Thin::VERSION::STRING})", options[:Port])
|
23
|
+
puts "-----------------------------------------------------------------"
|
24
|
+
puts ""
|
23
25
|
end
|
24
26
|
exit(0)
|
25
27
|
rescue LoadError
|
26
28
|
begin
|
27
29
|
handler = Rack::Handler.get('mongrel')
|
28
30
|
handler.run app, options do |server|
|
29
|
-
|
31
|
+
banner("Mongrel (#{Mongrel::Const::MONGREL_VERSION})", options[:Port])
|
32
|
+
puts "-----------------------------------------------------------------"
|
33
|
+
puts ""
|
30
34
|
end
|
31
35
|
exit(0)
|
32
36
|
rescue LoadError
|
33
37
|
handler = Rack::Handler.get('webrick')
|
34
38
|
handler.run app, options do |server|
|
35
|
-
|
39
|
+
banner("Webrick", options[:Port])
|
40
|
+
puts " To use Mongrel or Thin (recommended), add them to your Gemfile"
|
41
|
+
puts "-----------------------------------------------------------------"
|
42
|
+
puts ""
|
36
43
|
trap("INT"){ server.shutdown }
|
37
44
|
end
|
38
45
|
end
|
39
46
|
end
|
40
47
|
end
|
48
|
+
|
49
|
+
def banner(server, port)
|
50
|
+
puts ""
|
51
|
+
Tipsy.logger.info " Tipsy #{Tipsy::VERSION}", :green
|
52
|
+
Tipsy.logger.info " Started from #{Tipsy.root}"
|
53
|
+
Tipsy.logger.info " using #{server}, port #{port}"
|
54
|
+
end
|
41
55
|
end
|
42
56
|
|
43
57
|
def initialize
|
data/lib/tipsy/utils/logger.rb
CHANGED
@@ -16,8 +16,8 @@ module Tipsy
|
|
16
16
|
print colorize(:green, (name.rjust(12, ' ') << " "), :clear, action)
|
17
17
|
end
|
18
18
|
|
19
|
-
def info(msg)
|
20
|
-
print msg unless Tipsy.env.eql?("test")
|
19
|
+
def info(msg, color = :clear)
|
20
|
+
print colorize(color, msg) unless Tipsy.env.eql?("test")
|
21
21
|
end
|
22
22
|
|
23
23
|
def warn(msg)
|
data/lib/tipsy/version.rb
CHANGED