coco 0.9 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Changelog.markdown +9 -1
- data/Gemfile.lock +18 -1
- data/README.markdown +17 -3
- data/Rakefile +17 -9
- data/TODO +24 -15
- data/VERSION +1 -1
- data/lib/coco/formatter/console_formatter.rb +5 -5
- data/lib/coco/formatter/context.rb +2 -2
- data/lib/coco/formatter/formatter.rb +3 -3
- data/lib/coco/formatter/template.rb +3 -2
- data/lib/coco/lister/source_lister.rb +3 -2
- data/lib/coco/lister/uncovered_lister.rb +3 -3
- data/lib/coco/writer/html_files_writer.rb +3 -2
- metadata +78 -39
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ODNkODRiOWU0ZTgwNWIzNjA1MDU0M2U4NWE0MTYyZmNjYWE1ZmRkYg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a95f8e7a9b475c43d6a2af585819051272e62f5
|
4
|
+
data.tar.gz: 44d95676351a0d9ce9d6c2a2c1ffc8c6249bfccc
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YTM5N2IxNjY2MzBiNTE4MTNmNDEwMGMwZDJhNjVjNDY0MjI4ZTk1ODAwYzZl
|
11
|
-
Njc1OGVjZmU2YmQ5MGRmMDhjNjhmODQ4MDJiZGU0NGNmMzMzZDA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MDVkNTcyOTA4NjkzN2JjNTlkZjFiMjIyNTMzOGVkN2JlMDQ2MGM1ZjBkN2M1
|
14
|
-
MTAwMmM2NmZhMmJjYTQ5Yzg4MTkwODY3NjZkYTllMDY1MjkxODc4MWE5ZGYz
|
15
|
-
NmFiZWFkNzU1MDAxNTBjNjk4ZTgzOWNiODA1NTVhNGRmNDdmMTE=
|
6
|
+
metadata.gz: 7f8b890410e93672ef60c2aaa03182d092da05076cc3fdca6826a875be5b7676d6f8f8dfa5b524758f2e4e9ea3e186c9a5a459d20d33485f39030f9daa2f11ed
|
7
|
+
data.tar.gz: 090258b598f8f079dc645bea11de2e82ad2e72770ea36e97e03efaecd4fe49cca002128cd484c5f285561cbe0fefa97f9e9b93ae23ac7d6f8cff7c92aafa30f0
|
data/Changelog.markdown
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
+
v0.10.0 (2014-05-03)
|
2
|
+
=================================================
|
3
|
+
|
4
|
+
* Drop support for Ruby 1.9.2.
|
5
|
+
* Add some rake tasks for development.
|
6
|
+
* Add a «Contributing» section in the README.
|
7
|
+
|
8
|
+
|
1
9
|
v0.9 (2014-02-02)
|
2
10
|
=================================================
|
3
11
|
|
4
12
|
* New configuration option: `always_run`, to control when to start coco
|
5
13
|
and when to not start it.
|
6
|
-
|
14
|
+
* Add link in the terminal.
|
7
15
|
* New configuration option: `show_link_in_terminal`, to display the
|
8
16
|
report's index page URI in the terminal.
|
9
17
|
* Partially converts developer's documentation in tomdoc format.
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
coco (0.
|
4
|
+
coco (0.10.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
diff-lcs (1.2.4)
|
10
|
+
flay (2.4.0)
|
11
|
+
ruby_parser (~> 3.0)
|
12
|
+
sexp_processor (~> 4.0)
|
13
|
+
rainbow (2.0.0)
|
10
14
|
rake (10.1.1)
|
15
|
+
reek (1.3.7)
|
16
|
+
rainbow
|
17
|
+
ruby2ruby (~> 2.0.8)
|
18
|
+
ruby_parser (~> 3.3)
|
19
|
+
sexp_processor
|
11
20
|
rspec (2.13.0)
|
12
21
|
rspec-core (~> 2.13.0)
|
13
22
|
rspec-expectations (~> 2.13.0)
|
@@ -16,11 +25,19 @@ GEM
|
|
16
25
|
rspec-expectations (2.13.0)
|
17
26
|
diff-lcs (>= 1.1.3, < 2.0)
|
18
27
|
rspec-mocks (2.13.1)
|
28
|
+
ruby2ruby (2.0.8)
|
29
|
+
ruby_parser (~> 3.1)
|
30
|
+
sexp_processor (~> 4.0)
|
31
|
+
ruby_parser (3.5.0)
|
32
|
+
sexp_processor (~> 4.1)
|
33
|
+
sexp_processor (4.4.3)
|
19
34
|
|
20
35
|
PLATFORMS
|
21
36
|
ruby
|
22
37
|
|
23
38
|
DEPENDENCIES
|
24
39
|
coco!
|
40
|
+
flay (~> 2.4)
|
25
41
|
rake (>= 10.1.0)
|
42
|
+
reek (~> 1.3)
|
26
43
|
rspec
|
data/README.markdown
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
coco [![Build Status](https://travis-ci.org/lkdjiin/coco.png)](https://travis-ci.org/lkdjiin/coco) [![Gem Version](https://badge.fury.io/rb/coco.png)](http://badge.fury.io/rb/coco)
|
1
|
+
coco [![Build Status](https://travis-ci.org/lkdjiin/coco.png)](https://travis-ci.org/lkdjiin/coco) [![Gem Version](https://badge.fury.io/rb/coco.png)](http://badge.fury.io/rb/coco) [![Inline docs](http://inch-pages.github.io/github/lkdjiin/coco.png)](http://inch-pages.github.io/github/lkdjiin/coco) [![Dependency Status](https://gemnasium.com/lkdjiin/coco.svg)](https://gemnasium.com/lkdjiin/coco)
|
2
2
|
==============================
|
3
3
|
|
4
|
-
Code coverage tool for ruby 1.9.
|
4
|
+
Code coverage tool for ruby 1.9.3, 2.0 and 2.1.
|
5
5
|
|
6
6
|
Features
|
7
7
|
--------------------------------
|
@@ -141,13 +141,27 @@ Now, when running tests, you will see something like the following:
|
|
141
141
|
Dependencies
|
142
142
|
--------------------------------
|
143
143
|
|
144
|
-
ruby >= 1.9.
|
144
|
+
ruby >= 1.9.3
|
145
|
+
|
146
|
+
|
147
|
+
Contributing
|
148
|
+
--------------------------------
|
149
|
+
|
150
|
+
1. Fork it.
|
151
|
+
2. Create your feature branch **from the development branch**:
|
152
|
+
- `git checkout development`
|
153
|
+
- `git pull origin development`
|
154
|
+
- `git checkout -b my-new-feature`
|
155
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
156
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
157
|
+
5. Create a Pull Request.
|
145
158
|
|
146
159
|
|
147
160
|
License
|
148
161
|
--------------------------------
|
149
162
|
GPLv3, see COPYING.
|
150
163
|
|
164
|
+
|
151
165
|
Questions and/or Comments
|
152
166
|
--------------------------------
|
153
167
|
|
data/Rakefile
CHANGED
@@ -14,21 +14,29 @@ task :default => :spec
|
|
14
14
|
|
15
15
|
desc 'Test coco'
|
16
16
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
17
|
-
t.rspec_opts = ['--color --
|
17
|
+
t.rspec_opts = ['--color --order=random']
|
18
18
|
end
|
19
19
|
|
20
|
-
desc 'Check for code smells'
|
20
|
+
desc 'Check for code smells with reek'
|
21
21
|
task :reek do
|
22
|
-
puts 'Checking for code smells
|
23
|
-
|
24
|
-
|
22
|
+
puts 'Checking for code smells.'
|
23
|
+
puts '-------------------------'
|
24
|
+
system "reek #{ruby_files_for_shell}"
|
25
25
|
end
|
26
26
|
|
27
|
-
desc 'Check for duplicate code'
|
27
|
+
desc 'Check for duplicate code with flay'
|
28
28
|
task :flay do
|
29
|
-
puts '
|
30
|
-
|
31
|
-
exec "flay
|
29
|
+
puts 'Checking for duplicate code.'
|
30
|
+
puts '----------------------------'
|
31
|
+
exec "flay lib"
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Check various code metrics'
|
35
|
+
task :metrics do
|
36
|
+
puts 'Checking various metrics.'
|
37
|
+
puts '========================='
|
38
|
+
Rake::Task['reek'].execute
|
39
|
+
Rake::Task['flay'].execute
|
32
40
|
end
|
33
41
|
|
34
42
|
desc 'Build the gem & install it'
|
data/TODO
CHANGED
@@ -1,24 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
+ doc readme & examples (maybe wiki ?)
|
4
|
-
+ manual tests
|
1
|
+
[x] Release 0.10.0
|
2
|
+
[ ] release gem
|
5
3
|
|
6
|
-
|
4
|
+
[ ] Update website
|
7
5
|
|
8
|
-
|
9
|
-
+ option on/off
|
10
|
-
+ doc readme
|
6
|
+
[ ] Review PRs
|
11
7
|
|
12
|
-
|
8
|
+
[ ] A task to build/install/push a gem
|
13
9
|
|
14
|
-
|
10
|
+
[ ] BUG #22 rails 4.1 / minitest / spring
|
11
|
+
[x] test with rails 4.1 / spring / rspec
|
12
|
+
[x] coco outside dev group
|
13
|
+
[x] test with 4.1 / spring / minitest
|
14
|
+
[ ] retest with a .coco.yml file
|
15
15
|
|
16
|
-
|
16
|
+
[ ] refactor with reek
|
17
17
|
|
18
|
-
|
18
|
+
[ ] en gras: def, class, module
|
19
19
|
|
20
|
-
|
21
|
-
que c'est en fait toute l'application.
|
20
|
+
[ ] rakefile task: tomdoc
|
22
21
|
|
23
|
-
|
22
|
+
[ ] exclure spec et test par défaut
|
24
23
|
|
24
|
+
[ ] le wiki dit que seul le dossier lib est inspecté par défaut, je pense
|
25
|
+
que c'est en fait toute l'application.
|
26
|
+
|
27
|
+
|
28
|
+
Bump Version
|
29
|
+
=============
|
30
|
+
|
31
|
+
- Update `VERSION` file.
|
32
|
+
- `bundle install`
|
33
|
+
- Update Changelog.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
module Coco
|
4
4
|
|
5
|
-
# I format coverages information for console output
|
5
|
+
# I format coverages information for console output.
|
6
6
|
class ConsoleFormatter < Formatter
|
7
7
|
|
8
|
-
#
|
8
|
+
# single_line_report - Boolean
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# Returns percent covered and associated filenames as a String.
|
11
11
|
def format(single_line_report = false)
|
12
12
|
if single_line_report
|
13
13
|
single_line_message
|
@@ -25,8 +25,8 @@ module Coco
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
#
|
29
|
-
#
|
28
|
+
# covered - Hash
|
29
|
+
# uncovered - Array
|
30
30
|
def initialize covered, uncovered
|
31
31
|
super(covered, uncovered)
|
32
32
|
@formatted_output = []
|
@@ -5,8 +5,8 @@ module Coco
|
|
5
5
|
# Contextual information for ERB template, representing each covered files.
|
6
6
|
class Context
|
7
7
|
|
8
|
-
#
|
9
|
-
#
|
8
|
+
# filename - A String name of the source file.
|
9
|
+
# lines - An Array of lines.
|
10
10
|
def initialize filename, lines
|
11
11
|
@filename = filename
|
12
12
|
@lines = lines
|
@@ -3,11 +3,11 @@
|
|
3
3
|
module Coco
|
4
4
|
|
5
5
|
# My childs will format coverages information.
|
6
|
-
#
|
6
|
+
# Kind of abstract class.
|
7
7
|
class Formatter
|
8
8
|
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# raw_coverages - The Hash from Coverage.result.
|
10
|
+
# uncovered - An Array list of uncovered files.
|
11
11
|
# @todo I think covered is a better name than raw_coverages
|
12
12
|
def initialize raw_coverages, uncovered
|
13
13
|
@raw_coverages = raw_coverages
|
@@ -6,8 +6,9 @@ module Coco
|
|
6
6
|
|
7
7
|
# From me, you can obtain ERB templates.
|
8
8
|
class Template
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# filename - An String ERB template.
|
10
|
+
#
|
11
|
+
# Returns ERB.
|
11
12
|
def self.open filename
|
12
13
|
io = IO.readlines(filename, nil)
|
13
14
|
ERB.new(io[0], nil, '><')
|
@@ -5,7 +5,7 @@ module Coco
|
|
5
5
|
# I retrieve the .rb files from a list of directories.
|
6
6
|
class SourceLister
|
7
7
|
|
8
|
-
#
|
8
|
+
# config - Hash.
|
9
9
|
def initialize config
|
10
10
|
@exclude_files = config[:excludes]
|
11
11
|
dirs = config[:directories]
|
@@ -22,7 +22,8 @@ module Coco
|
|
22
22
|
@list = []
|
23
23
|
end
|
24
24
|
|
25
|
-
#
|
25
|
+
# Returns Array of String, that is a list of all `.rb` files from
|
26
|
+
# the directories found in configuration.
|
26
27
|
def list
|
27
28
|
look_for_sources
|
28
29
|
@list.map! {|file| File.expand_path(file)}
|
@@ -5,14 +5,14 @@ module Coco
|
|
5
5
|
# I retrieve the list of uncovered (0%) .rb files.
|
6
6
|
class UncoveredLister
|
7
7
|
|
8
|
-
#
|
9
|
-
#
|
8
|
+
# sources - Array of String list of filenames.
|
9
|
+
# covered - Hash raw coverage from the domain.
|
10
10
|
def initialize sources, covered
|
11
11
|
@source_files = Helpers.expand(sources)
|
12
12
|
@covered_files = Helpers.expand(covered.keys)
|
13
13
|
end
|
14
14
|
|
15
|
-
#
|
15
|
+
# Returns Array of String list of uncovered filenames.
|
16
16
|
def list
|
17
17
|
list = []
|
18
18
|
@source_files.each do |elem|
|
@@ -5,7 +5,7 @@ module Coco
|
|
5
5
|
# I populate the coverage/ directory with files, if any.
|
6
6
|
class HtmlFilesWriter
|
7
7
|
|
8
|
-
#
|
8
|
+
# html_files - Hash, key is filename, value is html content.
|
9
9
|
def initialize html_files
|
10
10
|
@html_files = html_files
|
11
11
|
@html_dir = HtmlDirectory.new
|
@@ -23,7 +23,8 @@ module Coco
|
|
23
23
|
|
24
24
|
def write_each_file
|
25
25
|
@html_files.each do |filename, html|
|
26
|
-
FileWriter.write File.join(
|
26
|
+
FileWriter.write File.join(
|
27
|
+
@html_dir.coverage_dir, Helpers.rb2html(filename)), html
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
metadata
CHANGED
@@ -1,66 +1,104 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Nayrac
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: reek
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: flay
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.4'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.4'
|
55
|
+
description: |-
|
56
|
+
"Code coverage tool for ruby 1.9.3 to 2.1.
|
57
|
+
Use it by "require 'coco'" from rspec or unit/test.
|
17
58
|
It display names of uncovered files on console.
|
18
|
-
|
19
59
|
It builds simple html report.
|
20
|
-
|
21
60
|
It reports sources that have no tests.
|
22
|
-
|
23
|
-
It''s configurable with a simple yaml file.'
|
61
|
+
It's configurable with a simple yaml file.
|
24
62
|
email: xavier.nayrac@gmail.com
|
25
63
|
executables: []
|
26
64
|
extensions: []
|
27
65
|
extra_rdoc_files: []
|
28
66
|
files:
|
67
|
+
- COPYING
|
68
|
+
- Changelog.markdown
|
69
|
+
- Gemfile
|
70
|
+
- Gemfile.lock
|
71
|
+
- README.markdown
|
72
|
+
- Rakefile
|
73
|
+
- TODO
|
74
|
+
- VERSION
|
29
75
|
- lib/coco.rb
|
30
|
-
- lib/coco/writer.rb
|
31
|
-
- lib/coco/lister/uncovered_lister.rb
|
32
|
-
- lib/coco/lister/source_lister.rb
|
33
|
-
- lib/coco/lister.rb
|
34
76
|
- lib/coco/configuration.rb
|
77
|
+
- lib/coco/cover.rb
|
78
|
+
- lib/coco/cover/coverage_result.rb
|
79
|
+
- lib/coco/cover/coverage_stat.rb
|
80
|
+
- lib/coco/formatter.rb
|
81
|
+
- lib/coco/formatter/colored_string.rb
|
35
82
|
- lib/coco/formatter/console_formatter.rb
|
36
|
-
- lib/coco/formatter/template.rb
|
37
83
|
- lib/coco/formatter/context.rb
|
38
|
-
- lib/coco/formatter/colored_string.rb
|
39
|
-
- lib/coco/formatter/html_index_formatter.rb
|
40
84
|
- lib/coco/formatter/formatter.rb
|
41
85
|
- lib/coco/formatter/html_formatter.rb
|
42
|
-
- lib/coco/
|
86
|
+
- lib/coco/formatter/html_index_formatter.rb
|
87
|
+
- lib/coco/formatter/template.rb
|
43
88
|
- lib/coco/helpers.rb
|
44
|
-
- lib/coco/
|
45
|
-
- lib/coco/
|
89
|
+
- lib/coco/lister.rb
|
90
|
+
- lib/coco/lister/source_lister.rb
|
91
|
+
- lib/coco/lister/uncovered_lister.rb
|
92
|
+
- lib/coco/writer.rb
|
46
93
|
- lib/coco/writer/file_writer.rb
|
47
|
-
- lib/coco/writer/html_files_writer.rb
|
48
94
|
- lib/coco/writer/html_directory.rb
|
95
|
+
- lib/coco/writer/html_files_writer.rb
|
49
96
|
- lib/coco/writer/html_index_writer.rb
|
50
|
-
- lib/coco/formatter.rb
|
51
|
-
- template/file.erb
|
52
|
-
- template/index.erb
|
53
97
|
- template/css/coco.css
|
54
|
-
- template/
|
98
|
+
- template/file.erb
|
55
99
|
- template/img/coconut16.png
|
56
|
-
-
|
57
|
-
-
|
58
|
-
- README.markdown
|
59
|
-
- Changelog.markdown
|
60
|
-
- Gemfile
|
61
|
-
- Rakefile
|
62
|
-
- TODO
|
63
|
-
- Gemfile.lock
|
100
|
+
- template/img/licenses
|
101
|
+
- template/index.erb
|
64
102
|
homepage: http://lkdjiin.github.com/coco/
|
65
103
|
licenses:
|
66
104
|
- GPL-3
|
@@ -71,18 +109,19 @@ require_paths:
|
|
71
109
|
- lib
|
72
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
111
|
requirements:
|
74
|
-
- -
|
112
|
+
- - ">="
|
75
113
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.9.
|
114
|
+
version: 1.9.3
|
77
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
116
|
requirements:
|
79
|
-
- -
|
117
|
+
- - ">="
|
80
118
|
- !ruby/object:Gem::Version
|
81
119
|
version: '0'
|
82
120
|
requirements: []
|
83
121
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.1
|
122
|
+
rubygems_version: 2.2.0.rc.1
|
85
123
|
signing_key:
|
86
124
|
specification_version: 4
|
87
|
-
summary: Code coverage tool for ruby 1.9.
|
125
|
+
summary: Code coverage tool for ruby 1.9.3 to 2.1
|
88
126
|
test_files: []
|
127
|
+
has_rdoc:
|