ops 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/examples/rails3/spec/functional/ops_routes_spec.rb +7 -1
- data/examples/sinatra/spec/functional/ops_routes_spec.rb +7 -1
- data/lib/ops/server/views/env.html.erb +26 -0
- data/lib/ops/server.rb +5 -0
- data/lib/ops/version.rb +1 -1
- data/ops.gemspec +1 -1
- data/spec/functional/ops_routes_spec.rb +7 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
@@ -44,6 +44,12 @@ end
|
|
44
44
|
describe 'routes', :type => :controller do
|
45
45
|
include Rack::Test::Methods
|
46
46
|
|
47
|
+
|
48
|
+
it 'renders a env page' do
|
49
|
+
get "/ops/env"
|
50
|
+
last_response.should be_ok
|
51
|
+
end
|
52
|
+
|
47
53
|
it 'renders a version page' do
|
48
54
|
get "/ops/version"
|
49
55
|
last_response.should be_ok
|
@@ -60,4 +66,4 @@ describe 'routes', :type => :controller do
|
|
60
66
|
last_response.should be_ok
|
61
67
|
end
|
62
68
|
|
63
|
-
end
|
69
|
+
end
|
@@ -44,6 +44,12 @@ end
|
|
44
44
|
describe 'routes', :type => :controller do
|
45
45
|
include Rack::Test::Methods
|
46
46
|
|
47
|
+
|
48
|
+
it 'renders a env page' do
|
49
|
+
get "/ops/env"
|
50
|
+
last_response.should be_ok
|
51
|
+
end
|
52
|
+
|
47
53
|
it 'renders a version page' do
|
48
54
|
get "/ops/version"
|
49
55
|
last_response.should be_ok
|
@@ -60,4 +66,4 @@ describe 'routes', :type => :controller do
|
|
60
66
|
last_response.should be_ok
|
61
67
|
end
|
62
68
|
|
63
|
-
end
|
69
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="container">
|
2
|
+
<div class="spacer"></div>
|
3
|
+
<%= "#{app_name}" %>
|
4
|
+
<div class="spacer"></div>
|
5
|
+
<div id="host">
|
6
|
+
<div class="label">Host</div>
|
7
|
+
<div class="value"><%= hostname %></div>
|
8
|
+
</div>
|
9
|
+
<div class="spacer"></div>
|
10
|
+
<div id="environment_variables">
|
11
|
+
<div class="label">Environment Variables</div>
|
12
|
+
<div class="spacer"></div>
|
13
|
+
<div>
|
14
|
+
<table>
|
15
|
+
<% @env_vars.each_with_index do |(key, value), i| %>
|
16
|
+
<tr class="<%= i%2==0 ? 'even' : nil %>">
|
17
|
+
<td><%= key %></td>
|
18
|
+
<td><%= value %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="clear"></div>
|
25
|
+
</div>
|
26
|
+
|
data/lib/ops/server.rb
CHANGED
@@ -15,6 +15,11 @@ module Ops
|
|
15
15
|
env.each_with_object({}) { |(k,v), headers| headers[k] = v }
|
16
16
|
end
|
17
17
|
|
18
|
+
get '/env/?' do
|
19
|
+
@env_vars = ENV.sort
|
20
|
+
erb :env
|
21
|
+
end
|
22
|
+
|
18
23
|
get '/version/?' do
|
19
24
|
@version = Revision.new request_headers
|
20
25
|
@previous_versions = @version.previous_versions
|
data/lib/ops/version.rb
CHANGED
data/ops.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.description = 'This gem provides standardized support for obtaining version and heartbeat information from Sinatra or Rails-based web applications.'
|
9
9
|
gem.summary = "Provide ops info endpoints."
|
10
10
|
gem.date = Date.today.to_s
|
11
|
-
gem.homepage = "http://github.
|
11
|
+
gem.homepage = "http://primedia.github.io/ops/"
|
12
12
|
gem.license = 'MIT'
|
13
13
|
gem.executables = []
|
14
14
|
gem.files = `git ls-files | grep -v myapp`.split("\n")
|
@@ -44,6 +44,12 @@ end
|
|
44
44
|
describe 'routes', :type => :controller do
|
45
45
|
include Rack::Test::Methods
|
46
46
|
|
47
|
+
|
48
|
+
it 'renders a env page' do
|
49
|
+
get "/ops/env"
|
50
|
+
last_response.should be_ok
|
51
|
+
end
|
52
|
+
|
47
53
|
it 'renders a version page' do
|
48
54
|
get "/ops/version"
|
49
55
|
last_response.should be_ok
|
@@ -60,4 +66,4 @@ describe 'routes', :type => :controller do
|
|
60
66
|
last_response.should be_ok
|
61
67
|
end
|
62
68
|
|
63
|
-
end
|
69
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.4.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Pelz-Sherman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
prerelease: false
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- lib/ops/revision.rb
|
105
105
|
- lib/ops/server.rb
|
106
106
|
- lib/ops/server/helpers.rb
|
107
|
+
- lib/ops/server/views/env.html.erb
|
107
108
|
- lib/ops/server/views/layout.html.erb
|
108
109
|
- lib/ops/server/views/version.html.erb
|
109
110
|
- lib/ops/version.rb
|
@@ -117,7 +118,7 @@ files:
|
|
117
118
|
- spec/ops_spec.rb
|
118
119
|
- spec/spec_helper.rb
|
119
120
|
- tags
|
120
|
-
homepage: http://github.
|
121
|
+
homepage: http://primedia.github.io/ops/
|
121
122
|
licenses:
|
122
123
|
- MIT
|
123
124
|
post_install_message:
|
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
137
|
- !ruby/object:Gem::Version
|
137
138
|
segments:
|
138
139
|
- 0
|
139
|
-
hash:
|
140
|
+
hash: 1369988502610767879
|
140
141
|
version: '0'
|
141
142
|
none: false
|
142
143
|
requirements: []
|