descendants_tracker 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +5 -0
- data/.ruby-gemset +1 -0
- data/.travis.yml +17 -15
- data/CONTRIBUTING.md +10 -0
- data/Gemfile +3 -2
- data/Gemfile.devtools +36 -20
- data/README.md +6 -41
- data/config/flay.yml +2 -2
- data/config/reek.yml +64 -55
- data/config/rubocop.yml +5 -1
- data/descendants_tracker.gemspec +5 -4
- data/lib/descendants_tracker.rb +19 -17
- data/lib/descendants_tracker/version.rb +1 -1
- data/spec/spec_helper.rb +10 -10
- data/spec/unit/descendants_tracker/inherited_spec.rb +2 -2
- metadata +27 -25
- data/.rvmrc +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c74464d200e35dda22a63eaf72795285f109b8fd
|
4
|
+
data.tar.gz: 755e09b06bf6717c22e434efd893ed692127211b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe1cec3ee6cfcbc631fbc94b1a8a2097f530cccfb54d1ebea2197b9c879c1944d4daba19b84bba95fdd8e03f08a6d72ea83bf72c1f5aef962986ea541010487
|
7
|
+
data.tar.gz: d1d4fab6614f0e2c99cd29efb725faada0ff53aed1c2144ae26291bdfbb39ed966c3ee342575b76ea27780357cbe3d470118ad66e32c9f5049626af45f866b5e
|
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
descendants_tracker
|
data/.travis.yml
CHANGED
@@ -1,28 +1,30 @@
|
|
1
1
|
language: ruby
|
2
2
|
before_install: gem install bundler
|
3
3
|
bundler_args: --without yard guard benchmarks
|
4
|
-
script: "bundle exec rake ci"
|
4
|
+
script: "bundle exec rake ci:metrics"
|
5
5
|
rvm:
|
6
6
|
- 1.9.3
|
7
7
|
- 2.0.0
|
8
|
+
- 2.1.0
|
9
|
+
- 2.1.1
|
8
10
|
- ruby-head
|
9
|
-
- rbx-
|
11
|
+
- rbx-2
|
12
|
+
matrix:
|
13
|
+
include:
|
14
|
+
- rvm: jruby-19mode
|
15
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
|
16
|
+
- rvm: jruby-20mode
|
17
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
|
18
|
+
- rvm: jruby-21mode
|
19
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
|
20
|
+
- rvm: jruby-head
|
21
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
|
22
|
+
allow_failures:
|
23
|
+
- rvm: 2.1.0 # buggy runtime
|
24
|
+
fast_finish: true
|
10
25
|
notifications:
|
11
26
|
irc:
|
12
27
|
channels:
|
13
28
|
- irc.freenode.org#rom-rb
|
14
29
|
on_success: never
|
15
30
|
on_failure: change
|
16
|
-
email:
|
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/CONTRIBUTING.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
* 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.
|
4
|
+
* Fork the project.
|
5
|
+
* Make your feature addition or bug fix.
|
6
|
+
* Follow this [style guide](https://github.com/dkubb/styleguide).
|
7
|
+
* 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.
|
8
|
+
* 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)
|
9
|
+
* Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
|
10
|
+
* Send me a pull request. Bonus points for topic branches.
|
data/Gemfile
CHANGED
@@ -4,7 +4,8 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
|
7
|
+
group :development, :test do
|
8
|
+
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
9
|
+
end
|
8
10
|
|
9
|
-
# Added by devtools
|
10
11
|
eval_gemfile 'Gemfile.devtools'
|
data/Gemfile.devtools
CHANGED
@@ -1,47 +1,63 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem 'rake',
|
5
|
-
gem 'rspec',
|
6
|
-
gem '
|
4
|
+
gem 'rake', '~> 10.2.1'
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
6
|
+
gem 'rspec-core', '~> 2.14.8'
|
7
|
+
gem 'yard', '~> 0.8.7.4'
|
8
|
+
|
9
|
+
platform :rbx do
|
10
|
+
gem 'rubysl-singleton', '~> 2.0.0'
|
11
|
+
end
|
7
12
|
end
|
8
13
|
|
9
14
|
group :yard do
|
10
|
-
gem 'kramdown', '~> 1.
|
15
|
+
gem 'kramdown', '~> 1.3.3'
|
11
16
|
end
|
12
17
|
|
13
18
|
group :guard do
|
14
|
-
gem 'guard', '~>
|
15
|
-
gem 'guard-bundler', '~>
|
16
|
-
gem 'guard-rspec', '~>
|
17
|
-
gem 'guard-rubocop', '~> 0.2
|
18
|
-
gem 'guard-mutant', '~> 0.0.1'
|
19
|
+
gem 'guard', '~> 2.6.0'
|
20
|
+
gem 'guard-bundler', '~> 2.0.0'
|
21
|
+
gem 'guard-rspec', '~> 4.2.8'
|
22
|
+
gem 'guard-rubocop', '~> 1.0.2'
|
19
23
|
|
20
24
|
# file system change event handling
|
21
|
-
gem 'listen', '~>
|
25
|
+
gem 'listen', '~> 2.7.1'
|
22
26
|
gem 'rb-fchange', '~> 0.0.6', require: false
|
23
|
-
gem 'rb-fsevent', '~> 0.9.
|
24
|
-
gem 'rb-inotify', '~> 0.9.
|
27
|
+
gem 'rb-fsevent', '~> 0.9.4', require: false
|
28
|
+
gem 'rb-inotify', '~> 0.9.3', require: false
|
25
29
|
|
26
30
|
# notification handling
|
27
|
-
gem 'libnotify', '~> 0.8.
|
31
|
+
gem 'libnotify', '~> 0.8.2', require: false
|
28
32
|
gem 'rb-notifu', '~> 0.0.4', require: false
|
29
33
|
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
30
34
|
end
|
31
35
|
|
32
36
|
group :metrics do
|
33
|
-
gem 'coveralls', '~> 0.
|
37
|
+
gem 'coveralls', '~> 0.7.0'
|
34
38
|
gem 'flay', '~> 2.4.0'
|
35
|
-
gem 'flog', '~> 4.
|
36
|
-
gem 'reek', '~> 1.3.
|
37
|
-
gem 'rubocop', '~> 0.
|
38
|
-
gem 'simplecov', '~> 0.
|
39
|
-
gem 'yardstick', '~> 0.9.
|
39
|
+
gem 'flog', '~> 4.2.0'
|
40
|
+
gem 'reek', '~> 1.3.7'
|
41
|
+
gem 'rubocop', '~> 0.19.1'
|
42
|
+
gem 'simplecov', '~> 0.8.2'
|
43
|
+
gem 'yardstick', '~> 0.9.9'
|
44
|
+
|
45
|
+
platforms :mri do
|
46
|
+
gem 'mutant', '~> 0.5.8'
|
47
|
+
gem 'mutant-rspec', '~> 0.5.3'
|
48
|
+
end
|
40
49
|
|
41
50
|
platforms :ruby_19, :ruby_20 do
|
42
|
-
gem 'mutant', git: 'https://github.com/mbj/mutant.git'
|
43
51
|
gem 'yard-spellcheck', '~> 0.1.5'
|
44
52
|
end
|
53
|
+
|
54
|
+
platform :rbx do
|
55
|
+
gem 'json', '~> 1.8.1'
|
56
|
+
gem 'racc', '~> 1.4.11'
|
57
|
+
gem 'rubysl-logger', '~> 2.0.0'
|
58
|
+
gem 'rubysl-open-uri', '~> 2.0.0'
|
59
|
+
gem 'rubysl-prettyprint', '~> 2.0.3'
|
60
|
+
end
|
45
61
|
end
|
46
62
|
|
47
63
|
group :benchmarks do
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
descendants_tracker
|
2
|
-
===================
|
1
|
+
# descendants_tracker
|
3
2
|
|
4
3
|
[![Gem Version](https://badge.fury.io/rb/descendants_tracker.png)][gem]
|
5
4
|
[![Build Status](https://secure.travis-ci.org/dkubb/descendants_tracker.png?branch=master)][travis]
|
@@ -15,31 +14,7 @@ descendants_tracker
|
|
15
14
|
|
16
15
|
Small module to track descendants in an unobtrusive way.
|
17
16
|
|
18
|
-
|
19
|
-
------------
|
20
|
-
|
21
|
-
With Rubygems:
|
22
|
-
|
23
|
-
```bash
|
24
|
-
$ gem install descendants_tracker
|
25
|
-
$ irb -rubygems
|
26
|
-
>> require 'descendants_tracker'
|
27
|
-
=> true
|
28
|
-
```
|
29
|
-
|
30
|
-
With git and local working copy:
|
31
|
-
|
32
|
-
```bash
|
33
|
-
$ git clone git://github.com/dkubb/descendants_tracker.git
|
34
|
-
$ cd descendants_tracker
|
35
|
-
$ rake install
|
36
|
-
$ irb -rubygems
|
37
|
-
>> require 'descendants_tracker'
|
38
|
-
=> true
|
39
|
-
```
|
40
|
-
|
41
|
-
Examples
|
42
|
-
--------
|
17
|
+
## Examples
|
43
18
|
|
44
19
|
``` ruby
|
45
20
|
class Foo
|
@@ -52,27 +27,17 @@ end
|
|
52
27
|
Foo.descendants # => [Bar]
|
53
28
|
```
|
54
29
|
|
55
|
-
Credits
|
56
|
-
-------
|
30
|
+
## Credits
|
57
31
|
|
58
32
|
* Dan Kubb ([dkubb](https://github.com/dkubb))
|
59
33
|
* Piotr Solnica ([solnic](https://github.com/solnic))
|
60
34
|
* Markus Schirp ([mbj](https://github.com/mbj))
|
61
35
|
|
62
|
-
Contributing
|
63
|
-
------------
|
36
|
+
## Contributing
|
64
37
|
|
65
|
-
|
66
|
-
* Fork the project.
|
67
|
-
* Make your feature addition or bug fix.
|
68
|
-
* Follow this [style guide](https://github.com/dkubb/styleguide).
|
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.
|
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)
|
71
|
-
* Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
|
72
|
-
* Send me a pull request. Bonus points for topic branches.
|
38
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
73
39
|
|
74
|
-
Copyright
|
75
|
-
---------
|
40
|
+
## Copyright
|
76
41
|
|
77
42
|
Copyright © 2012-2013 Dan Kubb (author)
|
78
43
|
Copyright © 2011-2012 Piotr Solnica (source maintainer)
|
data/config/flay.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
---
|
2
|
-
threshold:
|
3
|
-
total_score:
|
2
|
+
threshold: 2
|
3
|
+
total_score: 4
|
data/config/reek.yml
CHANGED
@@ -1,97 +1,106 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
Attribute:
|
3
3
|
enabled: true
|
4
|
-
exclude:
|
5
|
-
|
6
|
-
|
7
|
-
exclude: []
|
4
|
+
exclude:
|
5
|
+
- DescendantsTracker
|
6
|
+
BooleanParameter:
|
8
7
|
enabled: true
|
9
|
-
reject:
|
10
|
-
- !ruby/regexp /^.$/
|
11
|
-
- !ruby/regexp /[0-9]$/
|
12
|
-
- !ruby/regexp /[A-Z]/
|
13
|
-
LargeClass:
|
14
|
-
max_methods: 0
|
15
8
|
exclude: []
|
9
|
+
ClassVariable:
|
16
10
|
enabled: true
|
17
|
-
max_instance_variables: 0
|
18
|
-
UncommunicativeMethodName:
|
19
|
-
accept: []
|
20
11
|
exclude: []
|
12
|
+
ControlParameter:
|
21
13
|
enabled: true
|
22
|
-
reject:
|
23
|
-
- !ruby/regexp /^[a-z]$/
|
24
|
-
- !ruby/regexp /[0-9]$/
|
25
|
-
- !ruby/regexp /[A-Z]/
|
26
|
-
LongParameterList:
|
27
|
-
max_params: 1
|
28
14
|
exclude: []
|
15
|
+
DataClump:
|
29
16
|
enabled: true
|
30
|
-
overrides: {}
|
31
|
-
FeatureEnvy:
|
32
17
|
exclude: []
|
18
|
+
max_copies: 2
|
19
|
+
min_clump_size: 2
|
20
|
+
DuplicateMethodCall:
|
33
21
|
enabled: true
|
34
|
-
ClassVariable:
|
35
22
|
exclude: []
|
23
|
+
max_calls: 1
|
24
|
+
allow_calls: []
|
25
|
+
FeatureEnvy:
|
36
26
|
enabled: true
|
37
|
-
BooleanParameter:
|
38
27
|
exclude: []
|
39
|
-
enabled: true
|
40
28
|
IrresponsibleModule:
|
29
|
+
enabled: true
|
41
30
|
exclude: []
|
31
|
+
LongParameterList:
|
42
32
|
enabled: true
|
43
|
-
UncommunicativeModuleName:
|
44
|
-
accept: []
|
45
33
|
exclude: []
|
34
|
+
max_params: 2
|
35
|
+
overrides:
|
36
|
+
initialize:
|
37
|
+
max_params: 3
|
38
|
+
LongYieldList:
|
46
39
|
enabled: true
|
47
|
-
|
48
|
-
|
49
|
-
- !ruby/regexp /[0-9]$/
|
40
|
+
exclude: []
|
41
|
+
max_params: 2
|
50
42
|
NestedIterators:
|
51
|
-
|
43
|
+
enabled: true
|
52
44
|
exclude: []
|
45
|
+
max_allowed_nesting: 1
|
46
|
+
ignore_iterators: []
|
47
|
+
NilCheck:
|
53
48
|
enabled: true
|
54
|
-
max_allowed_nesting: 0
|
55
|
-
LongMethod:
|
56
|
-
max_statements: 2
|
57
|
-
exclude:
|
58
|
-
- DescendantsTracker#add_descendant
|
59
|
-
Duplication:
|
60
|
-
allow_calls: []
|
61
49
|
exclude: []
|
50
|
+
RepeatedConditional:
|
62
51
|
enabled: true
|
63
|
-
max_calls: 1
|
64
|
-
UtilityFunction:
|
65
|
-
max_helper_calls: 0
|
66
52
|
exclude: []
|
53
|
+
max_ifs: 1
|
54
|
+
TooManyInstanceVariables:
|
67
55
|
enabled: true
|
68
|
-
Attribute:
|
69
56
|
exclude: []
|
57
|
+
max_instance_variables: 3
|
58
|
+
TooManyMethods:
|
70
59
|
enabled: true
|
71
|
-
UncommunicativeVariableName:
|
72
|
-
accept: []
|
73
60
|
exclude: []
|
61
|
+
max_methods: 10
|
62
|
+
TooManyStatements:
|
63
|
+
enabled: true
|
64
|
+
exclude:
|
65
|
+
- DescendantsTracker#add_descendant
|
66
|
+
- DescendantsTracker#inherited
|
67
|
+
- each
|
68
|
+
max_statements: 2
|
69
|
+
UncommunicativeMethodName:
|
74
70
|
enabled: true
|
71
|
+
exclude: []
|
75
72
|
reject:
|
76
|
-
- !ruby/regexp
|
73
|
+
- !ruby/regexp /^[a-z]$/
|
77
74
|
- !ruby/regexp /[0-9]$/
|
78
75
|
- !ruby/regexp /[A-Z]/
|
79
|
-
|
80
|
-
|
76
|
+
accept: []
|
77
|
+
UncommunicativeModuleName:
|
81
78
|
enabled: true
|
82
|
-
max_ifs: 0
|
83
|
-
DataClump:
|
84
79
|
exclude: []
|
80
|
+
reject:
|
81
|
+
- !ruby/regexp /^.$/
|
82
|
+
- !ruby/regexp /[0-9]$/
|
83
|
+
accept: []
|
84
|
+
UncommunicativeParameterName:
|
85
85
|
enabled: true
|
86
|
-
max_copies: 0
|
87
|
-
min_clump_size: 2
|
88
|
-
ControlCouple:
|
89
86
|
exclude: []
|
87
|
+
reject:
|
88
|
+
- !ruby/regexp /^.$/
|
89
|
+
- !ruby/regexp /[0-9]$/
|
90
|
+
- !ruby/regexp /[A-Z]/
|
91
|
+
accept: []
|
92
|
+
UncommunicativeVariableName:
|
90
93
|
enabled: true
|
91
|
-
LongYieldList:
|
92
|
-
max_params: 0
|
93
94
|
exclude: []
|
95
|
+
reject:
|
96
|
+
- !ruby/regexp /^.$/
|
97
|
+
- !ruby/regexp /[0-9]$/
|
98
|
+
- !ruby/regexp /[A-Z]/
|
99
|
+
accept: []
|
100
|
+
UnusedParameters:
|
94
101
|
enabled: true
|
95
|
-
|
102
|
+
exclude: []
|
103
|
+
UtilityFunction:
|
96
104
|
enabled: true
|
97
105
|
exclude: []
|
106
|
+
max_helper_calls: 0
|
data/config/rubocop.yml
CHANGED
@@ -30,7 +30,7 @@ CollectionMethods:
|
|
30
30
|
# sections of code and visually separate them. When the keyword is at the same
|
31
31
|
# level I think it sort of blends in with the def keywords and makes it harder
|
32
32
|
# to scan the code and see where the sections are.
|
33
|
-
|
33
|
+
AccessModifierIndentation:
|
34
34
|
Enabled: false
|
35
35
|
|
36
36
|
# Limit line length
|
@@ -56,3 +56,7 @@ ConstantName:
|
|
56
56
|
# Not all trivial readers/writers can be defined with attr_* methods
|
57
57
|
TrivialAccessors:
|
58
58
|
Enabled: false
|
59
|
+
|
60
|
+
# Allow empty lines around body
|
61
|
+
EmptyLinesAroundBody:
|
62
|
+
Enabled: false
|
data/descendants_tracker.gemspec
CHANGED
@@ -10,13 +10,14 @@ Gem::Specification.new do |gem|
|
|
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
|
+
gem.license = 'MIT'
|
13
14
|
|
14
15
|
gem.require_paths = %w[lib]
|
15
16
|
gem.files = `git ls-files`.split($/)
|
16
17
|
gem.test_files = `git ls-files -- spec/unit`.split($/)
|
17
|
-
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
|
18
|
+
gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md TODO]
|
18
19
|
|
19
|
-
gem.
|
20
|
-
|
21
|
-
gem.add_development_dependency('
|
20
|
+
gem.add_runtime_dependency('thread_safe', '~> 0.3', '>= 0.3.1')
|
21
|
+
|
22
|
+
gem.add_development_dependency('bundler', '~> 1.5', '>= 1.5.3')
|
22
23
|
end
|
data/lib/descendants_tracker.rb
CHANGED
@@ -1,32 +1,34 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require 'thread_safe'
|
4
|
+
|
3
5
|
# Module that adds descendant tracking to a class
|
4
6
|
module DescendantsTracker
|
5
7
|
|
6
|
-
# @private
|
7
|
-
def self.extended(descendant)
|
8
|
-
setup(descendant)
|
9
|
-
end
|
10
|
-
private_class_method :extended
|
11
|
-
|
12
|
-
# @return [Array]
|
13
|
-
#
|
14
|
-
# @private
|
15
|
-
def self.setup(descendant)
|
16
|
-
descendant.instance_variable_set('@descendants', [])
|
17
|
-
end
|
18
|
-
private_class_method :extended
|
19
|
-
|
20
8
|
# Return the descendants of this class
|
21
9
|
#
|
22
10
|
# @example
|
23
11
|
# descendants = ParentClass.descendants
|
24
12
|
#
|
25
|
-
# @return [Array<Class
|
13
|
+
# @return [Array<Class<DescendantsTracker>>]
|
26
14
|
#
|
27
15
|
# @api public
|
28
|
-
|
29
|
-
|
16
|
+
attr_reader :descendants
|
17
|
+
|
18
|
+
# Setup the class for descendant tracking
|
19
|
+
#
|
20
|
+
# @param [Class<DescendantsTracker>] descendant
|
21
|
+
#
|
22
|
+
# @return [undefined]
|
23
|
+
#
|
24
|
+
# @api private
|
25
|
+
def self.setup(descendant)
|
26
|
+
descendant.instance_variable_set(:@descendants, ThreadSafe::Array.new)
|
27
|
+
end
|
28
|
+
|
29
|
+
class << self
|
30
|
+
alias_method :extended, :setup
|
31
|
+
private :extended
|
30
32
|
end
|
31
33
|
|
32
34
|
# Add the descendant to this class and the superclass
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'devtools/spec_helper'
|
4
|
-
|
5
3
|
if ENV['COVERAGE'] == 'true'
|
6
4
|
require 'simplecov'
|
7
5
|
require 'coveralls'
|
@@ -12,19 +10,21 @@ if ENV['COVERAGE'] == 'true'
|
|
12
10
|
]
|
13
11
|
|
14
12
|
SimpleCov.start do
|
15
|
-
command_name
|
16
|
-
|
17
|
-
add_filter
|
13
|
+
command_name 'spec:unit'
|
14
|
+
|
15
|
+
add_filter 'config'
|
16
|
+
add_filter 'spec'
|
17
|
+
add_filter 'vendor'
|
18
|
+
|
18
19
|
minimum_coverage 100
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
23
|
+
require 'devtools/spec_helper'
|
22
24
|
require 'descendants_tracker'
|
23
25
|
|
24
|
-
# require spec support files and shared behavior
|
25
|
-
Dir[File.expand_path('../{support,shared}/**/*.rb', __FILE__)].each do |file|
|
26
|
-
require file
|
27
|
-
end
|
28
|
-
|
29
26
|
RSpec.configure do |config|
|
27
|
+
config.expect_with :rspec do |expect_with|
|
28
|
+
expect_with.syntax = :expect
|
29
|
+
end
|
30
30
|
end
|
@@ -10,8 +10,8 @@ describe DescendantsTracker, '#inherited' do
|
|
10
10
|
|
11
11
|
it 'delegates to the superclass #inherited method' do
|
12
12
|
superklass.should_receive(:inherited) do |descendant|
|
13
|
-
descendant.
|
14
|
-
descendant.ancestors.
|
13
|
+
expect(descendant).to be_instance_of(Class)
|
14
|
+
expect(descendant.ancestors).to include(object)
|
15
15
|
end
|
16
16
|
subject
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: descendants_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Kubb
|
@@ -10,50 +10,48 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: thread_safe
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
22
|
-
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: 10.1.0
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: rspec
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ~>
|
21
|
+
version: '0.3'
|
22
|
+
- - '>='
|
34
23
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
36
|
-
type: :
|
24
|
+
version: 0.3.1
|
25
|
+
type: :runtime
|
37
26
|
prerelease: false
|
38
27
|
version_requirements: !ruby/object:Gem::Requirement
|
39
28
|
requirements:
|
40
29
|
- - ~>
|
41
30
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
31
|
+
version: '0.3'
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.3.1
|
43
35
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
36
|
+
name: bundler
|
45
37
|
requirement: !ruby/object:Gem::Requirement
|
46
38
|
requirements:
|
47
39
|
- - ~>
|
48
40
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
41
|
+
version: '1.5'
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.5.3
|
50
45
|
type: :development
|
51
46
|
prerelease: false
|
52
47
|
version_requirements: !ruby/object:Gem::Requirement
|
53
48
|
requirements:
|
54
49
|
- - ~>
|
55
50
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
51
|
+
version: '1.5'
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.5.3
|
57
55
|
description: Module that adds descendant tracking to a class
|
58
56
|
email:
|
59
57
|
- dan.kubb@gmail.com
|
@@ -64,11 +62,14 @@ extensions: []
|
|
64
62
|
extra_rdoc_files:
|
65
63
|
- LICENSE
|
66
64
|
- README.md
|
65
|
+
- CONTRIBUTING.md
|
67
66
|
- TODO
|
68
67
|
files:
|
69
68
|
- .gitignore
|
70
|
-
- .
|
69
|
+
- .rspec
|
70
|
+
- .ruby-gemset
|
71
71
|
- .travis.yml
|
72
|
+
- CONTRIBUTING.md
|
72
73
|
- Gemfile
|
73
74
|
- Gemfile.devtools
|
74
75
|
- Guardfile
|
@@ -94,7 +95,8 @@ files:
|
|
94
95
|
- spec/unit/descendants_tracker/descendants_spec.rb
|
95
96
|
- spec/unit/descendants_tracker/inherited_spec.rb
|
96
97
|
homepage: https://github.com/dkubb/descendants_tracker
|
97
|
-
licenses:
|
98
|
+
licenses:
|
99
|
+
- MIT
|
98
100
|
metadata: {}
|
99
101
|
post_install_message:
|
100
102
|
rdoc_options: []
|
@@ -112,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
114
|
version: '0'
|
113
115
|
requirements: []
|
114
116
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.2.2
|
116
118
|
signing_key:
|
117
119
|
specification_version: 4
|
118
120
|
summary: Module that adds descendant tracking to a class
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use @$(basename `pwd`) --create
|