docstat 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a81ecdb74a67ba1a5967c49a783931698d8ea7b9
4
- data.tar.gz: a257d38855848d5be991c0c91036850d20876b8b
3
+ metadata.gz: d4c4a9742e07f2ad0449ae0ea037f482524bec5e
4
+ data.tar.gz: 4bea10458a173884f61dcb40c4361922a6fb99cc
5
5
  SHA512:
6
- metadata.gz: 6a593a72575ab0702c2271eba71f51fa411336c0ec40dae756bca027af0a1658f802296b12e992a8055fa6cdc1800c12515648423c47eef6532444e7e49078d4
7
- data.tar.gz: f88dc4505a35140a5836ae89af37e6d37e04cf355a98068cf6650a9079dd3ca8d725e6d2f9fd24a08bada8ff45e1d616391c0f3a5aaffc403de5cdc482fd7896
6
+ metadata.gz: c01f96f86bc6b602ae62977192d6a4a96fc48d2e0d33d1de597fdfedc1b56f38a7957ca4624c5ba6f3ac22c1159c3bd36b394363561e7ad3863484e59e7895da
7
+ data.tar.gz: 455c6e1cd9ebcb383e9e641f4750f1c38354a23fdb184e633c7deb7e801376e67d1829dc70da1c62d61d0c8aceb561078566a215d9a91d6e43a3b6c9b4e237a5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.2
2
+
3
+ * Show current version with `--version` or `-v`
4
+
1
5
  # 1.0.1
2
6
 
3
7
  * Fix missing test binary
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 docset_path = ARGV[0]
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 docset_path = ARGV[0] and passing_ratio = (ARGV[1] || '0.9')
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
@@ -0,0 +1,3 @@
1
+ module DocStat
2
+ VERSION = '1.0.2'
3
+ end
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.1
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: