pdd 0.18.3 → 0.19
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/.rubocop.yml +1 -1
- data/bin/pdd +5 -1
- data/lib/pdd.rb +1 -1
- data/lib/pdd/source.rb +5 -1
- data/lib/pdd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1301f2639525558a458d49bf60f7b0782ff64411
|
4
|
+
data.tar.gz: 72f951b344e6356b743e5c8b41c5fd3b52ea8be1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 322b941959f93466b62046260c8b34ebdedc71d916b435251a2f3566d798a6197fe066d45bd3c13cd2c18122746504dc86304e1e090ab3ff885aff0e4b2e17c2
|
7
|
+
data.tar.gz: f5e136c6e729887be579b0b2231ee8de5e781323c4d45ebe4a2b1e2aaa5a1b52d7eb508cccfdea99ecc1602e5a8db3fdfd54110cdec459d55416113f553c5f9f
|
data/.rubocop.yml
CHANGED
data/bin/pdd
CHANGED
@@ -26,6 +26,7 @@ require 'nokogiri'
|
|
26
26
|
require 'rainbow'
|
27
27
|
require_relative '../lib/pdd'
|
28
28
|
require_relative '../lib/pdd/version'
|
29
|
+
require_relative '../lib/pdd/source'
|
29
30
|
|
30
31
|
begin
|
31
32
|
args = []
|
@@ -97,12 +98,15 @@ https://github.com/yegor256/pdd/blob/master/README.md"
|
|
97
98
|
rescue SystemExit => ex
|
98
99
|
puts ex.message unless ex.success?
|
99
100
|
exit(ex.status)
|
100
|
-
rescue
|
101
|
+
rescue Source::Error => ex
|
101
102
|
puts "#{Rainbow('ERROR').red}: #{ex.message}"
|
102
103
|
puts "If you can't understand the cause of this issue or you don't know \
|
103
104
|
how to fix it, please submit a GitHub issue, we will try to help you: \
|
104
105
|
https://github.com/yegor256/pdd/issues. This tool is still in its beta \
|
105
106
|
version and we will appreciate your feedback. Here is where you can find \
|
106
107
|
more documentation: https://github.com/yegor256/pdd/blob/master/README.md."
|
108
|
+
exit(1)
|
109
|
+
rescue StandardError => ex
|
110
|
+
puts "#{Rainbow('ERROR').red}: #{ex.message}"
|
107
111
|
exit(-1)
|
108
112
|
end
|
data/lib/pdd.rb
CHANGED
@@ -22,7 +22,6 @@ require 'nokogiri'
|
|
22
22
|
require 'logger'
|
23
23
|
require 'time'
|
24
24
|
require 'rainbow'
|
25
|
-
require_relative 'pdd/sources'
|
26
25
|
require_relative 'pdd/version'
|
27
26
|
require_relative 'pdd/rule/estimates'
|
28
27
|
require_relative 'pdd/rule/text'
|
@@ -86,6 +85,7 @@ module PDD
|
|
86
85
|
def xml
|
87
86
|
dir = @opts[:source] ? @opts[:source] : Dir.pwd
|
88
87
|
PDD.log.info "Reading #{dir}"
|
88
|
+
require_relative 'pdd/sources'
|
89
89
|
sources = Sources.new(dir)
|
90
90
|
unless @opts[:exclude].nil?
|
91
91
|
@opts[:exclude].each do |p|
|
data/lib/pdd/source.rb
CHANGED
@@ -20,11 +20,15 @@
|
|
20
20
|
|
21
21
|
require 'digest/md5'
|
22
22
|
require 'shellwords'
|
23
|
+
require_relative '../pdd'
|
23
24
|
require_relative '../pdd/puzzle'
|
24
25
|
|
25
26
|
module PDD
|
26
27
|
# Source.
|
27
28
|
class Source
|
29
|
+
# If it breaks.
|
30
|
+
class Error < PDD::Error
|
31
|
+
end
|
28
32
|
# Ctor.
|
29
33
|
# +file+:: Absolute file name with source code
|
30
34
|
# +path+:: Path to show (without full file name)
|
@@ -41,7 +45,7 @@ module PDD
|
|
41
45
|
lines.each_with_index do |line, idx|
|
42
46
|
begin
|
43
47
|
/[^\s]@todo/.match(line) do |_|
|
44
|
-
raise Error, 'TODO must have a leading space to become a puzzle,
|
48
|
+
raise Error, 'TODO must have a leading space to become a puzzle, \
|
45
49
|
as this page explains: https://github.com/yegor256/pdd#how-to-format'
|
46
50
|
end
|
47
51
|
/@todo(?!\s+#)/.match(line) do |_|
|
data/lib/pdd/version.rb
CHANGED