danger-rails_best_practices 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 031feabf20a7c5eec09939d71d5a14390bbdd54f
4
- data.tar.gz: e4e7f0d41c8ff3f96bced9b3949739e03bbde3af
3
+ metadata.gz: f68087b7d06bdaeb36834310b7b9c97b0be378fd
4
+ data.tar.gz: 95cc88e911fb17fa7332f68e35e8d886e52ad0e3
5
5
  SHA512:
6
- metadata.gz: ba632be929844a01ad5d43007a844eabb083b9e244eeae3cf8ebb7811bc3a52e73d5bc39247136d26e39e434ee6f5c4944e6d192a19edea8272783ff5823d8ef
7
- data.tar.gz: b48432814c4b7a340890c74f61e5cb801e0f2cc3041636d93f5f1497ea6c02a98b129efa5b90ec29ba464be56d5fd313b69a4cb52e347ee5dca652acee8d38dd
6
+ metadata.gz: d445ac4d66b00c0f8d85ad28f21e38da6e5cd166558b97703c7d5ffaff0ab111beb0c01c292e3dc5b2d72e8152b815a77a0c244f6f85ba1dab1cdab32a645885
7
+ data.tar.gz: fd5eb99645323af48a752670ae895e280f9a2ecb872215daa43dc426f1ce6bda06115f68b2ff8ec1e58c4afe43d4bdb0a580f8d9d6595233e301e5ca0fcc6b66
data/.rubocop.yml CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  # If you don't like these settings, just delete this file :)
4
4
 
5
- AllCops:
6
- TargetRubyVersion: 2.0
7
-
8
5
  # kind_of? is a good way to check a type
9
6
  Style/ClassCheck:
10
7
  EnforcedStyle: kind_of?
data/.travis.yml CHANGED
@@ -8,9 +8,9 @@ cache:
8
8
  - bundle
9
9
 
10
10
  rvm:
11
- - 2.0
12
- - 2.1.3
13
- - 2.3.1
11
+ - 2.2.8
12
+ - 2.3.5
13
+ - 2.4.2
14
14
 
15
15
  before_install:
16
16
  - gem update bundler
data/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Change Log
2
+
3
+ ## [v0.1.1](https://github.com/blooper05/danger-rails_best_practices/tree/v0.1.1) (2017-10-21)
4
+ [Full Changelog](https://github.com/blooper05/danger-rails_best_practices/compare/v0.1.0...v0.1.1)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - CI is failing due to Rubocop settings [\#3](https://github.com/blooper05/danger-rails_best_practices/issues/3)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - :bug: Fix Neverfail test [\#5](https://github.com/blooper05/danger-rails_best_practices/pull/5) ([blooper05](https://github.com/blooper05))
13
+ - :bug: Fix TargetRubyVersion setting of .rubocop.yml [\#4](https://github.com/blooper05/danger-rails_best_practices/pull/4) ([blooper05](https://github.com/blooper05))
14
+ - Escape filename regexp [\#1](https://github.com/blooper05/danger-rails_best_practices/pull/1) ([edvakf](https://github.com/edvakf))
15
+
16
+ ## [v0.1.0](https://github.com/blooper05/danger-rails_best_practices/tree/v0.1.0) (2017-10-05)
17
+
18
+
19
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Gem Version](https://img.shields.io/gem/v/danger-rails_best_practices.svg)](https://rubygems.org/gems/danger-rails_best_practices)
8
8
  [![License](https://img.shields.io/github/license/blooper05/danger-rails_best_practices.svg)](https://github.com/blooper05/danger-rails_best_practices/blob/master/LICENSE)
9
9
 
10
- A [danger](https://rubygems.org/gems/danger) plugin for [rails_best_practices](https://rubygems.org/gems/rails_best_practices).
10
+ A [Danger](https://rubygems.org/gems/danger) plugin for [rails_best_practices](https://rubygems.org/gems/rails_best_practices).
11
11
 
12
12
  ## Installation
13
13
 
@@ -1,3 +1,3 @@
1
1
  module RailsBestPractices
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -32,7 +32,7 @@ module Danger
32
32
 
33
33
  def fetch_files_to_lint
34
34
  files = git.modified_files + git.added_files
35
- Array(files.map { |file| /#{file}/ })
35
+ files.map { |file| Regexp.compile(Regexp.escape(file)) }
36
36
  end
37
37
 
38
38
  def warn_each_line(lint_errors)
File without changes
File without changes
@@ -26,8 +26,8 @@ module Danger
26
26
  let(:violation_reports) { dangerfile.violation_report[:warnings] }
27
27
 
28
28
  context 'with changed files' do
29
- let(:modified_files) { [double('Modified Files')] }
30
- let(:added_files) { [double('Added Files')] }
29
+ let(:modified_files) { %w(spec/fixtures/modified_file.rb) }
30
+ let(:added_files) { %w(spec/fixtures/added_file.rb) }
31
31
 
32
32
  context 'with lint errors' do
33
33
  let(:stubbings) { changed_files && lint_errors }
@@ -73,6 +73,24 @@ module Danger
73
73
  expect(violation_reports).to be_empty
74
74
  end
75
75
  end
76
+
77
+ describe 'arguments passed to RailsBestPractices::Analyzer.new' do
78
+ let(:stubbings) { changed_files && analyzer }
79
+
80
+ let(:modified_files) { %w(spec/fixtures/modified_file.rb) }
81
+ let(:added_files) { %w(\*?{}.) }
82
+
83
+ let(:analyzer) do
84
+ expect(::RailsBestPractices::Analyzer).to receive(:new)
85
+ .with('.', 'silent' => true,
86
+ 'only' => [%r{spec/fixtures/modified_file\.rb},
87
+ /\\\*\?\{\}\./])
88
+ .and_call_original
89
+ end
90
+
91
+ it 'escapes filenames correctly' do
92
+ end
93
+ end
76
94
  end
77
95
  end
78
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-rails_best_practices
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
  - blooper05
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -188,6 +188,7 @@ files:
188
188
  - ".gitignore"
189
189
  - ".rubocop.yml"
190
190
  - ".travis.yml"
191
+ - CHANGELOG.md
191
192
  - Gemfile
192
193
  - Guardfile
193
194
  - LICENSE
@@ -198,6 +199,8 @@ files:
198
199
  - lib/danger_rails_best_practices.rb
199
200
  - lib/rails_best_practices/gem_version.rb
200
201
  - lib/rails_best_practices/plugin.rb
202
+ - spec/fixtures/added_file.rb
203
+ - spec/fixtures/modified_file.rb
201
204
  - spec/rails_best_practices_spec.rb
202
205
  - spec/spec_helper.rb
203
206
  homepage: https://github.com/blooper05/danger-rails_best_practices
@@ -225,5 +228,7 @@ signing_key:
225
228
  specification_version: 4
226
229
  summary: A Danger plugin to lint Ruby files through rails_best_practices.
227
230
  test_files:
231
+ - spec/fixtures/added_file.rb
232
+ - spec/fixtures/modified_file.rb
228
233
  - spec/rails_best_practices_spec.rb
229
234
  - spec/spec_helper.rb