docstat 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/docstat +3 -1
- data/bin/docstat-test +3 -1
- data/lib/docstat.rb +3 -0
- data/lib/version.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4c4a9742e07f2ad0449ae0ea037f482524bec5e
|
4
|
+
data.tar.gz: 4bea10458a173884f61dcb40c4361922a6fb99cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c01f96f86bc6b602ae62977192d6a4a96fc48d2e0d33d1de597fdfedc1b56f38a7957ca4624c5ba6f3ac22c1159c3bd36b394363561e7ad3863484e59e7895da
|
7
|
+
data.tar.gz: 455c6e1cd9ebcb383e9e641f4750f1c38354a23fdb184e633c7deb7e801376e67d1829dc70da1c62d61d0c8aceb561078566a215d9a91d6e43a3b6c9b4e237a5
|
data/CHANGELOG.md
CHANGED
data/bin/docstat
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__), '../lib/docstat'))
|
4
4
|
|
5
|
-
if
|
5
|
+
if ARGV.include?('--version') || ARGV.include?('-v')
|
6
|
+
print "#{DocStat::VERSION}\n"
|
7
|
+
elsif docset_path = ARGV[0]
|
6
8
|
stats = DocStat.process(docset_path)
|
7
9
|
tokens = stats['containers'].map {|c| c['tokens']}.flatten
|
8
10
|
ratio = stats['ratio']
|
data/bin/docstat-test
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__), '../lib/docstat'))
|
4
4
|
|
5
|
-
if
|
5
|
+
if ARGV.include?('--version') || ARGV.include?('-v')
|
6
|
+
print "#{DocStat::VERSION}\n"
|
7
|
+
elsif docset_path = ARGV[0] and passing_ratio = (ARGV[1] || '0.9')
|
6
8
|
state = DocStat.test_ratio(docset_path, passing_ratio.to_f) ? 'PASSED' : 'FAILED'
|
7
9
|
print "Documentation coverage must be greater than or equal to #{passing_ratio.to_f * 100}%: #{state}"
|
8
10
|
exit(state ? 0 : 1)
|
data/lib/docstat.rb
CHANGED
@@ -2,6 +2,7 @@ $:.unshift File.expand_path('../../lib', __FILE__)
|
|
2
2
|
|
3
3
|
require 'sqlite3'
|
4
4
|
require 'docstat/container'
|
5
|
+
require 'version'
|
5
6
|
|
6
7
|
module DocStat
|
7
8
|
|
@@ -33,6 +34,8 @@ module DocStat
|
|
33
34
|
{ "containers" => containers.map(&:to_hash) , "ratio" => overall_ratio(containers) }
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns true if the coverage ratio of a docset at
|
38
|
+
# docset_path is greater than or equal to passing_ratio
|
36
39
|
def self.test_ratio docset_path, passing_ratio
|
37
40
|
containers = containers_from_docset(docset_path)
|
38
41
|
overall_ratio(containers) >= passing_ratio
|
data/lib/version.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docstat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delisa Mason
|
@@ -62,6 +62,7 @@ extensions: []
|
|
62
62
|
extra_rdoc_files:
|
63
63
|
- README.md
|
64
64
|
- CHANGELOG.md
|
65
|
+
- LICENSE
|
65
66
|
files:
|
66
67
|
- Gemfile
|
67
68
|
- LICENSE
|
@@ -70,9 +71,10 @@ files:
|
|
70
71
|
- bin/docstat
|
71
72
|
- bin/docstat-test
|
72
73
|
- lib/docstat.rb
|
74
|
+
- lib/version.rb
|
73
75
|
- lib/docstat/container.rb
|
74
76
|
- lib/docstat/token.rb
|
75
|
-
homepage: https://github.com/docstat
|
77
|
+
homepage: https://github.com/kattrali/docstat
|
76
78
|
licenses: []
|
77
79
|
metadata: {}
|
78
80
|
post_install_message:
|