xcop 0.5.6 → 0.5.7
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 +4 -4
- data/bin/xcop +4 -0
- data/lib/xcop/version.rb +1 -1
- data/test/test_xcop.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c34a8bbd7b22ae3433ed8533d3b67a319343d65e
|
|
4
|
+
data.tar.gz: 3fa076b3d636126741220ef84441633d353fafd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e807e0225a109d0c2880ca434328d71a9f0f05e0026115934043d647fc570d2c7160d6fa96b9e711115e731084feeb784b606a521cad351c68e32068b540c294
|
|
7
|
+
data.tar.gz: 033d61c7be6cc7bc3935ddf213757f4cbc1fc49e4fa72d318ccf59d7c57c7840046af69ec8658bfd8f413ba5b31eb07e4b32b1bd32984642f8ba62c28d89ad5e
|
data/bin/xcop
CHANGED
|
@@ -28,6 +28,10 @@ require 'nokogiri'
|
|
|
28
28
|
require_relative '../lib/xcop'
|
|
29
29
|
require_relative '../lib/xcop/version'
|
|
30
30
|
|
|
31
|
+
if Gem::Version.new(Nokogiri::VERSION) < Gem::Version.new('1.8')
|
|
32
|
+
puts "Nokogiri version #{Nokogiri::VERSION} is too old, 1.8+ is required"
|
|
33
|
+
end
|
|
34
|
+
|
|
31
35
|
opts = Slop.parse(ARGV, strict: true, help: true) do |o|
|
|
32
36
|
o.banner = "Usage (#{Xcop::VERSION}): xcop [options] [files...]"
|
|
33
37
|
o.bool '-h', '--help', 'Show these instructions'
|
data/lib/xcop/version.rb
CHANGED
data/test/test_xcop.rb
CHANGED
|
@@ -50,14 +50,14 @@ class TestXcop < Minitest::Test
|
|
|
50
50
|
def test_license_presence
|
|
51
51
|
Dir.mktmpdir 'test2' do |dir|
|
|
52
52
|
f = File.join(dir, 'a.xml')
|
|
53
|
-
license = "Copyright (c) All Good People\
|
|
53
|
+
license = " Copyright (c) All Good People\n Don't touch it!\n\n"
|
|
54
54
|
File.write(
|
|
55
55
|
f,
|
|
56
56
|
[
|
|
57
57
|
'<?xml version="1.0"?>',
|
|
58
58
|
'<!--',
|
|
59
|
-
'Copyright (c) All Good People',
|
|
60
|
-
'Don\'t touch it!',
|
|
59
|
+
' Copyright (c) All Good People',
|
|
60
|
+
' Don\'t touch it!',
|
|
61
61
|
'-->',
|
|
62
62
|
'<hello>Dude!</hello>',
|
|
63
63
|
''
|
|
@@ -86,7 +86,7 @@ class TestXcop < Minitest::Test
|
|
|
86
86
|
def test_fixes_document
|
|
87
87
|
Dir.mktmpdir 'test3' do |dir|
|
|
88
88
|
f = File.join(dir, 'bad.xml')
|
|
89
|
-
license = "Copyright (c) Me, Myself, and I\
|
|
89
|
+
license = " Copyright (c) Me, Myself, and I\n Like it?\n\n"
|
|
90
90
|
File.write(f, '<hello>My friend!</hello>')
|
|
91
91
|
Xcop::Document.new(f).fix(license)
|
|
92
92
|
assert_equal(Xcop::Document.new(f).diff, '')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xcop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|