signalman 0.1.0 → 0.1.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: b339dda80c8dea8c1ce6c651d543c808fdcacc634b013d27e3791fe9be6c1a13
4
- data.tar.gz: 482987c4c114ee1e1f3c630c45e37879dc058b70747712e82b5f818da28fe129
3
+ metadata.gz: 0b28d7fca8056eae8e21a3ef173b4935090754a02f7dc6fed613171e62799974
4
+ data.tar.gz: a443c1aba2246d0072dcb30360ab9f58176d5eb316122be70ef082bbab58ec2f
5
5
  SHA512:
6
- metadata.gz: 9c998b4967fd840aa5c503fc4aa9242ea6e479300b96bab94d6720ab8fadb2c7630d967deed07f6a6360a3237371a6d58df52ab612366b3ac32c90bd57a1ae4d
7
- data.tar.gz: 8c17c1381bbf37112493f7cf9afe13322951c2089f9d71b9e5bdd000eab4c843cc3dc19a085d6ce8aac103ef93127e8357c2834dbb5a8932065c612d01fcf29c
6
+ metadata.gz: 573fded60e4a16fbd33ae806b93ecc10bce784a04c1eca15a2340982efcd9b03bf98b1d113bc04c23d4a12584be54665345296e663006c4d3b29d8b4c7f84560
7
+ data.tar.gz: e67dc0da5783f91cf31f4be8e1fc31e7bec08849ae2564de8f48cae35cd5855cead06715eafad89b88e0179cff9f2746b3fac98a30743dd7dcc8d8513f0bd97a
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Signalman
2
- Short description and motivation.
2
+ A debug tool for Ruby on Rails application.
3
3
 
4
4
  ## Usage
5
5
  How to use my plugin.
@@ -8,17 +8,17 @@ How to use my plugin.
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem "signalman"
11
+ bundle add "signalman", group: :development
12
12
  ```
13
13
 
14
- And then execute:
15
- ```bash
16
- $ bundle
14
+ Add migrations
15
+ ```ruby
16
+ bin/rails signalman:install:migrations
17
17
  ```
18
18
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install signalman
19
+ Mount to the Rails routes
20
+ ```ruby
21
+ mount Signalman::Engine => "/signalman" if Rails.env.development?
22
22
  ```
23
23
 
24
24
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module Signalman
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/signalman.rb CHANGED
@@ -36,6 +36,8 @@ module Signalman
36
36
  duration: event.duration,
37
37
  payload: payload
38
38
  )
39
+ rescue ActiveRecord::StatementInvalid => e
40
+ Rails.logger.error "[Signalman] #{e.message}"
39
41
  end
40
42
 
41
43
  # Time measure since system boot with
@@ -88,9 +90,18 @@ module Signalman
88
90
  end
89
91
 
90
92
  class QueryHandler < BaseHandler
93
+ IGNORED_QUERIES = [
94
+ "SCHEMA",
95
+ "TRANSACTION",
96
+ "ActiveRecord::SchemaMigration",
97
+ "ActiveRecord::InternalMetadata",
98
+ /^Signalman/
99
+ ]
100
+
101
+ # CREATE_TABLE queries have nil for `name`
91
102
  def skip?
92
- ["SCHEMA", "TRANSACTION"].include?(event.payload[:name]) ||
93
- event.payload[:name]&.include?("Signalman::")
103
+ return if event.payload[:name].blank?
104
+ IGNORED_QUERIES.any?{ |q| q.match? event.payload[:name] }
94
105
  end
95
106
 
96
107
  def process
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signalman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-01 00:00:00.000000000 Z
11
+ date: 2023-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.4.17
94
+ rubygems_version: 3.4.13
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Development tools for Ruby on Rails