descendants_tracker 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +21 -12
- data/Gemfile +3 -52
- data/Gemfile.devtools +55 -0
- data/LICENSE +2 -1
- data/README.md +22 -29
- data/Rakefile +2 -6
- data/config/devtools.yml +4 -0
- data/config/flay.yml +2 -2
- data/config/flog.yml +1 -1
- data/config/mutant.yml +3 -0
- data/config/{site.reek → reek.yml} +19 -13
- data/config/rubocop.yml +58 -0
- data/descendants_tracker.gemspec +6 -5
- data/lib/descendants_tracker.rb +27 -5
- data/lib/descendants_tracker/version.rb +7 -2
- data/spec/spec_helper.rb +23 -4
- data/spec/support/config_alias.rb +2 -0
- data/spec/unit/descendants_tracker/add_descendant_spec.rb +11 -9
- data/spec/unit/descendants_tracker/descendants_spec.rb +4 -2
- data/spec/unit/descendants_tracker/inherited_spec.rb +26 -0
- metadata +69 -87
- data/config/roodi.yml +0 -18
- data/spec/shared/command_method_behavior.rb +0 -7
- data/spec/shared/each_method_behaviour.rb +0 -15
- data/spec/shared/hash_method_behavior.rb +0 -17
- data/spec/shared/idempotent_method_behavior.rb +0 -7
- data/spec/shared/invertible_method_behaviour.rb +0 -9
- data/tasks/metrics/ci.rake +0 -9
- data/tasks/metrics/flay.rake +0 -45
- data/tasks/metrics/flog.rake +0 -49
- data/tasks/metrics/heckle.rake +0 -208
- data/tasks/metrics/metric_fu.rake +0 -31
- data/tasks/metrics/reek.rake +0 -21
- data/tasks/metrics/roodi.rake +0 -19
- data/tasks/metrics/yardstick.rake +0 -25
- data/tasks/spec.rake +0 -60
- data/tasks/yard.rake +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c0d7c3822fbb26630c771fe6b40bf0795d36a754
|
4
|
+
data.tar.gz: 938e57fbfbb1ae08d0e08235aa79ea1bd35ea3a7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: af161238456ac76639e62899d58d3ba35a3f363cb0c8b3b846783bb0cd3f3d055c5a002bda131785ae2da3747ea904e1baf85d46a1b53cacf84f30c664a5023d
|
7
|
+
data.tar.gz: 390c5209b5de810a5ac8a4b9df0c70c38db7cea3da624ececcf5e6affd2163a253ea6c468927bee72362d8350d50393a1cf8935aa35ca260dda444d5d5ccefc0
|
data/.travis.yml
CHANGED
@@ -1,19 +1,28 @@
|
|
1
1
|
language: ruby
|
2
2
|
before_install: gem install bundler
|
3
|
-
bundler_args: --without yard guard
|
4
|
-
script: "bundle exec rake
|
3
|
+
bundler_args: --without yard guard benchmarks
|
4
|
+
script: "bundle exec rake ci"
|
5
5
|
rvm:
|
6
|
-
- 1.8.7
|
7
|
-
- 1.9.2
|
8
6
|
- 1.9.3
|
9
|
-
-
|
10
|
-
- jruby-19mode
|
11
|
-
- rbx-18mode
|
12
|
-
- rbx-19mode
|
13
|
-
- ree
|
7
|
+
- 2.0.0
|
14
8
|
- ruby-head
|
15
|
-
-
|
9
|
+
- rbx-19mode
|
16
10
|
notifications:
|
11
|
+
irc:
|
12
|
+
channels:
|
13
|
+
- irc.freenode.org#rom-rb
|
14
|
+
on_success: never
|
15
|
+
on_failure: change
|
17
16
|
email:
|
18
|
-
|
19
|
-
|
17
|
+
recipients:
|
18
|
+
- dan.kubb@gmail.com
|
19
|
+
on_success: never
|
20
|
+
on_failure: change
|
21
|
+
matrix:
|
22
|
+
include:
|
23
|
+
- rvm: jruby-19mode
|
24
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
25
|
+
- rvm: jruby-head
|
26
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
27
|
+
allow_failures:
|
28
|
+
- rvm: ruby-head
|
data/Gemfile
CHANGED
@@ -4,56 +4,7 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
|
8
|
-
gem 'yard', '~> 0.8.3'
|
9
|
-
gem 'redcarpet', '~> 2.2.2', :platforms => [ :mri, :rbx ]
|
10
|
-
end
|
7
|
+
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
gem 'guard-bundler', '~> 1.0.0'
|
15
|
-
gem 'guard-rspec', '~> 1.2.1'
|
16
|
-
end
|
17
|
-
|
18
|
-
group :benchmarks do
|
19
|
-
gem 'rbench', '~> 0.2.3'
|
20
|
-
end
|
21
|
-
|
22
|
-
platform :jruby do
|
23
|
-
group :jruby do
|
24
|
-
gem 'jruby-openssl', '~> 0.7.4'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
group :metrics do
|
29
|
-
gem 'flay', '~> 1.4.3'
|
30
|
-
gem 'flog', '~> 2.5.3'
|
31
|
-
gem 'reek', '~> 1.2.8', :github => 'dkubb/reek'
|
32
|
-
gem 'roodi', '~> 2.1.0'
|
33
|
-
gem 'yardstick', '~> 0.8.0'
|
34
|
-
|
35
|
-
platforms :ruby_18, :ruby_19 do
|
36
|
-
# this indirectly depends on ffi which does not build on ruby-head
|
37
|
-
gem 'yard-spellcheck', '~> 0.1.5'
|
38
|
-
end
|
39
|
-
|
40
|
-
platforms :mri_18 do
|
41
|
-
gem 'arrayfields', '~> 4.7.4' # for metric_fu
|
42
|
-
gem 'fattr', '~> 2.2.0' # for metric_fu
|
43
|
-
gem 'heckle', '~> 1.4.3'
|
44
|
-
gem 'json', '~> 1.7.3' # for metric_fu rake task
|
45
|
-
gem 'map', '~> 6.2.0' # for metric_fu
|
46
|
-
gem 'metric_fu', '~> 2.1.1'
|
47
|
-
gem 'mspec', '~> 1.5.17'
|
48
|
-
gem 'rcov', '~> 1.0.0'
|
49
|
-
gem 'ruby2ruby', '= 1.2.2' # for heckle
|
50
|
-
end
|
51
|
-
|
52
|
-
platforms :ruby_19 do
|
53
|
-
gem 'simplecov', '~> 0.7.1'
|
54
|
-
end
|
55
|
-
|
56
|
-
platforms :rbx do
|
57
|
-
gem 'pelusa', '~> 0.2.1'
|
58
|
-
end
|
59
|
-
end
|
9
|
+
# Added by devtools
|
10
|
+
eval_gemfile 'Gemfile.devtools'
|
data/Gemfile.devtools
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rake', '~> 10.1.0'
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
6
|
+
gem 'yard', '~> 0.8.7'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :yard do
|
10
|
+
gem 'kramdown', '~> 1.2.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :guard do
|
14
|
+
gem 'guard', '~> 1.8.1'
|
15
|
+
gem 'guard-bundler', '~> 1.0.0'
|
16
|
+
gem 'guard-rspec', '~> 3.0.2'
|
17
|
+
gem 'guard-rubocop', '~> 0.2.0'
|
18
|
+
gem 'guard-mutant', '~> 0.0.1'
|
19
|
+
|
20
|
+
# file system change event handling
|
21
|
+
gem 'listen', '~> 1.3.0'
|
22
|
+
gem 'rb-fchange', '~> 0.0.6', require: false
|
23
|
+
gem 'rb-fsevent', '~> 0.9.3', require: false
|
24
|
+
gem 'rb-inotify', '~> 0.9.0', require: false
|
25
|
+
|
26
|
+
# notification handling
|
27
|
+
gem 'libnotify', '~> 0.8.0', require: false
|
28
|
+
gem 'rb-notifu', '~> 0.0.4', require: false
|
29
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
30
|
+
end
|
31
|
+
|
32
|
+
group :metrics do
|
33
|
+
gem 'coveralls', '~> 0.6.7'
|
34
|
+
gem 'flay', '~> 2.4.0'
|
35
|
+
gem 'flog', '~> 4.1.1'
|
36
|
+
gem 'reek', '~> 1.3.2'
|
37
|
+
gem 'rubocop', '~> 0.13.0'
|
38
|
+
gem 'simplecov', '~> 0.7.1'
|
39
|
+
gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
|
40
|
+
|
41
|
+
platforms :ruby_19, :ruby_20 do
|
42
|
+
gem 'mutant', git: 'https://github.com/mbj/mutant.git'
|
43
|
+
gem 'yard-spellcheck', '~> 0.1.5'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
group :benchmarks do
|
48
|
+
gem 'rbench', '~> 0.2.3'
|
49
|
+
end
|
50
|
+
|
51
|
+
platform :jruby do
|
52
|
+
group :jruby do
|
53
|
+
gem 'jruby-openssl', '~> 0.8.5'
|
54
|
+
end
|
55
|
+
end
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
descendants_tracker
|
2
2
|
===================
|
3
3
|
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/descendants_tracker.png)][gem]
|
5
|
+
[![Build Status](https://secure.travis-ci.org/dkubb/descendants_tracker.png?branch=master)][travis]
|
6
|
+
[![Dependency Status](https://gemnasium.com/dkubb/descendants_tracker.png)][gemnasium]
|
7
|
+
[![Code Climate](https://codeclimate.com/github/dkubb/descendants_tracker.png)][codeclimate]
|
8
|
+
[![Coverage Status](https://coveralls.io/repos/dkubb/descendants_tracker/badge.png?branch=master)][coveralls]
|
9
|
+
|
10
|
+
[gem]: https://rubygems.org/gems/descendants_tracker
|
11
|
+
[travis]: https://travis-ci.org/dkubb/descendants_tracker
|
12
|
+
[gemnasium]: https://gemnasium.com/dkubb/descendants_tracker
|
13
|
+
[codeclimate]: https://codeclimate.com/github/dkubb/descendants_tracker
|
14
|
+
[coveralls]: https://coveralls.io/r/dkubb/descendants_tracker
|
7
15
|
|
8
16
|
Small module to track descendants in an unobtrusive way.
|
9
17
|
|
@@ -35,7 +43,7 @@ Examples
|
|
35
43
|
|
36
44
|
``` ruby
|
37
45
|
class Foo
|
38
|
-
extend
|
46
|
+
extend DescendantsTracker
|
39
47
|
end
|
40
48
|
|
41
49
|
class Bar < Foo
|
@@ -52,37 +60,22 @@ Credits
|
|
52
60
|
* Markus Schirp ([mbj](https://github.com/mbj))
|
53
61
|
|
54
62
|
Contributing
|
55
|
-
|
63
|
+
------------
|
56
64
|
|
57
65
|
* If you want your code merged into the mainline, please discuss the proposed changes with me before doing any work on it. This library is still in early development, and the direction it is going may not always be clear. Some features may not be appropriate yet, may need to be deferred until later when the foundation for them is laid, or may be more applicable in a plugin.
|
58
66
|
* Fork the project.
|
59
67
|
* Make your feature addition or bug fix.
|
60
|
-
* Follow this [style guide](https://github.com/dkubb/styleguide).
|
68
|
+
* Follow this [style guide](https://github.com/dkubb/styleguide).
|
61
69
|
* Add specs for it. This is important so I don't break it in a future version unintentionally. Tests must cover all branches within the code, and code must be fully covered.
|
62
70
|
* Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
63
71
|
* Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
|
64
|
-
* Send me a pull request. Bonus points for topic
|
72
|
+
* Send me a pull request. Bonus points for topic branches.
|
65
73
|
|
66
|
-
|
67
|
-
|
74
|
+
Copyright
|
75
|
+
---------
|
76
|
+
|
77
|
+
Copyright © 2012-2013 Dan Kubb (author)
|
78
|
+
Copyright © 2011-2012 Piotr Solnica (source maintainer)
|
79
|
+
Copyright © 2012 Markus Schirp (packaging)
|
68
80
|
|
69
|
-
|
70
|
-
|
71
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
72
|
-
a copy of this software and associated documentation files (the
|
73
|
-
"Software"), to deal in the Software without restriction, including
|
74
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
75
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
76
|
-
permit persons to whom the Software is furnished to do so, subject to
|
77
|
-
the following conditions:
|
78
|
-
|
79
|
-
The above copyright notice and this permission notice shall be
|
80
|
-
included in all copies or substantial portions of the Software.
|
81
|
-
|
82
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
83
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
84
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
85
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
86
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
87
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
88
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
81
|
+
See LICENSE for details.
|
data/Rakefile
CHANGED
data/config/devtools.yml
ADDED
data/config/flay.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
3
|
-
total_score:
|
2
|
+
threshold: 4
|
3
|
+
total_score: 6
|
data/config/flog.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
2
|
+
threshold: 5.5
|
data/config/mutant.yml
ADDED
@@ -1,4 +1,7 @@
|
|
1
1
|
---
|
2
|
+
UnusedParameters:
|
3
|
+
enabled: true
|
4
|
+
exclude: []
|
2
5
|
UncommunicativeParameterName:
|
3
6
|
accept: []
|
4
7
|
exclude: []
|
@@ -8,10 +11,10 @@ UncommunicativeParameterName:
|
|
8
11
|
- !ruby/regexp /[0-9]$/
|
9
12
|
- !ruby/regexp /[A-Z]/
|
10
13
|
LargeClass:
|
11
|
-
max_methods:
|
14
|
+
max_methods: 0
|
12
15
|
exclude: []
|
13
16
|
enabled: true
|
14
|
-
max_instance_variables:
|
17
|
+
max_instance_variables: 0
|
15
18
|
UncommunicativeMethodName:
|
16
19
|
accept: []
|
17
20
|
exclude: []
|
@@ -21,7 +24,7 @@ UncommunicativeMethodName:
|
|
21
24
|
- !ruby/regexp /[0-9]$/
|
22
25
|
- !ruby/regexp /[A-Z]/
|
23
26
|
LongParameterList:
|
24
|
-
max_params:
|
27
|
+
max_params: 1
|
25
28
|
exclude: []
|
26
29
|
enabled: true
|
27
30
|
overrides: {}
|
@@ -48,23 +51,23 @@ NestedIterators:
|
|
48
51
|
ignore_iterators: []
|
49
52
|
exclude: []
|
50
53
|
enabled: true
|
51
|
-
max_allowed_nesting:
|
54
|
+
max_allowed_nesting: 0
|
52
55
|
LongMethod:
|
53
|
-
max_statements:
|
54
|
-
exclude:
|
55
|
-
|
56
|
+
max_statements: 2
|
57
|
+
exclude:
|
58
|
+
- DescendantsTracker#add_descendant
|
56
59
|
Duplication:
|
57
60
|
allow_calls: []
|
58
61
|
exclude: []
|
59
62
|
enabled: true
|
60
63
|
max_calls: 1
|
61
64
|
UtilityFunction:
|
62
|
-
max_helper_calls:
|
65
|
+
max_helper_calls: 0
|
63
66
|
exclude: []
|
64
67
|
enabled: true
|
65
68
|
Attribute:
|
66
69
|
exclude: []
|
67
|
-
enabled:
|
70
|
+
enabled: true
|
68
71
|
UncommunicativeVariableName:
|
69
72
|
accept: []
|
70
73
|
exclude: []
|
@@ -76,16 +79,19 @@ UncommunicativeVariableName:
|
|
76
79
|
SimulatedPolymorphism:
|
77
80
|
exclude: []
|
78
81
|
enabled: true
|
79
|
-
max_ifs:
|
82
|
+
max_ifs: 0
|
80
83
|
DataClump:
|
81
84
|
exclude: []
|
82
85
|
enabled: true
|
83
|
-
max_copies:
|
84
|
-
min_clump_size:
|
86
|
+
max_copies: 0
|
87
|
+
min_clump_size: 2
|
85
88
|
ControlCouple:
|
86
89
|
exclude: []
|
87
90
|
enabled: true
|
88
91
|
LongYieldList:
|
89
|
-
max_params:
|
92
|
+
max_params: 0
|
90
93
|
exclude: []
|
91
94
|
enabled: true
|
95
|
+
NilCheck:
|
96
|
+
enabled: true
|
97
|
+
exclude: []
|
data/config/rubocop.yml
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
AllCops:
|
2
|
+
Includes:
|
3
|
+
- '**/*.rake'
|
4
|
+
- 'Gemfile'
|
5
|
+
- 'Gemfile.devtools'
|
6
|
+
Excludes:
|
7
|
+
- '**/vendor/**'
|
8
|
+
- '**/benchmarks/**'
|
9
|
+
|
10
|
+
# Avoid parameter lists longer than five parameters.
|
11
|
+
ParameterLists:
|
12
|
+
Max: 3
|
13
|
+
CountKeywordArgs: true
|
14
|
+
|
15
|
+
# Avoid more than `Max` levels of nesting.
|
16
|
+
BlockNesting:
|
17
|
+
Max: 3
|
18
|
+
|
19
|
+
# Align with the style guide.
|
20
|
+
CollectionMethods:
|
21
|
+
PreferredMethods:
|
22
|
+
collect: 'map'
|
23
|
+
inject: 'reduce'
|
24
|
+
find: 'detect'
|
25
|
+
find_all: 'select'
|
26
|
+
|
27
|
+
# Do not force public/protected/private keyword to be indented at the same
|
28
|
+
# level as the def keyword. My personal preference is to outdent these keywords
|
29
|
+
# because I think when scanning code it makes it easier to identify the
|
30
|
+
# sections of code and visually separate them. When the keyword is at the same
|
31
|
+
# level I think it sort of blends in with the def keywords and makes it harder
|
32
|
+
# to scan the code and see where the sections are.
|
33
|
+
AccessControl:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
# Limit line length
|
37
|
+
LineLength:
|
38
|
+
Max: 79
|
39
|
+
|
40
|
+
# Disable documentation checking until a class needs to be documented once
|
41
|
+
Documentation:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
# Do not favor modifier if/unless usage when you have a single-line body
|
45
|
+
IfUnlessModifier:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# Allow case equality operator (in limited use within the specs)
|
49
|
+
CaseEquality:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
# Constants do not always have to use SCREAMING_SNAKE_CASE
|
53
|
+
ConstantName:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
# Not all trivial readers/writers can be defined with attr_* methods
|
57
|
+
TrivialAccessors:
|
58
|
+
Enabled: false
|
data/descendants_tracker.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
|
3
3
|
require File.expand_path('../lib/descendants_tracker/version', __FILE__)
|
4
4
|
|
@@ -6,16 +6,17 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.name = 'descendants_tracker'
|
7
7
|
gem.version = DescendantsTracker::VERSION.dup
|
8
8
|
gem.authors = [ 'Dan Kubb', 'Piotr Solnica', 'Markus Schirp' ]
|
9
|
-
gem.email = %w[ dan.kubb@gmail.com piotr.solnica@gmail.com mbj@
|
9
|
+
gem.email = %w[ dan.kubb@gmail.com piotr.solnica@gmail.com mbj@schirp-dso.com ]
|
10
10
|
gem.description = 'Module that adds descendant tracking to a class'
|
11
11
|
gem.summary = gem.description
|
12
12
|
gem.homepage = 'https://github.com/dkubb/descendants_tracker'
|
13
13
|
|
14
14
|
gem.require_paths = %w[lib]
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
|
-
gem.test_files = `git ls-files --
|
16
|
+
gem.test_files = `git ls-files -- spec/unit`.split($/)
|
17
17
|
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
|
18
18
|
|
19
|
-
gem.add_development_dependency('rake', '~> 10.0
|
20
|
-
gem.add_development_dependency('rspec', '~>
|
19
|
+
gem.add_development_dependency('rake', '~> 10.1.0')
|
20
|
+
gem.add_development_dependency('rspec', '~> 2.13.0')
|
21
|
+
gem.add_development_dependency('yard', '~> 0.8.6.1')
|
21
22
|
end
|