pdd 0.17.8 → 0.17.9

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: 02df816acb8146e6b5a44fba2a95e928a8c71ba0
4
- data.tar.gz: 31ef892a1b30d91a04ddda4671224867e68735a9
3
+ metadata.gz: 13b8f74b0fadd780f0b33023410df1b44cc83f8f
4
+ data.tar.gz: 9ec0aa1148ee8bbeee5b75d9fe678dc3269c74b8
5
5
  SHA512:
6
- metadata.gz: 29ab79cb740e1c4ee2a3898633f8b75233566005c0c44924ad3988d90f942488b9bf09e43159dfcc23b3fa60ea38c963c7156fd0e9855858294e469932d5b626
7
- data.tar.gz: 9f6b8d9b04cf7986efefbe5dc746030fb652698598489603c58e5303b9ccb78d5873caa41453a7db29bda8eaf32e8736c8691d3b065cafbfd66190db767a307d
6
+ metadata.gz: 1f9fa206b2bf86935642f2660393049b53be4432804d34b0dfe0b9ab75cbc0421fe61b9ad698cb4113bf43bfea83b85f894161ede93229bd0837a64a68d92607
7
+ data.tar.gz: 93f4bdb7f8f793e66be89d256af0307734d04cf782aad05f9e446866117f4c23407359f68a11d36ca3d0c07d0cae4dd4c72823af1853f7274f1ac2169f32b8b2
@@ -5,13 +5,9 @@ cache: bundler
5
5
  branches:
6
6
  only:
7
7
  - master
8
- addons:
9
- apt:
10
- packages:
11
- - libmagic1
12
- - libmagic-dev
13
8
  install:
14
9
  - travis_retry bundle update
15
10
  script:
16
11
  - rake
17
-
12
+ after_success:
13
+ - "bash <(curl -s https://codecov.io/bash)"
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  <img src="https://avatars2.githubusercontent.com/u/24456188" width="64px" height="64px"/>
2
2
 
3
3
  [![Made By Teamed.io](http://img.teamed.io/btn.svg)](http://www.teamed.io)
4
- [![DevOps By Rultor.com](http://www.rultor.com/b/teamed/pdd)](http://www.rultor.com/p/teamed/pdd)
4
+ [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/pdd)](http://www.rultor.com/p/yegor256/pdd)
5
5
  [![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
- [![Build Status](https://travis-ci.org/teamed/pdd.svg)](https://travis-ci.org/teamed/pdd)
8
- [![Build status](https://ci.appveyor.com/api/projects/status/pojnoa1bp7t2ecbr?svg=true)](https://ci.appveyor.com/project/yegor256/pdd)
7
+ [![Build Status](https://travis-ci.org/yegor256/pdd.svg)](https://travis-ci.org/yegor256/pdd)
8
+ [![Build status](https://ci.appveyor.com/api/projects/status/b59sdhuu0gcku15b?svg=true)](https://ci.appveyor.com/project/yegor256/pdd)
9
9
  [![PDD status](http://www.0pdd.com/svg?name=yegor256/pdd)](http://www.0pdd.com/p?name=yegor256/pdd)
10
10
  [![Gem Version](https://badge.fury.io/rb/pdd.svg)](http://badge.fury.io/rb/pdd)
11
- [![Dependency Status](https://gemnasium.com/teamed/pdd.svg)](https://gemnasium.com/teamed/pdd)
12
- [![Code Climate](http://img.shields.io/codeclimate/github/teamed/pdd.svg)](https://codeclimate.com/github/teamed/pdd)
13
- [![Coverage Status](https://img.shields.io/coveralls/teamed/pdd.svg)](https://coveralls.io/r/teamed/pdd)
11
+ [![Dependency Status](https://gemnasium.com/yegor256/pdd.svg)](https://gemnasium.com/yegor256/pdd)
12
+ [![Code Climate](http://img.shields.io/codeclimate/github/yegor256/pdd.svg)](https://codeclimate.com/github/yegor256/pdd)
13
+ [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/pdd.svg)](https://codecov.io/github/yegor256/pdd?branch=master)
14
14
 
15
15
  ## What This is for?
16
16
 
@@ -54,9 +54,12 @@ to the leading space in every consecutive line):
54
54
  ```java
55
55
  /**
56
56
  * @todo #234:15m/DEV This is something to do later
57
- * in one of the next releases. I can't figure out how
57
+ * in one of the next releases. I can't figure out
58
58
  * how to implement it now, that's why the puzzle.
59
59
  */
60
+ void sendEmail() {
61
+ throw new UnsupportedOperationException();
62
+ }
60
63
  ```
61
64
 
62
65
  It starts with `@todo`, followed by a space and a puzzle marker.
@@ -101,3 +104,4 @@ Here is a list of rules available now:
101
104
 
102
105
  You can put all command line options into `.pdd` file. The options from the
103
106
  file will be used first. Command line options may be added on top of them.
107
+ See, how it is done in [yegor256/0pdd](https://github.com/yegor256/0pdd/blob/master/.pdd).
@@ -8,7 +8,7 @@ branches:
8
8
  - gh-pages
9
9
  os: Windows Server 2012
10
10
  install:
11
- - cmd: SET PATH=C:\Ruby200\bin;%PATH%
11
+ - cmd: SET PATH=C:\Ruby23-x64\bin;%PATH%
12
12
  - cmd: ruby --version
13
13
  - cmd: git --version
14
14
  build_script:
@@ -39,3 +39,12 @@ Feature: Applies Post-Parsing Rules
39
39
  When I run bin/pdd with "--rule=available-roles:DEV,IMP"
40
40
  Then Exit code is not zero
41
41
  Then Stdout contains "defines role TEST"
42
+
43
+ Scenario: Throwing exception on touching max-duplicates rule
44
+ Given I have a "Sample.java" file with content:
45
+ """
46
+ @todo #334:15m This is the puzzle
47
+ @todo #35:30m This is the puzzle
48
+ """
49
+ When I run bin/pdd with "--rule=max-duplicates:3"
50
+ Then Exit code is not zero
data/lib/pdd.rb CHANGED
@@ -31,7 +31,7 @@ require_relative 'pdd/rule/duplicates'
31
31
  require_relative 'pdd/rule/roles'
32
32
 
33
33
  # PDD main module.
34
- # Author:: Yegor Bugayenko (yegor@teamed.io)
34
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
35
35
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
36
36
  # License:: MIT
37
37
  module PDD
@@ -138,7 +138,11 @@ module PDD
138
138
  def rules(xml)
139
139
  doc = Nokogiri::XML(xml)
140
140
  total = 0
141
- (@opts[:rule] || []).push('max-duplicates:1').map do |r|
141
+ list = @opts[:rule] || []
142
+ unless list.select { |r| r.start_with?('max-duplicates:') }.empty?
143
+ raise PDD::Error, 'You can\'t modify max-duplicates, it\'s always 1'
144
+ end
145
+ list.push('max-duplicates:1').map do |r|
142
146
  name, value = r.split(':')
143
147
  rule = RULES[name]
144
148
  raise "rule '#{name}' doesn't exist" if rule.nil?
@@ -63,6 +63,7 @@ module PDD
63
63
  private
64
64
 
65
65
  def binary?(f)
66
+ return false if Gem.win_platform?
66
67
  `grep -qI '.' #{Shellwords.escape(f)}`
67
68
  if $CHILD_STATUS.success?
68
69
  false
@@ -21,9 +21,9 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  # PDD main module.
24
- # Author:: Yegor Bugayenko (yegor@teamed.io)
24
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
25
25
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module PDD
28
- VERSION = '0.17.8'.freeze
28
+ VERSION = '0.17.9'.freeze
29
29
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
37
37
  s.summary = 'Puzzle Driven Development collector'
38
38
  s.description = 'Collects PDD puzzles from source code base'
39
39
  s.authors = ['Yegor Bugayenko']
40
- s.email = 'yegor@teamed.io'
40
+ s.email = 'yegor256@gmail.com'
41
41
  s.homepage = 'http://github.com/yegor256/pdd'
42
42
  s.files = `git ls-files`.split($RS)
43
43
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.add_runtime_dependency 'nokogiri', '~>1.7.2'
48
48
  s.add_runtime_dependency 'slop', '~>4.4.1'
49
49
  s.add_development_dependency 'rake', '12.0.0'
50
- s.add_development_dependency 'coveralls', '0.7.2'
50
+ s.add_development_dependency 'codecov', '0.1.10'
51
51
  s.add_development_dependency 'rdoc', '4.2.0'
52
52
  s.add_development_dependency 'cucumber', '1.3.17'
53
53
  s.add_development_dependency 'minitest', '5.5.0'
@@ -23,5 +23,11 @@
23
23
  STDOUT.sync = true
24
24
 
25
25
  require 'simplecov'
26
+ SimpleCov.start
27
+ if ENV['CI'] == 'true'
28
+ require 'codecov'
29
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
30
+ end
31
+
26
32
  require 'minitest/autorun'
27
33
  require_relative '../lib/pdd'
@@ -25,7 +25,7 @@ require 'nokogiri'
25
25
  require_relative '../lib/pdd/rule/duplicates'
26
26
 
27
27
  # PDD::Rule::MaxDuplicates class test.
28
- # Author:: Yegor Bugayenko (yegor@teamed.io)
28
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
29
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestMaxDuplicates < Minitest::Test
@@ -25,7 +25,7 @@ require 'nokogiri'
25
25
  require_relative '../lib/pdd/rule/estimates'
26
26
 
27
27
  # PDD::Rule::Estimate module tests.
28
- # Author:: Yegor Bugayenko (yegor@teamed.io)
28
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
29
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestEstimates < Minitest::Test
@@ -27,7 +27,7 @@ require 'slop'
27
27
  require_relative '../lib/pdd'
28
28
 
29
29
  # PDD main module test.
30
- # Author:: Yegor Bugayenko (yegor@teamed.io)
30
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
31
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
32
32
  # License:: MIT
33
33
  class TestPDD < Minitest::Test
@@ -25,7 +25,7 @@ require 'nokogiri'
25
25
  require_relative '../lib/pdd/rule/roles'
26
26
 
27
27
  # PDD::Rule::Role module tests.
28
- # Author:: Yegor Bugayenko (yegor@teamed.io)
28
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
29
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestRoles < Minitest::Test
@@ -25,7 +25,7 @@ require 'tmpdir'
25
25
  require_relative '../lib/pdd/sources'
26
26
 
27
27
  # Source test.
28
- # Author:: Yegor Bugayenko (yegor@teamed.io)
28
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
29
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestSource < Minitest::Test
@@ -27,7 +27,7 @@ require_relative '../test/test__helper'
27
27
  require_relative '../lib/pdd/sources'
28
28
 
29
29
  # Sources test.
30
- # Author:: Yegor Bugayenko (yegor@teamed.io)
30
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
31
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
32
32
  # License:: MIT
33
33
  class TestSources < Minitest::Test
@@ -39,6 +39,7 @@ class TestSources < Minitest::Test
39
39
  end
40
40
 
41
41
  def test_ignores_binary_files
42
+ skip if Gem.win_platform?
42
43
  in_temp([]) do |dir|
43
44
  [
44
45
  'README.md',
@@ -61,7 +62,10 @@ class TestSources < Minitest::Test
61
62
  File.write(File.join(dir, "test.#{ext}"), 'text')
62
63
  end
63
64
  list = PDD::Sources.new(dir).fetch
64
- assert_equal exts.size, list.size
65
+ assert_equal(
66
+ exts.size, list.size,
67
+ "Files found: #{list}"
68
+ )
65
69
  end
66
70
  end
67
71
 
@@ -25,7 +25,7 @@ require 'nokogiri'
25
25
  require_relative '../lib/pdd/rule/text'
26
26
 
27
27
  # PDD::Rule::Text module tests.
28
- # Author:: Yegor Bugayenko (yegor@teamed.io)
28
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
29
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
30
30
  # License:: MIT
31
31
  class TestText < Minitest::Test
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.8
4
+ version: 0.17.9
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-05-29 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 12.0.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: codecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.7.2
61
+ version: 0.1.10
62
62
  type: :development
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: 0.7.2
68
+ version: 0.1.10
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: 3.1.0
153
153
  description: Collects PDD puzzles from source code base
154
- email: yegor@teamed.io
154
+ email: yegor256@gmail.com
155
155
  executables:
156
156
  - pdd
157
157
  extensions: []