jiminy 0.1.1 → 0.2.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: d57e7382bf06cd66f5643cf186e16a4e59ecf25bbad0cad81b4226f350451cbf
4
- data.tar.gz: 15ffb9f981d2fdd343e3f73e9c614512c410564266a8f097a782e75d2c3baed7
3
+ metadata.gz: 0c2d7c5c5ca5c253b2c1c9962f4d2c846a1bf2ebb9ecbcfa4d5a254832dae2ec
4
+ data.tar.gz: 77f60976535c54d0e42205aedbca82067164b15956d1b0b7a44a49791a7d4de5
5
5
  SHA512:
6
- metadata.gz: 9869b13eca49bdd720d8d89e3c0d65e03c992e5dab0560188819b993f70a6266ff1da85e65ab35a711bba1b8706dd8569aa12fc5371ee852cc57316500c14208
7
- data.tar.gz: c1fcab80a491c0c001c7e2b74cc3598d112fa3e83dd49815ffebed6791e59c648c43eba52bbe94b99e50a9e041a17e295ff9d414325893cddda5dc2251d591c6
6
+ metadata.gz: 8ee0316e181e196a2a091e68aedbfded41f0a4834f7c71370a71ba7fcaa512380a58d300aa79fae33e8302c13b7c1dd4796dce0027a3218ef25722d5c7983135
7
+ data.tar.gz: f15f0f87a0b1bdd97eed27e250f23b51c72049b8b86fcd9468a226b559a379d10ef0cc30deb7697dfe9c62b86b3e6a009984a7e698e4f4607dd99800566126d7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jiminy (0.1.1)
4
+ jiminy (0.2.0)
5
5
  octokit (>= 4)
6
6
  prosopite (>= 1)
7
7
  rspec
@@ -6,24 +6,26 @@ module Jiminy
6
6
  class TmpFileRecorder
7
7
  require_relative "../n_plus_one"
8
8
 
9
+ # rubocop:disable Metrics/AbcSize
9
10
  def record(location:, queries:)
10
11
  yaml_content = File.read(Jiminy.config.temp_file_location)
11
12
  array = YAML.safe_load(yaml_content)
12
13
  n_plus_one = NPlusOne.new(location: location, queries: queries)
13
14
 
14
15
  if filepath_ignored?(n_plus_one.file)
15
- Jiminy.logger.debug("Ignoring n+1 instance #{n_plus_one}")
16
+ Jiminy.logger.debug { "Ignoring n+1 instance #{n_plus_one}" }
16
17
  return
17
18
  end
18
19
 
19
20
  if location_in_array?(location, array)
20
- Jiminy.logger.debug("Already reported n+1 instance #{n_plus_one}")
21
+ Jiminy.logger.debug { "Already reported n+1 instance #{n_plus_one}" }
21
22
  return
22
23
  end
23
24
 
24
25
  array << n_plus_one.to_h
25
26
  File.write(Jiminy.config.temp_file_location, array.to_yaml)
26
27
  end
28
+ # rubocop:enable Metrics/AbcSize
27
29
 
28
30
  private
29
31
 
@@ -14,7 +14,7 @@ module Jiminy
14
14
  end
15
15
 
16
16
  def perform!
17
- Jiminy.logger.debug("API request: #@url")
17
+ Jiminy.logger.debug { "API request: #@url" }
18
18
  response
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jiminy
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/jiminy.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "jiminy/version"
4
4
  require_relative "jiminy/setup"
5
5
  require_relative "jiminy/recording" if defined?(Rails)
6
+ require_relative "jiminy/rspec" if defined?(Rspec) && ENV["RAILS_ENV"] == "test"
6
7
 
7
8
  module Jiminy
8
9
  module_function
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jiminy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bodacious
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-09 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit