xcop 0.5.7 → 0.5.8

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
2
  SHA1:
3
- metadata.gz: c34a8bbd7b22ae3433ed8533d3b67a319343d65e
4
- data.tar.gz: 3fa076b3d636126741220ef84441633d353fafd4
3
+ metadata.gz: b8507828b2196d70b9b79df306a31a811b6ca5d9
4
+ data.tar.gz: f9f833f991a65de9f701ada5bb1717685ee61d39
5
5
  SHA512:
6
- metadata.gz: e807e0225a109d0c2880ca434328d71a9f0f05e0026115934043d647fc570d2c7160d6fa96b9e711115e731084feeb784b606a521cad351c68e32068b540c294
7
- data.tar.gz: 033d61c7be6cc7bc3935ddf213757f4cbc1fc49e4fa72d318ccf59d7c57c7840046af69ec8658bfd8f413ba5b31eb07e4b32b1bd32984642f8ba62c28d89ad5e
6
+ metadata.gz: cad68fb87c16b42d337654724d71832390c1ce3c51fd803fe607127afe47f0e4193767c0673cfedd2da096fbd8fdee063fdc6ff351da300aaf9528145f5dc63d
7
+ data.tar.gz: 2439e91f98cbc32c3a79782e8ab3875c06155d10aa3021aed650ca9b1c4858c560253083f6e194a1ce2a6f0f62d379bbe67cc6279e23100ef5734b7df637cfe6
data/.0pdd.yml CHANGED
@@ -3,3 +3,7 @@ errors:
3
3
  # alerts:
4
4
  # github:
5
5
  # - yegor256
6
+
7
+ tags:
8
+ - pdd
9
+ - bug
@@ -3,6 +3,7 @@ AllCops:
3
3
  - 'bin/**/*'
4
4
  - 'assets/**/*'
5
5
  DisplayCopNames: true
6
+ TargetRubyVersion: 2.2
6
7
 
7
8
  Metrics/CyclomaticComplexity:
8
9
  Max: 10
@@ -12,3 +13,5 @@ Style/MultilineMethodCallIndentation:
12
13
  Enabled: false
13
14
  Metrics/AbcSize:
14
15
  Enabled: false
16
+ Metrics/BlockLength:
17
+ Max: 50
data/.simplecov CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017 Yegor Bugayenko
3
+ Copyright (c) 2017-2018 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Managed by Zerocracy](http://www.zerocracy.com/badge.svg)](http://www.zerocracy.com)
1
+ [![Managed by Zerocracy](http://www.0crat.com/badge/C3RFVLU72.svg)](http://www.0crat.com/p/C3RFVLU72)
2
2
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/xcop)](http://www.rultor.com/p/yegor256/xcop)
3
3
  [![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
4
4
 
@@ -48,7 +48,8 @@ can ask it to "beautify" them, using `--fix` option:
48
48
  $ xcop --fix broken-file.xml
49
49
  ```
50
50
 
51
- To fix all files in the directory you can do:
51
+ To fix all files in the directory you can do
52
+ ([won't work](https://askubuntu.com/questions/343727/) if your file names contain spaces):
52
53
 
53
54
  ```bash
54
55
  $ xcop --fix $(find . -name '*.xml')
@@ -142,7 +143,7 @@ Just submit a pull request. Make sure `rake` passes.
142
143
 
143
144
  (The MIT License)
144
145
 
145
- Copyright (c) 2017 Yegor Bugayenko
146
+ Copyright (c) 2017-2018 Yegor Bugayenko
146
147
 
147
148
  Permission is hereby granted, free of charge, to any person obtaining a copy
148
149
  of this software and associated documentation files (the 'Software'), to deal
data/Rakefile CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -33,7 +31,7 @@ def version
33
31
  Gem::Specification.load(Dir['*.gemspec'].first).version
34
32
  end
35
33
 
36
- task default: [:clean, :test, :features, :rubocop, :copyright]
34
+ task default: %i[clean test features rubocop copyright]
37
35
 
38
36
  require 'rake/testtask'
39
37
  desc 'Run all unit tests'
@@ -69,7 +67,7 @@ Cucumber::Rake::Task.new(:'features:html') do |t|
69
67
  end
70
68
 
71
69
  task :copyright do
72
- sh "grep -q -r '#{Date.today.strftime('%Y')}' \
70
+ sh "grep -q -r '2017-#{Date.today.strftime('%Y')}' \
73
71
  --include '*.rb' \
74
72
  --include '*.txt' \
75
73
  --include 'Rakefile' \
data/bin/xcop CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
3
- #
4
- # Copyright (c) 2017 Yegor Bugayenko
2
+ # Copyright (c) 2017-2018 Yegor Bugayenko
5
3
  #
6
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
5
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -66,11 +64,11 @@ Then(/^Stdout is empty$/) do
66
64
  end
67
65
 
68
66
  Then(/^Exit code is zero$/) do
69
- raise "Non-zero exit code #{@exitstatus}:\n#{@stdout}" unless @exitstatus == 0
67
+ raise "Non-zero exit #{@exitstatus}:\n#{@stdout}" unless @exitstatus.zero?
70
68
  end
71
69
 
72
70
  Then(/^Exit code is not zero$/) do
73
- raise 'Zero exit code' if @exitstatus == 0
71
+ raise 'Zero exit code' if @exitstatus.zero?
74
72
  end
75
73
 
76
74
  When(/^I run bash with "([^"]*)"$/) do |text|
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +25,7 @@ require_relative 'xcop/version'
27
25
 
28
26
  # Xcop main module.
29
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
28
+ # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
29
  # License:: MIT
32
30
  module Xcop
33
31
  # Command line interface.
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +24,7 @@ require_relative '../xcop'
26
24
 
27
25
  # Xcop rake task.
28
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
30
28
  # License:: MIT
31
29
  module Xcop
32
30
  # Rake task.
@@ -40,7 +38,7 @@ module Xcop
40
38
 
41
39
  def initialize(*args, &task_block)
42
40
  @name = args.shift || :xcop
43
- @includes = %w(xml xsd xhtml xsl html).map { |e| "**/*.#{e}" }
41
+ @includes = %w[xml xsd xhtml xsl html].map { |e| "**/*.#{e}" }
44
42
  @excludes = []
45
43
  @license = nil
46
44
  @quiet = false
@@ -68,8 +66,9 @@ module Xcop
68
66
  rescue StandardError => e
69
67
  abort(e.message)
70
68
  end
69
+ return if @quiet
71
70
  puts "\n#{pluralize(good.length, 'file')} checked, \
72
- everything looks #{Rainbow('pretty').green}" unless @quiet
71
+ everything looks #{Rainbow('pretty').green}"
73
72
  end
74
73
 
75
74
  def pluralize(num, text)
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -22,8 +20,8 @@
22
20
 
23
21
  # Xcop main module.
24
22
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
25
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
23
+ # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
26
24
  # License:: MIT
27
25
  module Xcop
28
- VERSION = '0.5.7'.freeze
26
+ VERSION = '0.5.8'.freeze
29
27
  end
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +25,7 @@ require_relative '../lib/xcop/rake_task'
27
25
 
28
26
  # Xcop rake task.
29
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
28
+ # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
29
  # License:: MIT
32
30
  class TestRakeTask < Minitest::Test
33
31
  def test_basic
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -28,7 +26,7 @@ require_relative '../lib/xcop'
28
26
 
29
27
  # Xcop main module test.
30
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
32
30
  # License:: MIT
33
31
  class TestXcop < Minitest::Test
34
32
  def test_basic
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2018 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -31,8 +29,8 @@ Gem::Specification.new do |s|
31
29
  if s.respond_to? :required_rubygems_version=
32
30
  s.required_rubygems_version = Gem::Requirement.new('>= 0')
33
31
  end
34
- s.rubygems_version = '2.2.2'
35
- s.required_ruby_version = '>= 1.9.3'
32
+ s.rubygems_version = '2.2'
33
+ s.required_ruby_version = '>= 2.2'
36
34
  s.name = 'xcop'
37
35
  s.version = Xcop::VERSION
38
36
  s.license = 'MIT'
@@ -46,16 +44,16 @@ Gem::Specification.new do |s|
46
44
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
47
45
  s.rdoc_options = ['--charset=UTF-8']
48
46
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
49
- s.add_runtime_dependency 'nokogiri', '~>1.8'
50
47
  s.add_runtime_dependency 'differ', '~>0.1.2'
48
+ s.add_runtime_dependency 'nokogiri', '~>1.8'
49
+ s.add_runtime_dependency 'rainbow', '~>3.0'
51
50
  s.add_runtime_dependency 'slop', '~>4.4'
52
- s.add_runtime_dependency 'rainbow', '~>2.2'
53
- s.add_development_dependency 'rake', '12.0.0'
54
51
  s.add_development_dependency 'codecov', '0.1.10'
55
- s.add_development_dependency 'rdoc', '4.2.0'
56
52
  s.add_development_dependency 'cucumber', '1.3.17'
57
53
  s.add_development_dependency 'minitest', '5.5.0'
58
- s.add_development_dependency 'rubocop', '0.41.2'
59
- s.add_development_dependency 'rubocop-rspec', '1.5.1'
54
+ s.add_development_dependency 'rake', '12.0.0'
55
+ s.add_development_dependency 'rdoc', '4.2.0'
60
56
  s.add_development_dependency 'rspec-rails', '3.1.0'
57
+ s.add_development_dependency 'rubocop', '0.52.0'
58
+ s.add_development_dependency 'rubocop-rspec', '1.5.1'
61
59
  end
metadata CHANGED
@@ -1,183 +1,183 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
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-10-02 00:00:00.000000000 Z
11
+ date: 2018-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: differ
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: 0.1.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: 0.1.2
27
27
  - !ruby/object:Gem::Dependency
28
- name: differ
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.2
33
+ version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.2
40
+ version: '1.8'
41
41
  - !ruby/object:Gem::Dependency
42
- name: slop
42
+ name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.4'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '4.4'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rainbow
56
+ name: slop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.2'
61
+ version: '4.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.2'
68
+ version: '4.4'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: codecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 12.0.0
75
+ version: 0.1.10
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 12.0.0
82
+ version: 0.1.10
83
83
  - !ruby/object:Gem::Dependency
84
- name: codecov
84
+ name: cucumber
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.10
89
+ version: 1.3.17
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.10
96
+ version: 1.3.17
97
97
  - !ruby/object:Gem::Dependency
98
- name: rdoc
98
+ name: minitest
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 4.2.0
103
+ version: 5.5.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 4.2.0
110
+ version: 5.5.0
111
111
  - !ruby/object:Gem::Dependency
112
- name: cucumber
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.17
117
+ version: 12.0.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.17
124
+ version: 12.0.0
125
125
  - !ruby/object:Gem::Dependency
126
- name: minitest
126
+ name: rdoc
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 5.5.0
131
+ version: 4.2.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 5.5.0
138
+ version: 4.2.0
139
139
  - !ruby/object:Gem::Dependency
140
- name: rubocop
140
+ name: rspec-rails
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.41.2
145
+ version: 3.1.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.41.2
152
+ version: 3.1.0
153
153
  - !ruby/object:Gem::Dependency
154
- name: rubocop-rspec
154
+ name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 1.5.1
159
+ version: 0.52.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 1.5.1
166
+ version: 0.52.0
167
167
  - !ruby/object:Gem::Dependency
168
- name: rspec-rails
168
+ name: rubocop-rspec
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 3.1.0
173
+ version: 1.5.1
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 3.1.0
180
+ version: 1.5.1
181
181
  description: Validates XML-like documents for proper formatting
182
182
  email: yegor256@gmail.com
183
183
  executables:
@@ -227,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
227
  requirements:
228
228
  - - ">="
229
229
  - !ruby/object:Gem::Version
230
- version: 1.9.3
230
+ version: '2.2'
231
231
  required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  requirements:
233
233
  - - ">="