filewatcher 2.0.0.beta4 → 2.0.0.beta5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e9ecdeee0c20df3055e1078a67e8194040361fbcea9f1c633f2b33a8177f250
4
- data.tar.gz: ba5abe65b765b0cc4c4630aae0cf1e0751c7ea4dec5f39911a9de9510fff7e9e
3
+ metadata.gz: c4552a19cac521012fb0cca2c232a14f501530262e02639ed017c0897e5f985f
4
+ data.tar.gz: f3d98c14badcbd439a9dca5ce289b40cc80aecb1c377d8ec08f80e76c398aaf5
5
5
  SHA512:
6
- metadata.gz: 287d42ea2fb239be62a4a0701f5b84440c409b6dc93c3b8caf5a5c8c87958ab12f4885e146e679f988dc2d2ef9c7d47d77be79ce4b8dd6d0ea97d71d63de9116
7
- data.tar.gz: 2a296164258b091771802bbeb7d33690160e235220d30644743abe441d7801259dcad5bcd4216655c1e57549b9052edb45f1b1440a23ba1d84e4981f278a4e90
6
+ metadata.gz: 85e030c3e12237aff4dffddfb80fdf4b288b462a35e21a63d254e1aea4ca40cd2d5ba27cb21e39e3847f16936d4291398a106bd55a3ef40205f35d75c401603c
7
+ data.tar.gz: 7cec237639d7c760b963fe42b7c7d6ef40b989dde617308434e7d29037f73aad3f6fc87f971f60b4e47f420aec779e36ab76e5a6a2f27cf4f1c0849719b0b286
@@ -13,18 +13,18 @@ require_relative 'spec_helper/watch_run'
13
13
  class Filewatcher
14
14
  ## Helper for common spec features between plugins
15
15
  module SpecHelper
16
- module_function
16
+ ENVIRONMENT_SPECS_COEFFICIENTS = {
17
+ -> { ENV['CI'] } => 1,
18
+ -> { RUBY_PLATFORM == 'java' } => 1,
19
+ -> { Gem::Platform.local.os == 'darwin' } => 1
20
+ }.freeze
17
21
 
18
22
  def logger
19
23
  @logger ||= Logger.new($stdout, level: :debug)
20
24
  end
21
25
 
22
26
  def environment_specs_coefficients
23
- @environment_specs_coefficients ||= {
24
- -> { ENV['CI'] } => 1,
25
- -> { RUBY_PLATFORM == 'java' } => 1,
26
- -> { Gem::Platform.local.os == 'darwin' } => 1
27
- }
27
+ ENVIRONMENT_SPECS_COEFFICIENTS
28
28
  end
29
29
 
30
30
  def wait(seconds: 1, interval: 1, &block)
@@ -62,7 +62,7 @@ class Filewatcher
62
62
 
63
63
  def system_stat(filename)
64
64
  case (host_os = RbConfig::CONFIG['host_os'])
65
- when 'linux'
65
+ when /linux(-gnu)?/
66
66
  `stat --printf 'Modification: %y, Change: %z\n' #{filename}`
67
67
  when /darwin\d*/
68
68
  `stat #{filename}`
@@ -80,5 +80,10 @@ class Filewatcher
80
80
  # debug command
81
81
  `#{command}`
82
82
  end
83
+
84
+ ## https://github.com/rubocop/ruby-style-guide/issues/556#issuecomment-828672008
85
+ # rubocop:disable Style/ModuleFunction
86
+ extend self
87
+ # rubocop:enable Style/ModuleFunction
83
88
  end
84
89
  end
@@ -1,17 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'forwardable'
4
-
5
3
  class Filewatcher
6
4
  module SpecHelper
7
5
  ## Base class for Filewatcher runners in specs
8
6
  class WatchRun
9
- extend Forwardable
7
+ include Filewatcher::SpecHelper
10
8
 
11
9
  TMP_DIR = "#{Dir.getwd}/spec/tmp"
12
10
 
13
- def_delegators Filewatcher::SpecHelper, :debug, :wait, :system_stat
14
-
15
11
  attr_reader :filename
16
12
 
17
13
  def initialize(filename:, action:, directory:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Filewatcher
4
- VERSION = '2.0.0.beta4'
4
+ VERSION = '2.0.0.beta5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filewatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta4
4
+ version: 2.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Flemming
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-28 00:00:00.000000000 Z
12
+ date: 2021-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler