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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 289d84e6d22f2ce0f546cb2d8b2a9af7614413da
4
- data.tar.gz: 9f3f0fa230535ab8ff0e3f898598d3ef41c386df
2
+ SHA256:
3
+ metadata.gz: 71034a49dcb0d8a39223679c33245d2781bf93181da1a7295a2acfa03c98381b
4
+ data.tar.gz: 83d34ba008a7af022e66e1c5e456c6bde22823da8a4757e2f5e6bd7e7f5ea670
5
5
  SHA512:
6
- metadata.gz: e875d93fcd9b6dbee5a9e80a23bfeec8e714167ff4c5a34938da551d87d116b300ee54e37957d7a5db581eef0b1be4f41c086000ecde7ba4afce34bbf3ca7802
7
- data.tar.gz: 839b099d814b6ed4e3d7600561c0082eb242b466baa01f7c0e13b19dc7dc978f0a98aa6a6cabf2834d0534e122c99248e694d9b3e8ceb8b27418f8d4b200ce21
6
+ metadata.gz: 254497640709e972f9d61be9e8cca678ca4106c0741494f9d6ca0d8463da40bb0912ffd272f813795cc449c4546e584f79bad7915bdffbfb92cce45e6e2df461
7
+ data.tar.gz: 915450d51d717e61de4d5bd7e0df93ad2306c215f159e1b9a8047d77eda5563a93844e74b33c25ce0f63cf6baa82f71f7c1d5cc1157f322485d70f4eba97b8cc
@@ -0,0 +1,6 @@
1
+ ---
2
+ inherit_gem:
3
+ rubocop-fnando: .rubocop.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.6
@@ -1,11 +1,18 @@
1
+ ---
1
2
  language: ruby
2
3
  cache: bundler
3
4
  sudo: false
4
5
  rvm:
5
- - 2.3.1
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 $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wvHTghiQpd94Eubov993YcNFtKH0V4BhzFPA+o6QscmPHnRytX+neljM+pUiXkZUvi8uMgrCc7eTq225w6z21T+Xgh6T7Bs+vix+k3uDrnGWg1q2ZbvP+CiD3jjdpvBa4jf9c/ubqAtvvdPjfuyfY2JhKnh6WS2qDUTtRWX4RZlIR6PrYuD+vm6dYWaAsofrsNJiahCAyZqfWmyZ30NaOSY3GF/PQnRW98bIgjj0RJnWBe6lS30fEePTvk9GC/j1QfiY5q6uokImQ8Sd5CgJrJNesKuXyE83DSvrAEvCNenr42fOdrTfPeK044RqHb/2POvLlL0c+u7xuHvh+KwaEYo1+8Pc4qV3Nvhknk6kw=
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
  gemspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CheckFiles
2
2
 
3
- [![Travis-CI](https://travis-ci.org/fnando/check_files.png)](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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/testtask"
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "check_files"
@@ -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`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
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/}) { |f| File.basename(f) }
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 "rails"
25
+ spec.add_development_dependency "mocha"
23
26
  spec.add_development_dependency "pry-meta"
24
- spec.add_development_dependency "codeclimate-test-reporter"
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
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rails/railtie"
4
+ require "fileutils"
2
5
 
3
6
  module CheckFiles
4
7
  require "check_files/version"
@@ -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.open(cache_path, "w") {|f| f << current_digest }
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,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CheckFiles
2
4
  class Middleware
3
5
  def initialize(app)
@@ -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
- fail "You must restart the web development server; #{checker.pattern} has changed."
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CheckFiles
2
4
  class Railtie < Rails::Railtie
3
5
  config.check_files = ActiveSupport::OrderedOptions.new
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CheckFiles
2
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
3
5
  end
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.0
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: 2016-05-19 00:00:00.000000000 Z
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: rake
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: minitest-utils
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: pry-meta
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: codeclimate-test-reporter
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
- rubyforge_project:
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