ops 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c18209a7c479501db16892a8de4ebea055a8e145
4
+ data.tar.gz: df7004989198d44467fa440a16fce98fb08e98f7
5
+ SHA512:
6
+ metadata.gz: 123b4151ddc1ef4effc61ac9057742bd85630fe7ea4d0c98fda3cb60b834fe447469e4447ba906bca0f48742c05fef4086f28b659ff91fe5f3eb32fec2097163
7
+ data.tar.gz: 8c385865967d357251cc4635edaab09b7380b3d36906714bddb738bfc4313de8ff205a26db6c7d9aca4a8caadb2804d37603fc957b1e42f2e3f3c0b36fb606f8
data/.gitignore CHANGED
@@ -5,6 +5,9 @@ coverage.data
5
5
  # rdoc generated
6
6
  rdoc
7
7
 
8
+ *.sublime-project
9
+ *.sublime-workspace
10
+
8
11
  # bundler
9
12
  .bundle
10
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ops (0.5.0)
4
+ ops (0.5.2)
5
5
  sinatra (>= 1.2.0)
6
6
  sinatra-respond_to (>= 0.7.0)
7
7
 
@@ -53,7 +53,7 @@ GEM
53
53
  method_source (~> 0.8)
54
54
  slop (~> 3.4)
55
55
  rack (1.5.2)
56
- rack-protection (1.5.1)
56
+ rack-protection (1.5.3)
57
57
  rack
58
58
  rack-test (0.6.2)
59
59
  rack (>= 1.0)
@@ -87,7 +87,7 @@ GEM
87
87
  multi_json (~> 1.0)
88
88
  simplecov-html (~> 0.7.1)
89
89
  simplecov-html (0.7.1)
90
- sinatra (1.4.4)
90
+ sinatra (1.4.5)
91
91
  rack (~> 1.4)
92
92
  rack-protection (~> 1.4)
93
93
  tilt (~> 1.3, >= 1.3.4)
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 PRIMEDIA, Inc.
1
+ Copyright (c) 2012 RentPath, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -22,7 +22,7 @@ Typical usage:
22
22
  /ops/config - display all configuration values as JSON (optional)
23
23
  ```
24
24
 
25
- This gem replaces the now-deprecated [ops_routes](https://github.com/primedia/ops_routes).
25
+ This gem replaces the now-deprecated [ops_routes](https://github.com/rentpath/ops_routes).
26
26
 
27
27
  Installation
28
28
  ------------
data/lib/ops/server.rb CHANGED
@@ -14,6 +14,15 @@ module Ops
14
14
  def request_headers
15
15
  env.each_with_object({}) { |(k,v), headers| headers[k] = v }
16
16
  end
17
+
18
+ def jsonified_version(version, previous_versions, headers)
19
+ JSON.generate({
20
+ version: version.version_or_branch,
21
+ revision: version.last_commit,
22
+ previous_versions: previous_versions,
23
+ headers: headers
24
+ })
25
+ end
17
26
 
18
27
  get '/env/?' do
19
28
  @env_vars = ENV.sort
@@ -21,21 +30,13 @@ module Ops
21
30
  end
22
31
 
23
32
  get '/version/?' do
24
- @version = Revision.new request_headers
33
+ @version = Revision.new(request_headers)
25
34
  @previous_versions = @version.previous_versions
26
35
  @headers = @version.headers
36
+
27
37
  respond_to do |wants|
28
- wants.html do
29
- erb :version
30
- end
31
- wants.json do
32
- JSON.generate({
33
- version: @version.version_or_branch,
34
- revision: @version.last_commit,
35
- previous_versions: @previous_versions,
36
- headers: @headers
37
- })
38
- end
38
+ wants.html { erb :version }
39
+ wants.json { jsonified_version(@version, @previous_versions, @headers) }
39
40
  end
40
41
  end
41
42
 
@@ -45,7 +46,7 @@ module Ops
45
46
 
46
47
  get '/heartbeat/:name/?' do
47
48
  name = params[:name]
48
- if Heartbeat.check name
49
+ if Heartbeat.check(name)
49
50
  "#{name} is OK"
50
51
  else
51
52
  status 503
@@ -56,7 +57,7 @@ module Ops
56
57
  get '/config/?' do
57
58
  if config_adapter = Ops.config.config_service_adapter
58
59
  begin
59
- body config_adapter.call(params).to_json
60
+ body(config_adapter.call(params).to_json)
60
61
  rescue StandardError => e
61
62
  status 422
62
63
  body({ 'error' => e.message }.to_json)
@@ -1,6 +1,6 @@
1
1
  module Ops
2
2
  module Helpers
3
- GITHUB_ORG_LINK = 'https://github.com/primedia'
3
+ GITHUB_ORG_LINK = 'https://github.com/rentpath'
4
4
 
5
5
  def hostname
6
6
  @hostname ||= `/bin/hostname` || 'Unknown'
data/lib/ops/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ops
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
data/ops.gemspec CHANGED
@@ -3,12 +3,12 @@ require File.expand_path('../lib/ops/version', __FILE__)
3
3
  require 'date'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.authors = ["Michael Pelz-Sherman", "Colin Rymer", "Luke Fender", "Primedia Team"]
6
+ gem.authors = ["Michael Pelz-Sherman", "Colin Rymer", "Luke Fender", "RentPath Team"]
7
7
  gem.email = ["mpelzsherman@gmail.com", "colin.rymer@gmail.com", "lfender6445@gmail.com"]
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://primedia.github.io/ops/"
11
+ gem.homepage = "http://rentpath.github.io/ops/"
12
12
  gem.license = 'MIT'
13
13
  gem.executables = []
14
14
  gem.files = `git ls-files | grep -v myapp`.split("\n")
metadata CHANGED
@@ -1,49 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
5
- prerelease:
4
+ version: 0.5.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Pelz-Sherman
9
8
  - Colin Rymer
10
9
  - Luke Fender
11
- - Primedia Team
10
+ - RentPath Team
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2014-05-15 00:00:00.000000000 Z
14
+ date: 2015-04-06 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: sinatra
19
18
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
19
  requirements:
22
- - - ! '>='
20
+ - - ">="
23
21
  - !ruby/object:Gem::Version
24
22
  version: 1.2.0
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
- - - ! '>='
27
+ - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 1.2.0
33
30
  - !ruby/object:Gem::Dependency
34
31
  name: sinatra-respond_to
35
32
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
33
  requirements:
38
- - - ! '>='
34
+ - - ">="
39
35
  - !ruby/object:Gem::Version
40
36
  version: 0.7.0
41
37
  type: :runtime
42
38
  prerelease: false
43
39
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
40
  requirements:
46
- - - ! '>='
41
+ - - ">="
47
42
  - !ruby/object:Gem::Version
48
43
  version: 0.7.0
49
44
  description: This gem provides standardized support for obtaining version and heartbeat
@@ -56,8 +51,8 @@ executables: []
56
51
  extensions: []
57
52
  extra_rdoc_files: []
58
53
  files:
59
- - .gitignore
60
- - .rspec
54
+ - ".gitignore"
55
+ - ".rspec"
61
56
  - Gemfile
62
57
  - Gemfile.lock
63
58
  - LICENSE
@@ -118,30 +113,28 @@ files:
118
113
  - spec/ops_spec.rb
119
114
  - spec/spec_helper.rb
120
115
  - tags
121
- homepage: http://primedia.github.io/ops/
116
+ homepage: http://rentpath.github.io/ops/
122
117
  licenses:
123
118
  - MIT
119
+ metadata: {}
124
120
  post_install_message:
125
121
  rdoc_options: []
126
122
  require_paths:
127
123
  - lib
128
124
  required_ruby_version: !ruby/object:Gem::Requirement
129
- none: false
130
125
  requirements:
131
- - - ! '>='
126
+ - - ">="
132
127
  - !ruby/object:Gem::Version
133
128
  version: '1.9'
134
129
  required_rubygems_version: !ruby/object:Gem::Requirement
135
- none: false
136
130
  requirements:
137
- - - ! '>='
131
+ - - ">="
138
132
  - !ruby/object:Gem::Version
139
133
  version: '0'
140
134
  requirements: []
141
135
  rubyforge_project:
142
- rubygems_version: 1.8.23
136
+ rubygems_version: 2.2.2
143
137
  signing_key:
144
- specification_version: 3
138
+ specification_version: 4
145
139
  summary: Provide ops info endpoints.
146
140
  test_files: []
147
- has_rdoc: