ors 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ors/config.rb +0 -6
- data/lib/ors/helpers.rb +1 -1
- data/lib/ors/log_unifier.rb +5 -17
- data/lib/ors/version.rb +1 -1
- data/spec/ors/config_spec.rb +0 -14
- data/spec/ors/log_unifier_spec.rb +4 -0
- metadata +7 -7
data/lib/ors/config.rb
CHANGED
@@ -7,7 +7,6 @@ module ORS
|
|
7
7
|
self.pretending = false
|
8
8
|
self.use_gateway = true
|
9
9
|
self.log_lines = 100
|
10
|
-
self.rails2 = false
|
11
10
|
|
12
11
|
module ModuleMethods
|
13
12
|
|
@@ -19,7 +18,6 @@ module ORS
|
|
19
18
|
case option
|
20
19
|
when "-p", "--pretend" then self.pretending = true
|
21
20
|
when "-ng", "--no-gateway" then self.use_gateway = false
|
22
|
-
when "-r2", "--rails-2" then self.rails2 = true
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
@@ -45,10 +43,6 @@ module ORS
|
|
45
43
|
end
|
46
44
|
extend ModuleMethods
|
47
45
|
|
48
|
-
def unicorn
|
49
|
-
rails2 ? "unicorn-rails" : "unicorn"
|
50
|
-
end
|
51
|
-
|
52
46
|
def gateway
|
53
47
|
"deploy-gateway"
|
54
48
|
end
|
data/lib/ors/helpers.rb
CHANGED
@@ -46,7 +46,7 @@ module ORS
|
|
46
46
|
|
47
47
|
execute_command server, %(source ~/.rvm/scripts/rvm),
|
48
48
|
%(cd #{deploy_directory}),
|
49
|
-
%(bundle exec #{
|
49
|
+
%(if [ -f config.ru ]; then RAILS_ENV=#{environment} bundle exec unicorn -c config/unicorn.rb -D -E #{environment}; else RAILS_ENV=#{environment} bundle exec unicorn_rails -c config/unicorn.rb -D -E #{environment}; fi)
|
50
50
|
end
|
51
51
|
|
52
52
|
def stop_server server
|
data/lib/ors/log_unifier.rb
CHANGED
@@ -33,24 +33,12 @@ module ORS
|
|
33
33
|
entries = Array.new
|
34
34
|
|
35
35
|
logs.each do |server, log_rows|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if line == ""
|
40
|
-
unless entry[:lines].empty?
|
41
|
-
entries << entry
|
42
|
-
entry = {:lines => Array.new, :server => server}
|
43
|
-
end
|
44
|
-
else
|
45
|
-
if entry[:lines].empty?
|
46
|
-
entry[:timestamp] = line.gsub(/^(?:Processing|Started).*?(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}).*$/, '\1').gsub(/\D/, '')
|
47
|
-
end
|
48
|
-
|
49
|
-
entry[:lines] << line
|
50
|
-
end
|
51
|
-
end
|
36
|
+
log_rows.split(/\n\n\n/).each do |line|
|
37
|
+
line.gsub!(/^.*?Started/m, "Started") unless line =~ /\AStarted/
|
38
|
+
timestamp, _ = line.scan(/^(?:Processing|Started).*?(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}).*$/).first
|
52
39
|
|
53
|
-
|
40
|
+
entries << {:timestamp => timestamp.gsub(/\D/, ""), :lines => line.split(/\n/), :server => server} if timestamp
|
41
|
+
end
|
54
42
|
end
|
55
43
|
|
56
44
|
entries
|
data/lib/ors/version.rb
CHANGED
data/spec/ors/config_spec.rb
CHANGED
@@ -41,20 +41,6 @@ describe ORS::Config do
|
|
41
41
|
|
42
42
|
subject.use_gateway.should be_false
|
43
43
|
end
|
44
|
-
|
45
|
-
it "should set rails2 to true if -r2 is given" do
|
46
|
-
ORS::Config.rails2 = false
|
47
|
-
ORS::Config.parse_options %w(-r2)
|
48
|
-
|
49
|
-
subject.rails2.should be_true
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should set rails2 to true if --rails-2 is given" do
|
53
|
-
ORS::Config.rails2 = false
|
54
|
-
ORS::Config.parse_options %w(--rails-2)
|
55
|
-
|
56
|
-
subject.rails2.should be_true
|
57
|
-
end
|
58
44
|
end
|
59
45
|
|
60
46
|
context ".valid_options?" do
|
@@ -59,6 +59,8 @@ Started GET "/" for 10.203.228.96 at 2011-02-02 08:52:33 -0500
|
|
59
59
|
Processing by ReviewsController#index as HTML
|
60
60
|
Completed 200 OK in 41ms (Views: 3.6ms | ActiveRecord: 31.6ms)
|
61
61
|
|
62
|
+
ERROR: WTFOMGBBQ is on fire!!! /!\\ /!\\
|
63
|
+
|
62
64
|
|
63
65
|
Started GET "/" for 10.203.228.96 at 2011-02-03 05:00:33 -0500
|
64
66
|
Processing by ReviewsController#index as HTML
|
@@ -79,6 +81,8 @@ Completed 200 OK in 41ms (Views: 3.6ms | ActiveRecord: 31.6ms)
|
|
79
81
|
[server2] Started GET "/" for 10.203.228.96 at 2011-02-02 08:52:33 -0500
|
80
82
|
[server2] Processing by ReviewsController#index as HTML
|
81
83
|
[server2] Completed 200 OK in 41ms (Views: 3.6ms | ActiveRecord: 31.6ms)
|
84
|
+
[server2]
|
85
|
+
[server2] ERROR: WTFOMGBBQ is on fire!!! /!\\ /!\\
|
82
86
|
|
83
87
|
|
84
88
|
[server1] Started GET "/" for 10.203.228.96 at 2011-02-02 08:58:33 -0500
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease: !!null
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable: !!null
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: git
|
17
|
-
requirement: &
|
17
|
+
requirement: &2165489500 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2165489500
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec
|
28
|
-
requirement: &
|
28
|
+
requirement: &2165489080 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2165489080
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rr
|
39
|
-
requirement: &
|
39
|
+
requirement: &2165488660 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2165488660
|
48
48
|
description: Heroku-like deployment utilities for ORS
|
49
49
|
email:
|
50
50
|
- jason.dew@ors.sc.gov and john.long@ors.sc.gov
|