pdd 0.14.4 → 0.15

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.
data/.rubocop.yml CHANGED
@@ -1,2 +1,4 @@
1
1
  MethodLength:
2
2
  Max: 30
3
+ Style/ClassLength:
4
+ Max: 150
data/lib/pdd/source.rb CHANGED
@@ -49,7 +49,10 @@ module PDD
49
49
  rescue ArgumentError => ex
50
50
  raise Error, ["in line ##{idx}", ex]
51
51
  end
52
- /(.*(?:^|\s))@todo\s+#([\w\-\.:\/]+)/
52
+ end
53
+ lines.each_with_index do |line, idx|
54
+ fail Error, "Suspicious TODO in line ##{idx}" \
55
+ if /.*(^|\s)@todo\s+[^#]/.match(line)
53
56
  end
54
57
  puzzles
55
58
  end
data/lib/pdd/version.rb CHANGED
@@ -26,5 +26,5 @@
26
26
  # Copyright:: Copyright (c) 2014 Yegor Bugayenko
27
27
  # License:: MIT
28
28
  module PDD
29
- VERSION = '0.14.4'
29
+ VERSION = '0.15'
30
30
  end
data/test/test_source.rb CHANGED
@@ -70,6 +70,22 @@ class TestSources < Minitest::Test
70
70
  end
71
71
  end
72
72
 
73
+ def test_failing_on_incomplete_puzzle
74
+ Dir.mktmpdir 't5' do |dir|
75
+ file = File.join(dir, 'ff.txt')
76
+ File.write(
77
+ file,
78
+ '
79
+ * @todo this puzzle misses ticket name/number
80
+ '
81
+ )
82
+ error = assert_raises PDD::Error do
83
+ PDD::VerboseSource.new(file, PDD::Source.new(file, 'ff')).puzzles
84
+ end
85
+ assert !error.to_s.index('Suspicious TODO').nil?
86
+ end
87
+ end
88
+
73
89
  def test_failing_on_broken_unicode
74
90
  Dir.mktmpdir 'test' do |dir|
75
91
  file = File.join(dir, 'xx.txt')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: '0.15'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-07 00:00:00.000000000 Z
12
+ date: 2015-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri