dry-monitor 0.6.3 → 1.0.0

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: afc2d74e0898f3b20cf5ea70690fc80ab2a3d2eb7e7c08e804f56e958b2a448b
4
- data.tar.gz: 03e39000363e919196a4deb5445fed39d13a2a8a07d132126e2faf37826f0172
3
+ metadata.gz: 02b2ad507bf711d0d3f5ab6bb2ea574afff379851d1ac3897f8bce1aa984dba7
4
+ data.tar.gz: 0ef87b325ef52c171a11e385b97158d4e0744508b767a83beb581abb51e6ead5
5
5
  SHA512:
6
- metadata.gz: 6c4dc960f95a645aaf66133edca30d913bb26ddd476f0fe2054c8809b4aeea5d763e001b631199fc05dbfa1883eb9dcaf81e5288c5e2ad38929a2d34d08fa042
7
- data.tar.gz: ebb3f927add3d05f0d8a0738be91d66be8fb69f20f5066e9a2796919076ba7332ad1f1a21a13d268f09af2461271589abcd4f6fad5bf63fcb0d89b1e4baaf4a4
6
+ metadata.gz: b449e83e90980e65b0e38996a257338409797e4dabd2ed3a632cea63fa157db1cd07878c5979698727300ad2c1ac5bc5d1eec9a32f432bcb7c5e816162043c4f
7
+ data.tar.gz: e73a5defc0e6cda1e5bb0f27c992f9d41fc6ed064f51f670130e9863951cf8f984a6b880df68f74a95face1af6a15b20a28a65f5060ddcc3cc94f5f8b02e9057
data/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.0.0 2022-11-04
4
+
5
+
6
+ ### Changed
7
+
8
+ - This version is compatible with recently released dry-rb dependencies (@flash-gordon)
9
+ - Bumped version to 1.0.0 (@solnic)
10
+
11
+ [Compare v0.7.0...v1.0.0](https://github.com/dry-rb/dry-monitor/compare/v0.7.0...v1.0.0)
12
+
13
+ ## 0.7.0 2022-10-15
14
+
15
+
16
+ ### Changed
17
+
18
+ - Bump dry-core to >= 0.9.0 (@flash-gordon)
19
+
20
+ [Compare v0.6.3...v0.7.0](https://github.com/dry-rb/dry-monitor/compare/v0.6.3...v0.7.0)
21
+
22
+ ## 0.6.3 2022-08-11
23
+
24
+
25
+ ### Fixed
26
+
27
+ - Extensions were excluded from auto-loading. They to be loaded manually (addresses #49) (@flash-gordon)
28
+
29
+
30
+ [Compare v0.6.2...v0.6.3](https://github.com/dry-rb/dry-monitor/compare/v0.6.2...v0.6.3)
31
+
32
+ ## 0.6.2 2022-08-10
33
+
34
+
35
+ ### Fixed
36
+
37
+ - Exclude `VERSION` constant from autoload (fixes #49) (@flash-gordon)
38
+
39
+
40
+ [Compare v0.6.1...v0.6.2](https://github.com/dry-rb/dry-monitor/compare/v0.6.1...v0.6.2)
41
+
3
42
  ## 0.6.1 2022-07-11
4
43
 
5
44
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2021 dry-rb team
3
+ Copyright (c) 2015-2022 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/dry-monitor.gemspec CHANGED
@@ -29,13 +29,11 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = ">= 2.7.0"
30
30
 
31
31
  # to update dependencies edit project.yml
32
- spec.add_runtime_dependency "dry-configurable", "~> 0.13", ">= 0.13.0"
33
- spec.add_runtime_dependency "dry-core", "~> 0.5", ">= 0.5"
34
- spec.add_runtime_dependency "dry-events", "~> 0.2"
35
- spec.add_runtime_dependency "zeitwerk", "~> 2.5"
32
+ spec.add_runtime_dependency "dry-configurable", "~> 1.0", "< 2"
33
+ spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
34
+ spec.add_runtime_dependency "dry-events", "~> 1.0", "< 2"
36
35
 
37
36
  spec.add_development_dependency "bundler"
38
- spec.add_development_dependency "rake"
39
37
  spec.add_development_dependency "rouge", "~> 2.0", ">= 2.2.1"
40
38
  spec.add_development_dependency "rspec"
41
39
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dry
4
+ module Monitor
5
+ # @api public
6
+ class Clock
7
+ # @api public
8
+ def measure
9
+ start = current
10
+ result = yield
11
+ [result, current - start]
12
+ end
13
+
14
+ # @api public
15
+ def current
16
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,22 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/core/constants"
4
3
  require "dry/events/publisher"
5
4
 
6
5
  module Dry
7
6
  module Monitor
8
- class Clock
9
- def measure
10
- start = current
11
- result = yield
12
- [result, current - start]
13
- end
14
-
15
- def current
16
- Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
17
- end
18
- end
19
-
20
7
  CLOCK = Clock.new
21
8
 
22
9
  class Notifications
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/configurable"
4
3
  require "dry/monitor/rack/middleware"
5
4
 
6
5
  module Dry
@@ -4,9 +4,9 @@ module Dry
4
4
  module Monitor
5
5
  module Rack
6
6
  class Middleware
7
- REQUEST_START = :'rack.request.start'
8
- REQUEST_STOP = :'rack.request.stop'
9
- REQUEST_ERROR = :'rack.request.error'
7
+ REQUEST_START = :"rack.request.start"
8
+ REQUEST_STOP = :"rack.request.stop"
9
+ REQUEST_ERROR = :"rack.request.error"
10
10
 
11
11
  Notifications.register_event(REQUEST_START)
12
12
  Notifications.register_event(REQUEST_STOP)
@@ -5,7 +5,9 @@ module Dry
5
5
  module SQL
6
6
  module Colorizers
7
7
  class Default
8
+ # rubocop:disable Style/RedundantInitialize
8
9
  def initialize(_theme); end
10
+ # rubocop:enable Style/RedundantInitialize
9
11
 
10
12
  def call(string)
11
13
  string
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry-configurable"
4
- require "dry/core/extensions"
5
-
6
3
  module Dry
7
4
  module Monitor
8
5
  Notifications.register_event(:sql)
@@ -12,6 +9,7 @@ module Dry
12
9
  extend Dry::Core::Extensions
13
10
  extend Dry::Configurable
14
11
 
12
+ # rubocop:disable Lint/ConstantDefinitionInBlock
15
13
  register_extension(:default_colorizer) do
16
14
  require "dry/monitor/sql/colorizers/default"
17
15
 
@@ -35,6 +33,7 @@ module Dry
35
33
 
36
34
  Logger.include(RougeColorizer)
37
35
  end
36
+ # rubocop:enable Lint/ConstantDefinitionInBlock
38
37
 
39
38
  setting :theme
40
39
  setting :message_template, default: %( Loaded %s in %sms %s)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Monitor
5
- VERSION = "0.6.3"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
data/lib/dry/monitor.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  require "zeitwerk"
4
4
 
5
- require "dry/core/extensions"
6
- require "dry/core/constants"
5
+ require "dry/core"
6
+ require "dry/configurable"
7
7
  require "dry/monitor/version"
8
8
 
9
9
  module Dry
@@ -20,6 +20,7 @@ module Dry
20
20
  require "dry/monitor/sql/logger"
21
21
  end
22
22
 
23
+ # @api private
23
24
  def self.loader
24
25
  @loader ||= Zeitwerk::Loader.new.tap do |loader|
25
26
  root = File.expand_path("..", __dir__)
@@ -30,12 +31,12 @@ module Dry
30
31
  "#{root}/dry-monitor.rb",
31
32
  "#{root}/dry/monitor/version.rb",
32
33
  "#{root}/dry/monitor/rack/**/*.rb",
33
- "#{root}/dry/monitor/sql/**/*.rb",
34
+ "#{root}/dry/monitor/sql/**/*.rb"
34
35
  )
35
36
  loader.inflector.inflect "sql" => "SQL"
36
37
  end
37
38
  end
39
+
40
+ loader.setup
38
41
  end
39
42
  end
40
-
41
- Dry::Monitor.loader.setup
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -16,84 +16,62 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.13'
20
- - - ">="
19
+ version: '1.0'
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.13.0
22
+ version: '2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.13'
30
- - - ">="
29
+ version: '1.0'
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.13.0
32
+ version: '2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dry-core
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.5'
40
- - - ">="
39
+ version: '1.0'
40
+ - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.5'
42
+ version: '2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '0.5'
50
- - - ">="
49
+ version: '1.0'
50
+ - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.5'
52
+ version: '2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: dry-events
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.2'
60
- type: :runtime
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '0.2'
67
- - !ruby/object:Gem::Dependency
68
- name: zeitwerk
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
59
+ version: '1.0'
60
+ - - "<"
72
61
  - !ruby/object:Gem::Version
73
- version: '2.5'
62
+ version: '2'
74
63
  type: :runtime
75
64
  prerelease: false
76
65
  version_requirements: !ruby/object:Gem::Requirement
77
66
  requirements:
78
67
  - - "~>"
79
68
  - !ruby/object:Gem::Version
80
- version: '2.5'
81
- - !ruby/object:Gem::Dependency
82
- name: bundler
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
69
+ version: '1.0'
70
+ - - "<"
93
71
  - !ruby/object:Gem::Version
94
- version: '0'
72
+ version: '2'
95
73
  - !ruby/object:Gem::Dependency
96
- name: rake
74
+ name: bundler
97
75
  requirement: !ruby/object:Gem::Requirement
98
76
  requirements:
99
77
  - - ">="
@@ -153,6 +131,7 @@ files:
153
131
  - dry-monitor.gemspec
154
132
  - lib/dry-monitor.rb
155
133
  - lib/dry/monitor.rb
134
+ - lib/dry/monitor/clock.rb
156
135
  - lib/dry/monitor/logger.rb
157
136
  - lib/dry/monitor/notifications.rb
158
137
  - lib/dry/monitor/rack/logger.rb