yardstick 0.7.0 → 0.8.0
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/.travis.yml +5 -5
- data/VERSION +1 -1
- data/lib/yardstick.rb +2 -2
- data/lib/yardstick/cli.rb +2 -0
- data/lib/yardstick/measurable.rb +13 -27
- data/lib/yardstick/measurement.rb +2 -0
- data/lib/yardstick/measurement_set.rb +2 -0
- data/lib/yardstick/ordered_set.rb +2 -0
- data/lib/yardstick/processor.rb +2 -0
- data/lib/yardstick/rake/measurement.rb +2 -0
- data/lib/yardstick/rake/verify.rb +2 -0
- data/lib/yardstick/rule.rb +2 -0
- data/lib/yardstick/rule_set.rb +2 -0
- data/lib/yardstick/version.rb +1 -1
- data/lib/yardstick/yard_ext.rb +4 -17
- data/spec/semipublic/yardstick/rule_spec.rb +19 -12
- data/yardstick.gemspec +2 -2
- metadata +5 -2
data/.travis.yml
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
language: ruby
|
2
|
-
bundler_args: --without guard metrics
|
2
|
+
bundler_args: --without yard guard metrics
|
3
3
|
script: "bundle exec rake spec"
|
4
4
|
rvm:
|
5
|
-
- ree
|
6
5
|
- 1.8.7
|
7
6
|
- 1.9.2
|
8
7
|
- 1.9.3
|
9
|
-
- ruby-head
|
10
|
-
- rbx-18mode
|
11
|
-
- rbx-19mode
|
12
8
|
- jruby-18mode
|
13
9
|
- jruby-19mode
|
10
|
+
- rbx-18mode
|
11
|
+
- rbx-19mode
|
12
|
+
- ree
|
13
|
+
- ruby-head
|
14
14
|
- jruby-head
|
15
15
|
notifications:
|
16
16
|
email:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.0
|
data/lib/yardstick.rb
CHANGED
@@ -4,8 +4,6 @@ require 'rational'
|
|
4
4
|
require 'backports'
|
5
5
|
require 'yard'
|
6
6
|
|
7
|
-
require 'yardstick/yard_ext'
|
8
|
-
|
9
7
|
require 'yardstick/ordered_set'
|
10
8
|
require 'yardstick/rule_set'
|
11
9
|
require 'yardstick/measurement'
|
@@ -17,6 +15,8 @@ require 'yardstick/rule'
|
|
17
15
|
require 'yardstick/measurable'
|
18
16
|
require 'yardstick/method'
|
19
17
|
|
18
|
+
require 'yardstick/yard_ext'
|
19
|
+
|
20
20
|
require 'yardstick/version'
|
21
21
|
|
22
22
|
module Yardstick
|
data/lib/yardstick/cli.rb
CHANGED
data/lib/yardstick/measurable.rb
CHANGED
@@ -4,6 +4,18 @@ module Yardstick
|
|
4
4
|
|
5
5
|
module ClassMethods
|
6
6
|
|
7
|
+
# Include the class or module with measurable class methods
|
8
|
+
#
|
9
|
+
# @param [Module] mod
|
10
|
+
# the module to include within
|
11
|
+
#
|
12
|
+
# @return [undefined]
|
13
|
+
#
|
14
|
+
# @api private
|
15
|
+
def included(mod)
|
16
|
+
mod.extend(ClassMethods).rules.merge(rules)
|
17
|
+
end
|
18
|
+
|
7
19
|
# List of rules for this class
|
8
20
|
#
|
9
21
|
# @return [Yardstick::RuleSet<Rule>]
|
@@ -32,32 +44,6 @@ module Yardstick
|
|
32
44
|
rules << Rule.new(description, &block)
|
33
45
|
end
|
34
46
|
|
35
|
-
private
|
36
|
-
|
37
|
-
# Include the class or module with measurable class methods
|
38
|
-
#
|
39
|
-
# @param [Module] mod
|
40
|
-
# the module to include within
|
41
|
-
#
|
42
|
-
# @return [undefined]
|
43
|
-
#
|
44
|
-
# @api private
|
45
|
-
def included(mod)
|
46
|
-
mod.extend(ClassMethods).rules.merge(rules)
|
47
|
-
end
|
48
|
-
|
49
|
-
# Extend the docstring meta class with measurable class methods
|
50
|
-
#
|
51
|
-
# @param [YARD::Docstring] docstring
|
52
|
-
# the docstring to extend
|
53
|
-
#
|
54
|
-
# @return [undefined]
|
55
|
-
#
|
56
|
-
# @api private
|
57
|
-
def extended(docstring)
|
58
|
-
included(docstring.singleton_class)
|
59
|
-
end
|
60
|
-
|
61
47
|
end # module ClassMethods
|
62
48
|
|
63
49
|
extend ClassMethods
|
@@ -72,7 +58,7 @@ module Yardstick
|
|
72
58
|
#
|
73
59
|
# @api public
|
74
60
|
def measure
|
75
|
-
|
61
|
+
self.class.rules.measure(self)
|
76
62
|
end
|
77
63
|
|
78
64
|
end # module Measurable
|
data/lib/yardstick/processor.rb
CHANGED
data/lib/yardstick/rule.rb
CHANGED
data/lib/yardstick/rule_set.rb
CHANGED
data/lib/yardstick/version.rb
CHANGED
data/lib/yardstick/yard_ext.rb
CHANGED
@@ -1,20 +1,7 @@
|
|
1
1
|
module YARD #:nodoc: all
|
2
|
-
module CodeObjects
|
3
|
-
class MethodObject
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
#
|
10
|
-
# @return [YARD::Docstring]
|
11
|
-
# the docstring for this method
|
12
|
-
#
|
13
|
-
# @api public
|
14
|
-
def docstring
|
15
|
-
super.extend(Yardstick::Method)
|
16
|
-
end
|
17
|
-
|
18
|
-
end # class MethodObject
|
19
|
-
end # module CodeObjects
|
3
|
+
# Extend docstring with yardstick methods
|
4
|
+
class Docstring
|
5
|
+
include Yardstick::Method
|
6
|
+
end # class Docstring
|
20
7
|
end # module YARD
|
@@ -1,27 +1,34 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Yardstick::Rule do
|
4
|
+
let(:object) { described_class.new(description) { true } }
|
5
|
+
let(:description) { 'test rule' }
|
6
|
+
|
4
7
|
describe '#eql?' do
|
8
|
+
subject { object.eql?(other) }
|
9
|
+
|
5
10
|
describe 'when rules are equal' do
|
6
|
-
|
7
|
-
@rule = Yardstick::Rule.new('test rule') { true }
|
8
|
-
@other = Yardstick::Rule.new('test rule') { true }
|
9
|
-
end
|
11
|
+
let(:other) { described_class.new(description) { true } }
|
10
12
|
|
11
|
-
it '
|
12
|
-
|
13
|
+
it 'is true' do
|
14
|
+
should be(true)
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
18
|
describe 'when rules are not equal' do
|
17
|
-
|
18
|
-
@rule = Yardstick::Rule.new('test rule') { true }
|
19
|
-
@other = Yardstick::Rule.new('other rule') { true }
|
20
|
-
end
|
19
|
+
let(:other) { described_class.new('other rule') { true } }
|
21
20
|
|
22
|
-
it '
|
23
|
-
|
21
|
+
it 'is false' do
|
22
|
+
should be(false)
|
24
23
|
end
|
25
24
|
end
|
26
25
|
end
|
26
|
+
|
27
|
+
describe '#hash' do
|
28
|
+
subject { object.hash }
|
29
|
+
|
30
|
+
it 'is the expected hash' do
|
31
|
+
should == description.hash
|
32
|
+
end
|
33
|
+
end
|
27
34
|
end
|
data/yardstick.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "yardstick"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.8.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Kubb"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-11-12"
|
13
13
|
s.description = "Measure YARD documentation coverage"
|
14
14
|
s.email = "dan.kubb@gmail.com"
|
15
15
|
s.executables = ["yardstick"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yardstick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
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: 2012-
|
12
|
+
date: 2012-11-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: backports
|
@@ -155,6 +155,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
- - ! '>='
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
|
+
segments:
|
159
|
+
- 0
|
160
|
+
hash: 3755619333426981008
|
158
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
162
|
none: false
|
160
163
|
requirements:
|