ops 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 292abae71f788875ad722719f7bab566f6c35996ff2ae6af2796b922401c425c
4
- data.tar.gz: b0c8204517d6fe5689664cf1c7a264232c97d161ee8d2770cabce474cb0a3afc
3
+ metadata.gz: b9dc23b9d4e29ab85a42ffceb12f028a9b6c1f62766355c5f8ab5fb397313ed4
4
+ data.tar.gz: 33636717c835446cf5e94e4f2cd86d9c12fb5ff2d295023565e750c174f9ff2b
5
5
  SHA512:
6
- metadata.gz: 0027cda72b9e4bf3bfdddbf265bb457a31b337f883b88c9dbc5089c1a88296fb3e6ae2026311153a2bce2d23bfaab6ac27147df98cd3c1f7fc3aece7421d0906
7
- data.tar.gz: e877839f042ca0a59896b11c47d3d30dc3baa9507623dcd702540c003c7ba79aa1e52a39c5974b9832ab05f8cb807275de03df93a6c6983df24aca45b27de81b
6
+ metadata.gz: 8cbad03d53b8feb2a175069a1745161184476386ad81b33ab614c7a9c108d3a37daa43621edaddbd8bfb9aae6afbf168805732f33d4abfa65bda896dc6e88481
7
+ data.tar.gz: f833e384b93eaba5bd15f0dd0caf79e082cbee14a656dbb8a02f27dfc14cb837eb3c44915762243b5d582357c53f1177f7bb40516da8992c6750c2024373a556
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
  This gem provides standardized support for obtaining environment, version, and heartbeat information from Sinatra or Rails-based web applications.
3
3
 
4
4
  [![Code Climate](https://codeclimate.com/github/primedia/ops.png)](https://codeclimate.com/github/primedia/ops)
5
- [![Build Status](https://travis-ci.org/rentpath/ops.svg?branch=master)](https://travis-ci.org/rentpath/ops)
5
+ [![Build Status](https://github.com/rentpath/ops/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/rentpath/ops/actions/workflows/ci.yml)
6
+
6
7
 
7
8
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
8
9
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
data/lib/ops/config.rb CHANGED
@@ -16,14 +16,14 @@ module Ops
16
16
  end
17
17
 
18
18
  def []=(key, value)
19
- @data[key.to_sym] = if value.class == Hash
19
+ @data[key.to_sym] = if value.instance_of?(Hash)
20
20
  Config.new(value)
21
21
  else
22
22
  value
23
23
  end
24
24
  end
25
25
 
26
- def method_missing(sym, *args) # rubocop:disable Style/MethodMissing
26
+ def method_missing(sym, *args) # rubocop:disable Style/MissingRespondToMissing
27
27
  if sym.to_s =~ /(.+)=$/
28
28
  self[Regexp.last_match(1)] = args.first
29
29
  else
data/lib/ops/heartbeat.rb CHANGED
@@ -10,7 +10,7 @@ module Ops
10
10
  end
11
11
 
12
12
  def instance
13
- @singleton ||= new
13
+ @instance ||= new
14
14
  end
15
15
  end
16
16
 
@@ -23,10 +23,10 @@ module Ops
23
23
  end
24
24
 
25
25
  def check(name)
26
- return heartbeats[name.to_sym].call
26
+ heartbeats[name.to_sym].call
27
27
  rescue StandardError => e
28
- puts "Error: #{e}\n#{e.backtrace[2..-1].join("\n")}" unless heartbeats[name.to_sym].nil?
29
- return false
28
+ puts "Error: #{e}\n#{e.backtrace[2..].join("\n")}" unless heartbeats[name.to_sym].nil?
29
+ false
30
30
  end
31
31
  end
32
32
 
data/lib/ops/revision.rb CHANGED
@@ -2,7 +2,7 @@ require 'yaml'
2
2
 
3
3
  module Ops
4
4
  class Revision
5
- attr_reader :file_root
5
+ attr_reader :environment, :file_root
6
6
 
7
7
  def initialize(new_headers = {}, opts = Ops.config)
8
8
  @file_root = opts.file_root.to_s # convert to string in case they pass us a Pathname
@@ -10,8 +10,6 @@ module Ops
10
10
  @headers = new_headers
11
11
  end
12
12
 
13
- attr_reader :environment
14
-
15
13
  def headers
16
14
  @headers.select { |k, v| k.match(/^[-A-Z_].*$/) }
17
15
  end
@@ -8,13 +8,13 @@ module Ops
8
8
 
9
9
  def app_name
10
10
  @app_name ||= begin
11
- dirs = Dir.pwd.split('/')
12
- if dirs.last =~ /^\d+$/
13
- dirs[-3]
14
- else
15
- dirs.last
16
- end.sub(/\.com$/, '')
17
- end
11
+ dirs = Dir.pwd.split('/')
12
+ if /^\d+$/.match?(dirs.last)
13
+ dirs[-3]
14
+ else
15
+ dirs.last
16
+ end.sub(/\.com$/, '')
17
+ end
18
18
  end
19
19
 
20
20
  def version_link(version)
@@ -30,7 +30,7 @@ module Ops
30
30
  end
31
31
 
32
32
  def github_link(resource, subresource)
33
- unless subresource =~ /^Unknown/
33
+ unless /^Unknown/.match?(subresource)
34
34
  "<a href='#{GITHUB_ORG_LINK}/#{repo_name}/#{resource}/#{subresource}'>#{subresource}</a>"
35
35
  end
36
36
  end
data/lib/ops/server.rb CHANGED
@@ -4,7 +4,7 @@ require 'json'
4
4
 
5
5
  module Ops
6
6
  class Server < Sinatra::Base
7
- set :views, "#{File.dirname(File.expand_path('', __FILE__))}/server/views"
7
+ set :views, "#{File.dirname(File.expand_path(__FILE__))}/server/views"
8
8
 
9
9
  helpers Ops::Helpers
10
10
 
@@ -21,7 +21,7 @@ module Ops
21
21
  end
22
22
 
23
23
  def json_request?
24
- !!Array(params['format'] || request.accept).detect { |f| f.to_s =~ /json/ }
24
+ !!Array(params['format'] || request.accept).detect { |f| f.to_s.include?('json') }
25
25
  end
26
26
 
27
27
  get '/env/?' do
data/lib/ops/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ops
2
- VERSION = '1.2.1'.freeze
2
+ VERSION = '1.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Pelz-Sherman
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-01-04 00:00:00.000000000 Z
14
+ date: 2024-02-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.2.0
36
+ version: 3.0.4
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.2.0
43
+ version: 3.0.4
44
44
  description: |2
45
45
  This gem provides standardized support for obtaining version and heartbeat information.
46
46
  Works with Sinatra or Rails-based web applications.
@@ -67,7 +67,8 @@ files:
67
67
  homepage: http://rentpath.github.io/ops/
68
68
  licenses:
69
69
  - MIT
70
- metadata: {}
70
+ metadata:
71
+ rubygems_mfa_required: 'true'
71
72
  post_install_message:
72
73
  rdoc_options: []
73
74
  require_paths:
@@ -76,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
77
  requirements:
77
78
  - - ">="
78
79
  - !ruby/object:Gem::Version
79
- version: '0'
80
+ version: 2.7.0
80
81
  required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  requirements:
82
83
  - - ">="