monitor_me 0.1.0 → 0.1.6

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: 21d22d02a97b1997bcda172b40212e0928ff4bf2c2d02f2b92257fa6f0024c70
4
- data.tar.gz: a2b0300e1de5be899c0a95dde87347b6bc625127dca27fb0e9912ddf1a79e058
3
+ metadata.gz: '04877ef867d24081dde04954662ee9d790945f815e838e67895e040e88ae6642'
4
+ data.tar.gz: acc173212e41d01c8748748a86500233df06724403da843daed3382974f2b39b
5
5
  SHA512:
6
- metadata.gz: 6bbe110f0a0719cc0754a610b12d302279b5dd22437a2d580e0f8dbd1f8262e92e36f2fe34793553531ac45f75d5f21ec788c20d426dbf93537ac1e4d3999373
7
- data.tar.gz: c458af612c720cda6f1f4f060b1348bf43c600346979bf4b26f384ba0c5426b7b442a6ba960e10f571c948e40cc7cdb47723b1d694b455ccbe963303db17cd79
6
+ metadata.gz: 8b4c26b463501b9a39bcd3c185ca65937e172568498051de276b2e03fddc5e13cd3e64d2214e9767e7afe9b062a308195bfc60add4b794654c138d8026573da2
7
+ data.tar.gz: 3bdcec0f03812335f6b2c222feb2b67a8858ef6de76ffc5d17c699658360dbf7b4f7c2d396b628bbc44e013fe1acb4fbd1d776c9ff3087cf72eb264839f520b6
data/Gemfile CHANGED
@@ -5,3 +5,5 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
+
9
+ gemspec
@@ -1,3 +1,3 @@
1
1
  class MonitorMe
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.6'
3
3
  end
data/lib/monitor_me.rb CHANGED
@@ -1,17 +1,23 @@
1
1
  require "monitor_me/version"
2
+ require 'colorize'
2
3
 
3
4
  class MonitorMe
4
- attr_accessor :apikey
5
- def initialize(apikey)
6
- @apikey = apikey
7
- end
8
5
 
9
- def print_api_key
10
- print "APIKEY: #{apikey}"
6
+ def self.log_error(record)
7
+ if MONITOR_APIKEY.nil? || MONITOR_APIKEY.empty?
8
+ puts "Oops. Cannot send response without apikey.".red
9
+ puts "Please provide an apikey in this format in config/environments/*.rb:"
10
+ puts "\nMONITOR_APIKEY = 'apikey' # note it is strongly recommended to use ENV variables in non-development environments!"
11
+ else
12
+ puts "LOGGIN ERROR FOR #{record.class.name} RECORD\n".yellow
13
+ record.errors.full_messages.each do |error|
14
+ puts error.red
15
+ end
16
+ puts record.to_yaml
17
+ end
11
18
  end
12
19
 
13
- def log_error(record)
14
- print "LOGGIN ERROR FOR #{record.class.name} RECORD"
15
- print record.errors.full_messages
20
+ def self.puts_api_key_global
21
+ puts "#{MONITOR_APIKEY}" unless MONITOR_APIKEY.blank?
16
22
  end
17
23
  end
data/monitor_me.gemspec CHANGED
@@ -25,4 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.bindir = "exe"
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
+
29
+ spec.add_runtime_dependency "colorize"
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monitor_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Charette
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2022-05-14 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colorize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description:
14
28
  email:
15
29
  - charettesa19@gmail.com