coco 0.7 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f4847ff78acaa2ce2a70782c03f6342cfede232c
4
+ data.tar.gz: 863abb4beb5bd5a2907188569665376ddbd4f75c
5
+ SHA512:
6
+ metadata.gz: d5c4948cef5ed25267d818689f0ee6192775f5222fde27fcd0386e1035f672bcbb7ac60393536fbeb6d0f397b35b076a0a0b1de8a27866cc221b25004b276135
7
+ data.tar.gz: b041d09237e6177502d9336230a55369848be9387ba50a00dbf92e99575679926f937df2fdd320d39306611966dd26de1b6b8e415848179564298402c1888819
data/Changelog.markdown CHANGED
@@ -1,10 +1,18 @@
1
+ v0.7.1 (2013-07-05)
2
+ =================================================
3
+
4
+ * Bugfix: Output a nicer message on bad config
5
+ * Bugfix: Threshold misspelling. Preserving compatibility for the
6
+ "threeshold" spelling too.
7
+
8
+
1
9
  v0.7 (2013-06-19)
2
10
  =================================================
3
11
 
4
12
  * Bugfix: single_line_report option is now silent if there is nothing to
5
13
  report
6
14
  * Improve report styling (a bit)
7
- * Default threeshold is now 100%
15
+ * Default threshold is now 100%
8
16
  * Config file is renamed to '.coco.yml', to benefit of syntax highlighting
9
17
 
10
18
 
@@ -54,7 +62,7 @@ v0.3 (2011-02-25)
54
62
  =================================================
55
63
 
56
64
  * Report sources not covered at all
57
- * Configurable via a simple yaml file: threeshold and source directories
65
+ * Configurable via a simple yaml file: threshold and source directories
58
66
  * UTF-8 compliant
59
67
  * Misc: sort index.html and console output by percentage, Display
60
68
  version in index.html
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rake'
6
+ gem 'rspec'
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ coco (0.7.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.4)
10
+ rake (10.0.4)
11
+ rspec (2.13.0)
12
+ rspec-core (~> 2.13.0)
13
+ rspec-expectations (~> 2.13.0)
14
+ rspec-mocks (~> 2.13.0)
15
+ rspec-core (2.13.1)
16
+ rspec-expectations (2.13.0)
17
+ diff-lcs (>= 1.1.3, < 2.0)
18
+ rspec-mocks (2.13.1)
19
+
20
+ PLATFORMS
21
+ ruby
22
+
23
+ DEPENDENCIES
24
+ coco!
25
+ rake
26
+ rspec
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- 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)
2
2
  ==============================
3
3
 
4
4
  Code coverage tool for ruby 1.9.2, 1.9.3 and 2.0.
@@ -57,12 +57,12 @@ Configuration
57
57
 
58
58
  Configuration is done via a YAML file. You can configure:
59
59
 
60
- * __threeshold__: the percentage threeshold
60
+ * __threshold__: the percentage threshold
61
61
  * __directories__: the directories from where coco will search for untested source files
62
62
  * __excludes__: a list of files to exclude from the report
63
63
  * __single_line_report__: the report's style
64
64
 
65
- By default, threeshold is set to 100 and directories is set to 'lib'.
65
+ By default, threshold is set to 100 and directories is set to 'lib'.
66
66
 
67
67
  To change the default coco configuration, put a `.coco.yml` file at the root of your project.
68
68
 
@@ -106,3 +106,5 @@ Contributors
106
106
  --------------------------------
107
107
 
108
108
  [sunaku (Suraj N. Kurapati)](https://github.com/sunaku)
109
+
110
+ [Daniel Rice](https://github.com/BigNerdRanchDan)
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
+ require 'rake/dsl_definition'
3
4
  require 'rake'
4
5
  require 'rspec/core/rake_task'
5
6
 
data/TODO CHANGED
@@ -1,12 +1,10 @@
1
- travis: 1.9.2, 1.9.3, 2.0.0
1
+ release
2
+
3
+ site
2
4
 
3
5
  exclure spec et test par défaut
4
6
 
5
7
  le wiki dit que seul le dossier lib est inspecté par défaut, je pense
6
8
  que c'est en fait toute l'application.
7
9
 
8
- améliorer un poil le site + analytics
9
-
10
- -----------------------
11
-
12
10
  Virer les css de yahoo
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7
1
+ 0.7.1
@@ -6,22 +6,22 @@ module Coco
6
6
 
7
7
  # I know the configuration of coco.
8
8
  #
9
- # @example read the threeshold value
9
+ # @example read the threshold value
10
10
  # config = Configuration.new
11
- # config[:threeshold]
11
+ # config[:threshold]
12
12
  # => 90
13
13
  #
14
14
  # You can override the default configuration by putting a '.coco' file
15
15
  # in YAML format in the project root directory.
16
- # @example to override the threeshold put this line in a '.coco' file:
17
- # :threeshold: 70
16
+ # @example to override the threshold put this line in a '.coco' file:
17
+ # :threshold: 70
18
18
  #
19
- # @note You can set the threeshold above 100% (to be sure to see all files) but you
19
+ # @note You can set the threshold above 100% (to be sure to see all files) but you
20
20
  # cannot set it under 0.
21
21
  class Configuration < Hash
22
22
 
23
23
  def initialize
24
- self[:threeshold] = 100
24
+ self[:threshold] = 100
25
25
  self[:directories] = ['lib']
26
26
  self[:excludes] = []
27
27
  self[:single_line_report] = false
@@ -32,6 +32,8 @@ module Coco
32
32
  elsif File.exist?('.coco')
33
33
  self.merge!(YAML.load_file('.coco'))
34
34
  end
35
+
36
+ ensure_threeshold_compatibility
35
37
  expand_directories
36
38
  remove_directories
37
39
  end
@@ -51,6 +53,10 @@ module Coco
51
53
  def remove_directories
52
54
  self[:excludes].delete_if {|file_or_dir| File.directory?(file_or_dir)}
53
55
  end
56
+
57
+ def ensure_threeshold_compatibility
58
+ self[:threshold] = self[:threeshold] unless self[:threeshold].nil?
59
+ end
54
60
 
55
61
  end
56
62
 
@@ -8,19 +8,19 @@ module Coco
8
8
  attr_reader :all_from_domain
9
9
  # @return [Hash] Coverage for sources that are not sufficiently covered.
10
10
  # More technically, the sources that live in the root project folder and for
11
- # which the coverage percentage is under the threeshold.
11
+ # which the coverage percentage is under the threshold.
12
12
  attr_reader :covered_from_domain
13
13
 
14
14
  # @param [Hash] config
15
15
  # @param [Hash] raw_results Results obtained from Coverage.result
16
16
  def initialize config, raw_results
17
17
  @exclude_files = config[:excludes]
18
- @threeshold = config[:threeshold]
19
- raise ArgumentError if @threeshold < 0
18
+ @threshold = config[:threshold]
19
+ raise ArgumentError if @threshold < 0
20
20
  @result = raw_results
21
21
  exclude_external_sources
22
22
  exclude_files_user_dont_want
23
- exclude_sources_above_threeshold
23
+ exclude_sources_above_threshold
24
24
  end
25
25
 
26
26
  private
@@ -37,9 +37,9 @@ module Coco
37
37
  end
38
38
  end
39
39
 
40
- def exclude_sources_above_threeshold
40
+ def exclude_sources_above_threshold
41
41
  @covered_from_domain = @all_from_domain.select {|key, value|
42
- CoverageStat.coverage_percent(value) < @threeshold
42
+ CoverageStat.coverage_percent(value) < @threshold
43
43
  }
44
44
  end
45
45
 
@@ -14,7 +14,11 @@ module Coco
14
14
  else
15
15
  @folders = dirs
16
16
  end
17
- @folders.each {|folder| raise ArgumentError unless File.directory?(folder)}
17
+ @folders.each do |folder|
18
+ unless File.directory?(folder)
19
+ raise ArgumentError, "Not a folder: #{folder}"
20
+ end
21
+ end
18
22
  @list = []
19
23
  end
20
24
 
metadata CHANGED
@@ -1,92 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coco
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
5
- prerelease:
4
+ version: 0.7.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Xavier Nayrac
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-19 00:00:00.000000000 Z
11
+ date: 2013-07-05 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: ! '"Code coverage tool for ruby 1.9.2 to 2.0.
15
-
16
- Use it by "require ''coco''" from rspec or unit/test.
17
-
13
+ description: |-
14
+ "Code coverage tool for ruby 1.9.2 to 2.0.
15
+ Use it by "require 'coco'" from rspec or unit/test.
18
16
  It display names of uncovered files on console.
19
-
20
17
  It builds simple html report.
21
-
22
18
  It reports sources that have no tests.
23
-
24
- It''s configurable with a simple yaml file.'
19
+ It's configurable with a simple yaml file.
25
20
  email: xavier.nayrac@gmail.com
26
21
  executables: []
27
22
  extensions: []
28
23
  extra_rdoc_files: []
29
24
  files:
30
25
  - lib/coco.rb
31
- - lib/coco/writer.rb
32
- - lib/coco/lister/uncovered_lister.rb
33
- - lib/coco/lister/source_lister.rb
34
- - lib/coco/lister.rb
35
26
  - lib/coco/configuration.rb
27
+ - lib/coco/cover.rb
28
+ - lib/coco/cover/coverage_result.rb
29
+ - lib/coco/cover/coverage_stat.rb
30
+ - lib/coco/formatter.rb
31
+ - lib/coco/formatter/colored_string.rb
36
32
  - lib/coco/formatter/console_formatter.rb
37
- - lib/coco/formatter/template.rb
38
33
  - lib/coco/formatter/context.rb
39
- - lib/coco/formatter/colored_string.rb
40
- - lib/coco/formatter/html_index_formatter.rb
41
34
  - lib/coco/formatter/formatter.rb
42
35
  - lib/coco/formatter/html_formatter.rb
43
- - lib/coco/cover.rb
36
+ - lib/coco/formatter/html_index_formatter.rb
37
+ - lib/coco/formatter/template.rb
44
38
  - lib/coco/helpers.rb
45
- - lib/coco/cover/coverage_result.rb
46
- - lib/coco/cover/coverage_stat.rb
39
+ - lib/coco/lister.rb
40
+ - lib/coco/lister/source_lister.rb
41
+ - lib/coco/lister/uncovered_lister.rb
42
+ - lib/coco/writer.rb
47
43
  - lib/coco/writer/file_writer.rb
48
- - lib/coco/writer/html_files_writer.rb
49
44
  - lib/coco/writer/html_directory.rb
45
+ - lib/coco/writer/html_files_writer.rb
50
46
  - lib/coco/writer/html_index_writer.rb
51
- - lib/coco/formatter.rb
52
- - template/file.erb
53
- - template/index.erb
54
- - template/css/fonts-min.css
55
- - template/css/reset-min.css
56
- - template/css/coco.css
57
47
  - template/css/LICENCE
58
48
  - template/css/base-min.css
59
- - template/img/licenses
49
+ - template/css/coco.css
50
+ - template/css/fonts-min.css
51
+ - template/css/reset-min.css
52
+ - template/file.erb
60
53
  - template/img/coconut16.png
61
- - VERSION
54
+ - template/img/licenses
55
+ - template/index.erb
62
56
  - COPYING
63
- - README.markdown
64
57
  - Changelog.markdown
58
+ - Gemfile
59
+ - Gemfile.lock
60
+ - README.markdown
65
61
  - Rakefile
66
62
  - TODO
63
+ - VERSION
67
64
  homepage: http://lkdjiin.github.com/coco/
68
65
  licenses:
69
66
  - GPL-3
67
+ metadata: {}
70
68
  post_install_message:
71
69
  rdoc_options: []
72
70
  require_paths:
73
71
  - lib
74
72
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
73
  requirements:
77
- - - ! '>='
74
+ - - '>='
78
75
  - !ruby/object:Gem::Version
79
76
  version: 1.9.2
80
77
  required_rubygems_version: !ruby/object:Gem::Requirement
81
- none: false
82
78
  requirements:
83
- - - ! '>='
79
+ - - '>='
84
80
  - !ruby/object:Gem::Version
85
81
  version: '0'
86
82
  requirements: []
87
83
  rubyforge_project:
88
- rubygems_version: 1.8.25
84
+ rubygems_version: 2.0.3
89
85
  signing_key:
90
- specification_version: 3
86
+ specification_version: 4
91
87
  summary: Code coverage tool for ruby 1.9.2 to 2.0
92
88
  test_files: []
89
+ has_rdoc: