packaging_rake_tasks 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/packaging/configuration.rb +4 -0
- data/lib/tasks/check_doc.rake +66 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07be7d847721fb9cd00e02a81a61181036ea3c95
|
4
|
+
data.tar.gz: 40d1a420ffdc26ce7a72c66de362365684247428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4236b2291ea9d9a345650354b97647e132842d9c114e1eb71392111aa89f8e3b3dde0fda6f1fe20978fe0ce51989f86a87266ffbcbebcec54f63134bc13f0d3b
|
7
|
+
data.tar.gz: 427112492ed7493be6d74be0a4f7aad8c9fc666ac6f584955f134ee1ee6ebad8279883bb117b9062308eadb2cf3ed62fb4cac6b9650d132f821a87d1231bebf6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
@@ -30,6 +30,7 @@ module Packaging
|
|
30
30
|
@obs_target = "openSUSE_Factory"
|
31
31
|
@skip_license_check = []
|
32
32
|
@maintenance_mode = false
|
33
|
+
@documentation_minimal = 0
|
33
34
|
end
|
34
35
|
|
35
36
|
#custom package name, by default directory name
|
@@ -58,6 +59,9 @@ module Packaging
|
|
58
59
|
attr_accessor :skip_license_check
|
59
60
|
# Specify if project is in maintenance mode. If so, then it create maintenance request instead of pull request
|
60
61
|
attr_accessor :maintenance_mode
|
62
|
+
# Minimal documentation coverage to pass check:doc
|
63
|
+
# Default value is 0.
|
64
|
+
attr_accessor :documentation_minimal
|
61
65
|
|
62
66
|
def package_name
|
63
67
|
@package_name ||= Dir.pwd.split("/").last
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright (C) 2017 SUSE LLC
|
2
|
+
# This library is free software; you can redistribute it and/or modify
|
3
|
+
# it only under the terms of version 2.1 of the GNU Lesser General Public
|
4
|
+
# License as published by the Free Software Foundation.
|
5
|
+
#
|
6
|
+
# This library is distributed in the hope that it will be useful, but WITHOUT
|
7
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
8
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
9
|
+
# details.
|
10
|
+
#
|
11
|
+
# You should have received a copy of the GNU Lesser General Public
|
12
|
+
# License along with this library; if not, contact SUSE LLC.
|
13
|
+
#
|
14
|
+
# To contact SUSE LLC about this file by physical or electronic mail, you may
|
15
|
+
# find current contact information at www.suse.com.
|
16
|
+
|
17
|
+
require "packaging/configuration"
|
18
|
+
|
19
|
+
def check_doc_output
|
20
|
+
ENV["LANG"] = "C"
|
21
|
+
puts "Generating documentation..." if verbose
|
22
|
+
result = `yardoc`
|
23
|
+
if $?.exitstatus != 0
|
24
|
+
raise "yardoc failed"
|
25
|
+
end
|
26
|
+
|
27
|
+
puts result if verbose
|
28
|
+
|
29
|
+
lines = result.lines
|
30
|
+
|
31
|
+
warn_lines = lines.grep(/\[warn\]:/)
|
32
|
+
if !warn_lines.empty?
|
33
|
+
raise "There are #{warn_lines.size} warning/-s in yardoc output"
|
34
|
+
end
|
35
|
+
|
36
|
+
coverage_line = lines.grep(/% documented/).first
|
37
|
+
if !coverage_line
|
38
|
+
raise "Sorry, output format of yardoc changed. Please report issue for packaging rake tasks "\
|
39
|
+
" and include output of your yardoc and its version"
|
40
|
+
end
|
41
|
+
|
42
|
+
coverage = coverage_line[/(\d+\.?\d*)% documented/, 1].to_f
|
43
|
+
if coverage < Packaging::Configuration.instance.documentation_minimal
|
44
|
+
raise "Too low documentation coverage #{coverage}%."
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def check_doc
|
49
|
+
if !File.exist?(".yardopts")
|
50
|
+
puts ".yardopts not found, skipping documentation check"
|
51
|
+
return
|
52
|
+
end
|
53
|
+
|
54
|
+
if !system("which", "yardoc")
|
55
|
+
raise "yardoc not found"
|
56
|
+
end
|
57
|
+
|
58
|
+
check_doc_output
|
59
|
+
end
|
60
|
+
|
61
|
+
namespace "check" do
|
62
|
+
desc "Check for errors in documentation and minimal coverage (supported: rubydoc)"
|
63
|
+
task :doc do
|
64
|
+
check_doc
|
65
|
+
end
|
66
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packaging_rake_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- lib/packaging/tasks.rb
|
39
39
|
- lib/tasks/check_changelog.rake
|
40
40
|
- lib/tasks/check_committed.rake
|
41
|
+
- lib/tasks/check_doc.rake
|
41
42
|
- lib/tasks/check_license.rake
|
42
43
|
- lib/tasks/check_osc.rake
|
43
44
|
- lib/tasks/check_syntax.rake
|
@@ -64,10 +65,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
67
|
rubyforge_project:
|
67
|
-
rubygems_version: 2.
|
68
|
+
rubygems_version: 2.4.5.2
|
68
69
|
signing_key:
|
69
70
|
specification_version: 4
|
70
71
|
summary: Rake tasks providing tasks to package project in git and integration with
|
71
72
|
build service
|
72
73
|
test_files: []
|
73
|
-
has_rdoc:
|