check_files 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +6 -0
- data/.travis.yml +9 -2
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/check_files.gemspec +12 -5
- data/lib/check_files.rb +3 -0
- data/lib/check_files/checker.rb +4 -1
- data/lib/check_files/middleware.rb +2 -0
- data/lib/check_files/notifiers/exception.rb +3 -1
- data/lib/check_files/notifiers/logging.rb +3 -1
- data/lib/check_files/notifiers/restart.rb +3 -1
- data/lib/check_files/railtie.rb +2 -0
- data/lib/check_files/version.rb +3 -1
- metadata +50 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 71034a49dcb0d8a39223679c33245d2781bf93181da1a7295a2acfa03c98381b
|
4
|
+
data.tar.gz: 83d34ba008a7af022e66e1c5e456c6bde22823da8a4757e2f5e6bd7e7f5ea670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254497640709e972f9d61be9e8cca678ca4106c0741494f9d6ca0d8463da40bb0912ffd272f813795cc449c4546e584f79bad7915bdffbfb92cce45e6e2df461
|
7
|
+
data.tar.gz: 915450d51d717e61de4d5bd7e0df93ad2306c215f159e1b9a8047d77eda5563a93844e74b33c25ce0f63cf6baa82f71f7c1d5cc1157f322485d70f4eba97b8cc
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,11 +1,18 @@
|
|
1
|
+
---
|
1
2
|
language: ruby
|
2
3
|
cache: bundler
|
3
4
|
sudo: false
|
4
5
|
rvm:
|
5
|
-
- 2.
|
6
|
+
- 2.6.5
|
6
7
|
before_install: gem install bundler
|
8
|
+
before_script:
|
9
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
10
|
+
- chmod +x ./cc-test-reporter
|
11
|
+
- "./cc-test-reporter before-build"
|
12
|
+
after_script:
|
13
|
+
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|
7
14
|
notifications:
|
8
15
|
email: false
|
9
16
|
env:
|
10
17
|
global:
|
11
|
-
secure:
|
18
|
+
- secure: ej6WHUww4mqBmHDh/P2EJM0Y7aPd+rLZGmB8ToL5qs7u+G8o3vohI+fZWpRRzs1rKeRsWLiARNGx8iU7v7dsWiEMgB4Cr+hEIlNi8Ga3IATdZIT0bbdO2+KGlGkBFezAVjmWJnGz2/8QLYvfRoLLNEFDDiA5TzU4W7y8xMc4JWbYb14TZ/Du9ZA7OOzOaVxAUAoDpUBmB35NGx77G4ceovS91mWqb5sOxtdHJOD5lGs3sOOqqB7niqcMijBz/hiV1YizwmnNj4N8YzUfqZRy1bQyjijQaYaY/+NozOhiYworfOjsFMu5PkZZHOtr8nMk9XwvHTghiQpd94Eubov993YcNFtKH0V4BhzFPA+o6QscmPHnRytX+neljM+pUiXkZUvi8uMgrCc7eTq225w6z21T+Xgh6T7Bs+vix+k3uDrnGWg1q2ZbvP+CiD3jjdpvBa4jf9c/ubqAtvvdPjfuyfY2JhKnh6WS2qDUTtRWX4RZlIR6PrYuD+vm6dYWaAsofrsNJiahCAyZqfWmyZ30NaOSY3GF/PQnRW98bIgjj0RJnWBe6lS30fEePTvk9GC/j1QfiY5q6uokImQ8Sd5CgJrJNesKuXyE83DSvrAEvCNenr42fOdrTfPeK044RqHb/2POvLlL0c+u7xuHvh+KwaEYo1+8Pc4qV3Nvhknk6kw=
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CheckFiles
|
2
2
|
|
3
|
-
[![Travis-CI](https://travis-ci.org/fnando/check_files.
|
3
|
+
[![Travis-CI](https://travis-ci.org/fnando/check_files.svg)](https://travis-ci.org/fnando/check_files)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/fnando/check_files/badges/gpa.svg)](https://codeclimate.com/github/fnando/check_files)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/fnando/check_files/badges/coverage.svg)](https://codeclimate.com/github/fnando/check_files/coverage)
|
6
6
|
[![Gem](https://img.shields.io/gem/v/check_files.svg)](https://rubygems.org/gems/check_files)
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/check_files.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "./lib/check_files/version"
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
@@ -11,15 +13,20 @@ Gem::Specification.new do |spec|
|
|
11
13
|
spec.homepage = "https://github.com/fnando/check_files"
|
12
14
|
spec.license = "MIT"
|
13
15
|
|
14
|
-
spec.files = `git ls-files -z
|
16
|
+
spec.files = `git ls-files -z`
|
17
|
+
.split("\x0")
|
18
|
+
.reject {|f| f.match(%r{^(test|spec|features)/}) }
|
15
19
|
spec.bindir = "exe"
|
16
|
-
spec.executables = spec.files.grep(%r{^exe/}) {
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
|
17
21
|
spec.require_paths = ["lib"]
|
18
22
|
|
19
23
|
spec.add_development_dependency "bundler"
|
20
|
-
spec.add_development_dependency "rake"
|
21
24
|
spec.add_development_dependency "minitest-utils"
|
22
|
-
spec.add_development_dependency "
|
25
|
+
spec.add_development_dependency "mocha"
|
23
26
|
spec.add_development_dependency "pry-meta"
|
24
|
-
spec.add_development_dependency "
|
27
|
+
spec.add_development_dependency "rails"
|
28
|
+
spec.add_development_dependency "rake"
|
29
|
+
spec.add_development_dependency "rubocop"
|
30
|
+
spec.add_development_dependency "rubocop-fnando"
|
31
|
+
spec.add_development_dependency "simplecov"
|
25
32
|
end
|
data/lib/check_files.rb
CHANGED
data/lib/check_files/checker.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module CheckFiles
|
2
4
|
class Checker
|
3
5
|
attr_reader :cache_path, :pattern
|
@@ -35,7 +37,8 @@ module CheckFiles
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def update_cache
|
38
|
-
File.
|
40
|
+
FileUtils.mkdir_p(File.dirname(cache_path))
|
41
|
+
File.open(cache_path, "w") {|io| io << current_digest }
|
39
42
|
end
|
40
43
|
|
41
44
|
def compute_digest(entry)
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module CheckFiles
|
2
4
|
module Notifiers
|
3
5
|
class Exception
|
4
6
|
def self.call(checker)
|
5
|
-
|
7
|
+
raise "You must restart the web development server; #{checker.pattern} has changed." # rubocop:disable Metrics/LineLength
|
6
8
|
end
|
7
9
|
end
|
8
10
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module CheckFiles
|
2
4
|
module Notifiers
|
3
5
|
class Logging
|
4
6
|
def self.call(checker)
|
5
|
-
$stderr << "\n\e[0;31m=> You must restart your web development server; #{checker.pattern} has changed.\e[0m\n"
|
7
|
+
$stderr << "\n\e[0;31m=> You must restart your web development server; #{checker.pattern} has changed.\e[0m\n" # rubocop:disable Metrics/LineLength
|
6
8
|
end
|
7
9
|
end
|
8
10
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module CheckFiles
|
2
4
|
module Notifiers
|
3
5
|
class Restart < Logging
|
4
6
|
def self.call(checker)
|
5
|
-
$stderr << "\n\e[0;31m=> #{checker.pattern} has changed, so the web server was restarted. Please reload the page.\e[0m\n"
|
7
|
+
$stderr << "\n\e[0;31m=> #{checker.pattern} has changed, so the web server was restarted. Please reload the page.\e[0m\n" # rubocop:disable Metrics/LineLength
|
6
8
|
system "rails restart"
|
7
9
|
end
|
8
10
|
end
|
data/lib/check_files/railtie.rb
CHANGED
data/lib/check_files/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: check_files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: minitest-utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,21 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: mocha
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-meta
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - ">="
|
@@ -67,7 +81,35 @@ dependencies:
|
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-fnando
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - ">="
|
@@ -81,7 +123,7 @@ dependencies:
|
|
81
123
|
- !ruby/object:Gem::Version
|
82
124
|
version: '0'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: simplecov
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
129
|
- - ">="
|
@@ -102,6 +144,7 @@ extensions: []
|
|
102
144
|
extra_rdoc_files: []
|
103
145
|
files:
|
104
146
|
- ".gitignore"
|
147
|
+
- ".rubocop.yml"
|
105
148
|
- ".travis.yml"
|
106
149
|
- CODE_OF_CONDUCT.md
|
107
150
|
- Gemfile
|
@@ -138,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
181
|
- !ruby/object:Gem::Version
|
139
182
|
version: '0'
|
140
183
|
requirements: []
|
141
|
-
|
142
|
-
rubygems_version: 2.5.1
|
184
|
+
rubygems_version: 3.0.3
|
143
185
|
signing_key:
|
144
186
|
specification_version: 4
|
145
187
|
summary: Check non-reloadable files changes on Rails apps
|