hoe-manns 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +234 -229
- data/CONTRIBUTING.md +31 -35
- data/LICENSE.md +635 -635
- data/MAINTENANCE.md +18 -18
- data/README.md +88 -89
- data/lib/hoe/manns-methods.rb +71 -71
- data/lib/hoe/manns.rb +104 -104
- data/lib/hoe/version.rb +35 -35
- data/spec/manns_spec.rb +37 -37
- data/spec/spec_helper.rb +21 -21
- metadata +17 -24
data/MAINTENANCE.md
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
# MAINTENANCE POLICY:
|
2
|
-
|
3
|
-
I'm following the Semantic Versioning for its releases: (Major).(Minor).(Patch).
|
4
|
-
|
5
|
-
* Major version: Whenever there is something significant or any backwards
|
6
|
-
incompatible changes.
|
7
|
-
* Minor version: When new, backwards compatible functionality is introduced a
|
8
|
-
minor feature is introduced, or when a set of smaller features is rolled out.
|
9
|
-
* Patch number: When backwards compatible bug fixes are introduced that fix
|
10
|
-
incorrect behavior.
|
11
|
-
* The current stable release will receive security patches and bug fixes
|
12
|
-
(eg. 5.0 -> 5.0.1).
|
13
|
-
* Feature releases will mark the next supported stable release where the minor
|
14
|
-
version is increased numerically by increments of one (eg. 5.0 -> 5.1).
|
15
|
-
|
16
|
-
I encourage everyone to run the latest stable release to ensure that you can
|
17
|
-
easily upgrade to the most secure and feature rich experience. In order to
|
18
|
-
make sure you can easily run the most recent stable release, we are working
|
1
|
+
# MAINTENANCE POLICY:
|
2
|
+
|
3
|
+
I'm following the Semantic Versioning for its releases: (Major).(Minor).(Patch).
|
4
|
+
|
5
|
+
* Major version: Whenever there is something significant or any backwards
|
6
|
+
incompatible changes.
|
7
|
+
* Minor version: When new, backwards compatible functionality is introduced a
|
8
|
+
minor feature is introduced, or when a set of smaller features is rolled out.
|
9
|
+
* Patch number: When backwards compatible bug fixes are introduced that fix
|
10
|
+
incorrect behavior.
|
11
|
+
* The current stable release will receive security patches and bug fixes
|
12
|
+
(eg. 5.0 -> 5.0.1).
|
13
|
+
* Feature releases will mark the next supported stable release where the minor
|
14
|
+
version is increased numerically by increments of one (eg. 5.0 -> 5.1).
|
15
|
+
|
16
|
+
I encourage everyone to run the latest stable release to ensure that you can
|
17
|
+
easily upgrade to the most secure and feature rich experience. In order to
|
18
|
+
make sure you can easily run the most recent stable release, we are working
|
19
19
|
hard to keep the update process simple and reliable.
|
data/README.md
CHANGED
@@ -1,90 +1,89 @@
|
|
1
|
-
# hoe-manns
|
2
|
-
|
3
|
-
## DESCRIPTION:
|
4
|
-
|
5
|
-
hoe-manns is a small collection of my personal used rake tasks for using with hoe. Actually it includes that tasks:
|
6
|
-
|
7
|
-
* bundler:gemfile_lock
|
8
|
-
* bundle_audit:*
|
9
|
-
* clean_pkg
|
10
|
-
* copy_master
|
11
|
-
* remove_pre_gemspec
|
12
|
-
* run_before_release
|
13
|
-
* run_after_release
|
14
|
-
|
15
|
-
The CHANGELOG.md contains a detailed description of what has changed.
|
16
|
-
|
17
|
-
hoe-manns is released under the GPL-3.0-or-later License, see the file 'LICENSE.md' for more information.
|
18
|
-
|
19
|
-
|What | Where |
|
20
|
-
|-----|--------|
|
21
|
-
|codebase | https://github.com/saigkill/hoe-manns |
|
22
|
-
|rdoc | http://www.rubydoc.info/gems/hoe-manns |
|
23
|
-
|docs | https://github.com/saigkill/hoe-manns/wiki |
|
24
|
-
|bugs & feature requests | https://github.com/saigkill/hoe-manns/issues |
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
|
32
|
-
|downloads
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
*
|
48
|
-
*
|
49
|
-
*
|
50
|
-
* runs
|
51
|
-
*
|
52
|
-
*
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
*
|
58
|
-
*
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
1
|
+
# hoe-manns
|
2
|
+
|
3
|
+
## DESCRIPTION:
|
4
|
+
|
5
|
+
hoe-manns is a small collection of my personal used rake tasks for using with hoe. Actually it includes that tasks:
|
6
|
+
|
7
|
+
* bundler:gemfile_lock
|
8
|
+
* bundle_audit:*
|
9
|
+
* clean_pkg
|
10
|
+
* copy_master
|
11
|
+
* remove_pre_gemspec
|
12
|
+
* run_before_release
|
13
|
+
* run_after_release
|
14
|
+
|
15
|
+
The CHANGELOG.md contains a detailed description of what has changed.
|
16
|
+
|
17
|
+
hoe-manns is released under the GPL-3.0-or-later License, see the file 'LICENSE.md' for more information.
|
18
|
+
|
19
|
+
|What | Where |
|
20
|
+
|-----|--------|
|
21
|
+
|codebase | https://github.com/saigkill/hoe-manns |
|
22
|
+
|rdoc | http://www.rubydoc.info/gems/hoe-manns |
|
23
|
+
|docs | https://github.com/saigkill/hoe-manns/wiki |
|
24
|
+
|bugs & feature requests | https://github.com/saigkill/hoe-manns/issues |
|
25
|
+
|openhub statistics| https://www.openhub.net/p/hoe-manns |
|
26
|
+
|authors blog| https://saschamanns.de/ |
|
27
|
+
|
28
|
+
| What | Status |
|
29
|
+
|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
30
|
+
|last public version | [![Last Version](https://badge.fury.io/rb/hoe-manns.png)](http://rubygems.org/gems/hoe-manns) |
|
31
|
+
|downloads latest | [![Downloads latest](https://img.shields.io/gem/dtv/hoe-manns.svg)](http://rubygems.org/gems/hoe-manns) |
|
32
|
+
|downloads all | [![Downloads all](https://img.shields.io/gem/dt/hoe-manns.svg)](http://rubygems.org/gems/hoe-manns) |
|
33
|
+
|continuous integration | ![CI](https://github.com/saigkill/hoe-manns/workflows/CI/badge.svg?branch=master&event=push) |
|
34
|
+
|code quality | [![Code Quality](https://api.codeclimate.com/v1/badges/009b795034d7c698c74f/maintainability)](https://codeclimate.com/github/saigkill/hoe-manns/maintainability) |
|
35
|
+
|dependencies|[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=saigkill/hoe-manns)](https://dependabot.com)
|
36
|
+
|security | [![Security](https://hakiri.io/github/saigkill/hoe-manns/master.svg)](https://hakiri.io/github/saigkill/hoe-manns/master/shield) |
|
37
|
+
|vulnerabilities|[![Known Vulnerabilities](https://snyk.io/test/github/saigkill/hoe-manns/badge.svg?targetFile=Gemfile.lock)](https://snyk.io/test/github/saigkill/hoe-manns?targetFile=Gemfile.lock) |
|
38
|
+
|documentation quality | [![Documentation Quality](https://inch-ci.org/github/saigkill/hoe-manns.svg?branch=master)](https://inch-ci.org/github/saigkill/hoe-manns) |
|
39
|
+
|
40
|
+
## SCREENSHOT
|
41
|
+
|
42
|
+
[![Screenshot](https://saschamanns.de/img/screenshots/hoe-manns-screenshots.png)](https://github.com/saigkill/hoe-manns)
|
43
|
+
|
44
|
+
## FEATURES:
|
45
|
+
|
46
|
+
* Updates the Gemfile.lock
|
47
|
+
* Removes the old *.gemspec created in test cases
|
48
|
+
* copies your manuals to your docpath.
|
49
|
+
* runs the rake tasks before release: git:manifest, bundler:gemfile, update_gemfile_lock, remove_pre_gemspec, bundler_audit:run and copy_mirror.
|
50
|
+
* runs after release: send_email.
|
51
|
+
* Cleans up the pkg dir
|
52
|
+
* provides bundler_audit tasks
|
53
|
+
|
54
|
+
## REQUIREMENTS:
|
55
|
+
|
56
|
+
* rake
|
57
|
+
* hoe
|
58
|
+
* bundler-audit
|
59
|
+
|
60
|
+
## INSTALL:
|
61
|
+
|
62
|
+
The installation is very easy.
|
63
|
+
|
64
|
+
gem install hoe-manns
|
65
|
+
|
66
|
+
## SYNOPSIS:
|
67
|
+
|
68
|
+
Use in your Rakefile:
|
69
|
+
|
70
|
+
Hoe.plugin :manns
|
71
|
+
|
72
|
+
Hoe.spec 'your project' do
|
73
|
+
...
|
74
|
+
end
|
75
|
+
|
76
|
+
Also add hoe-manns to your requirements and recreate your Gemfile.
|
77
|
+
|
78
|
+
## DEVELOPERS:
|
79
|
+
|
80
|
+
After checking out the source, run:
|
81
|
+
|
82
|
+
$ rake newb
|
83
|
+
|
84
|
+
This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
|
85
|
+
Also you can read the MAINTENANCE.md and CONTRIBUTING.md for more information.
|
86
|
+
|
87
|
+
## ISSUE TRACKING:
|
88
|
+
|
90
89
|
* Add ideas on: https://github.com/saigkill/hoe-manns/issues
|
data/lib/hoe/manns-methods.rb
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
|
-
# Dependencies
|
17
|
-
require 'rainbow/ext/string'
|
18
|
-
|
19
|
-
# Module Hoe
|
20
|
-
# TODO: Try to fix this in future
|
21
|
-
# rubocop:disable Metrics/ClassAndModuleChildren
|
22
|
-
module Hoe::MannsMethods
|
23
|
-
# Installs a bundle
|
24
|
-
def self.bundle_install
|
25
|
-
puts 'Installing Bundle'.color(:yellow)
|
26
|
-
system('bundle install')
|
27
|
-
puts 'Installed Bundle'.color(:green)
|
28
|
-
end
|
29
|
-
|
30
|
-
# Update Gemfile.lock
|
31
|
-
def self.update_gemfile_lock_method
|
32
|
-
puts 'Updating Gemfile.lock'.color(:yellow)
|
33
|
-
system('bundle update')
|
34
|
-
puts 'Updated Gemfile.lock'.color(:green)
|
35
|
-
end
|
36
|
-
|
37
|
-
# Remove prerelease gemspec
|
38
|
-
def self.remove_pre_gemspec_method
|
39
|
-
puts 'Removing pre version of gemspec'.color(:yellow)
|
40
|
-
File.delete(*Dir.glob('*.gemspec'))
|
41
|
-
puts 'Removed'.color(:green)
|
42
|
-
end
|
43
|
-
|
44
|
-
# Copying stuff to master
|
45
|
-
def self.copy_master
|
46
|
-
copy_master_co_master
|
47
|
-
puts 'Set a Git Tag'.color(:yellow)
|
48
|
-
system('rake git:tag')
|
49
|
-
puts 'Checking out develop again'.color(:yellow)
|
50
|
-
system('git checkout develop')
|
51
|
-
puts 'Done'.color(:green)
|
52
|
-
end
|
53
|
-
|
54
|
-
# Check out master
|
55
|
-
def self.copy_master_co_master
|
56
|
-
puts 'Checking out master'.color(:yellow)
|
57
|
-
system('git checkout master')
|
58
|
-
puts 'Merging master with develop'.color(:yellow)
|
59
|
-
system('git merge develop')
|
60
|
-
puts 'Pushing master to origin'.color(:yellow)
|
61
|
-
system('git push')
|
62
|
-
end
|
63
|
-
|
64
|
-
# Cleanup the pkg
|
65
|
-
def self.clean_pkg_method
|
66
|
-
puts 'Cleaning pkg'.color(:yellow)
|
67
|
-
FileUtils.rm_rf('pkg') if Dir.exist?('pkg')
|
68
|
-
FileUtils.rm_rf('recipes/pkg') if Dir.exist?('recipes/pkg')
|
69
|
-
puts 'Cleanup succeed'.color(:green)
|
70
|
-
end
|
71
|
-
end
|
1
|
+
# Copyright (C) 2013-2020 Sascha Manns <Sascha.Manns@outlook.de>
|
2
|
+
#
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
# Dependencies
|
17
|
+
require 'rainbow/ext/string'
|
18
|
+
|
19
|
+
# Module Hoe
|
20
|
+
# TODO: Try to fix this in future
|
21
|
+
# rubocop:disable Metrics/ClassAndModuleChildren
|
22
|
+
module Hoe::MannsMethods
|
23
|
+
# Installs a bundle
|
24
|
+
def self.bundle_install
|
25
|
+
puts 'Installing Bundle'.color(:yellow)
|
26
|
+
system('bundle install')
|
27
|
+
puts 'Installed Bundle'.color(:green)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Update Gemfile.lock
|
31
|
+
def self.update_gemfile_lock_method
|
32
|
+
puts 'Updating Gemfile.lock'.color(:yellow)
|
33
|
+
system('bundle update')
|
34
|
+
puts 'Updated Gemfile.lock'.color(:green)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Remove prerelease gemspec
|
38
|
+
def self.remove_pre_gemspec_method
|
39
|
+
puts 'Removing pre version of gemspec'.color(:yellow)
|
40
|
+
File.delete(*Dir.glob('*.gemspec'))
|
41
|
+
puts 'Removed'.color(:green)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Copying stuff to master
|
45
|
+
def self.copy_master
|
46
|
+
copy_master_co_master
|
47
|
+
puts 'Set a Git Tag'.color(:yellow)
|
48
|
+
system('rake git:tag')
|
49
|
+
puts 'Checking out develop again'.color(:yellow)
|
50
|
+
system('git checkout develop')
|
51
|
+
puts 'Done'.color(:green)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Check out master
|
55
|
+
def self.copy_master_co_master
|
56
|
+
puts 'Checking out master'.color(:yellow)
|
57
|
+
system('git checkout master')
|
58
|
+
puts 'Merging master with develop'.color(:yellow)
|
59
|
+
system('git merge develop')
|
60
|
+
puts 'Pushing master to origin'.color(:yellow)
|
61
|
+
system('git push')
|
62
|
+
end
|
63
|
+
|
64
|
+
# Cleanup the pkg
|
65
|
+
def self.clean_pkg_method
|
66
|
+
puts 'Cleaning pkg'.color(:yellow)
|
67
|
+
FileUtils.rm_rf('pkg') if Dir.exist?('pkg')
|
68
|
+
FileUtils.rm_rf('recipes/pkg') if Dir.exist?('recipes/pkg')
|
69
|
+
puts 'Cleanup succeed'.color(:green)
|
70
|
+
end
|
71
|
+
end
|
data/lib/hoe/manns.rb
CHANGED
@@ -1,104 +1,104 @@
|
|
1
|
-
# Copyright (C) 2013-
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
|
-
# Dependencies
|
17
|
-
require 'hoe'
|
18
|
-
require_relative 'manns-methods.rb'
|
19
|
-
|
20
|
-
# Main module Hoe
|
21
|
-
# TODO: Currently i don't know how to fix this.
|
22
|
-
# Nested usage triggers error "hoe not a module"
|
23
|
-
# rubocop:disable Metrics/ClassAndModuleChildren
|
24
|
-
module Hoe::Manns
|
25
|
-
|
26
|
-
attr_accessor :remove_pre_gemspec
|
27
|
-
attr_accessor :copy_master
|
28
|
-
attr_accessor :run_before_release
|
29
|
-
attr_accessor :clean_pkg
|
30
|
-
attr_accessor :bundle_audit
|
31
|
-
|
32
|
-
# Initialize plugin
|
33
|
-
def initialize_manns
|
34
|
-
require 'fileutils'
|
35
|
-
require 'rainbow/ext/string'
|
36
|
-
require 'bundler/audit/cli'
|
37
|
-
end
|
38
|
-
|
39
|
-
# Definitions of the Rake task
|
40
|
-
# TODO: Check if this smells can be pacified in future
|
41
|
-
# rubocop:disable Metrics/AbcSize
|
42
|
-
# rubocop:disable Metrics/MethodLength
|
43
|
-
# This method smells of :reek:TooManyStatements
|
44
|
-
def define_manns_tasks
|
45
|
-
# Install a Bundle
|
46
|
-
desc 'Install a Bundle'
|
47
|
-
task 'bundler:gemfile_install' do
|
48
|
-
Hoe::MannsMethods.bundle_install
|
49
|
-
end
|
50
|
-
|
51
|
-
# Task for updating Gemfile.lock
|
52
|
-
desc 'Update Gemfile.lock'
|
53
|
-
task 'bundler:gemfile_lock' do
|
54
|
-
Hoe::MannsMethods.update_gemfile_lock_method
|
55
|
-
end
|
56
|
-
|
57
|
-
# Task for removing Prerelease Gemspecs
|
58
|
-
desc 'Remove Pre-Gemspec'
|
59
|
-
task 'gem:spec_remove' do
|
60
|
-
Hoe::MannsMethods.remove_pre_gemspec_method
|
61
|
-
end
|
62
|
-
|
63
|
-
# Task for git tag
|
64
|
-
desc 'Copy master'
|
65
|
-
task :copy_master do
|
66
|
-
Hoe::MannsMethods.copy_master
|
67
|
-
end
|
68
|
-
|
69
|
-
# Task for running needed Rake Tasks before running rake release
|
70
|
-
desc 'Run all tasks before rake release'
|
71
|
-
task run_before_release:
|
72
|
-
%w[git:manifest bundler:gemfile bundler:gemfile_lock gem:spec_remove bundle_audit:run copy_master] do
|
73
|
-
puts 'Ready to run rake release VERSION=x.y.z'.color(:green)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Task for cleaning up the pkg
|
77
|
-
desc 'Clean pkg'
|
78
|
-
task :clean_pkg do
|
79
|
-
Hoe::MannsMethods.clean_pkg_method
|
80
|
-
end
|
81
|
-
|
82
|
-
# Tasks for bundle audit
|
83
|
-
namespace :bundle_audit do
|
84
|
-
desc 'Update bundle-audit database'
|
85
|
-
task :update do
|
86
|
-
Bundler::Audit::CLI.new.update
|
87
|
-
end
|
88
|
-
|
89
|
-
desc 'Check gems for vulns using bundle-audit'
|
90
|
-
task :check do
|
91
|
-
Bundler::Audit::CLI.new.check
|
92
|
-
end
|
93
|
-
|
94
|
-
desc 'Update vulns database and check gems using bundle-audit'
|
95
|
-
task :run do
|
96
|
-
Rake::Task['bundle_audit:update'].invoke
|
97
|
-
Rake::Task['bundle_audit:check'].invoke
|
98
|
-
end
|
99
|
-
end
|
100
|
-
task :bundle_audit do
|
101
|
-
Rake::Task['bundle_audit:run'].invoke
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
1
|
+
# Copyright (C) 2013-2020 Sascha Manns <Sascha.Manns@outlook.de>
|
2
|
+
#
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
# Dependencies
|
17
|
+
require 'hoe'
|
18
|
+
require_relative 'manns-methods.rb'
|
19
|
+
|
20
|
+
# Main module Hoe
|
21
|
+
# TODO: Currently i don't know how to fix this.
|
22
|
+
# Nested usage triggers error "hoe not a module"
|
23
|
+
# rubocop:disable Metrics/ClassAndModuleChildren
|
24
|
+
module Hoe::Manns
|
25
|
+
|
26
|
+
attr_accessor :remove_pre_gemspec
|
27
|
+
attr_accessor :copy_master
|
28
|
+
attr_accessor :run_before_release
|
29
|
+
attr_accessor :clean_pkg
|
30
|
+
attr_accessor :bundle_audit
|
31
|
+
|
32
|
+
# Initialize plugin
|
33
|
+
def initialize_manns
|
34
|
+
require 'fileutils'
|
35
|
+
require 'rainbow/ext/string'
|
36
|
+
require 'bundler/audit/cli'
|
37
|
+
end
|
38
|
+
|
39
|
+
# Definitions of the Rake task
|
40
|
+
# TODO: Check if this smells can be pacified in future
|
41
|
+
# rubocop:disable Metrics/AbcSize
|
42
|
+
# rubocop:disable Metrics/MethodLength
|
43
|
+
# This method smells of :reek:TooManyStatements
|
44
|
+
def define_manns_tasks
|
45
|
+
# Install a Bundle
|
46
|
+
desc 'Install a Bundle'
|
47
|
+
task 'bundler:gemfile_install' do
|
48
|
+
Hoe::MannsMethods.bundle_install
|
49
|
+
end
|
50
|
+
|
51
|
+
# Task for updating Gemfile.lock
|
52
|
+
desc 'Update Gemfile.lock'
|
53
|
+
task 'bundler:gemfile_lock' do
|
54
|
+
Hoe::MannsMethods.update_gemfile_lock_method
|
55
|
+
end
|
56
|
+
|
57
|
+
# Task for removing Prerelease Gemspecs
|
58
|
+
desc 'Remove Pre-Gemspec'
|
59
|
+
task 'gem:spec_remove' do
|
60
|
+
Hoe::MannsMethods.remove_pre_gemspec_method
|
61
|
+
end
|
62
|
+
|
63
|
+
# Task for git tag
|
64
|
+
desc 'Copy master'
|
65
|
+
task :copy_master do
|
66
|
+
Hoe::MannsMethods.copy_master
|
67
|
+
end
|
68
|
+
|
69
|
+
# Task for running needed Rake Tasks before running rake release
|
70
|
+
desc 'Run all tasks before rake release'
|
71
|
+
task run_before_release:
|
72
|
+
%w[git:manifest bundler:gemfile bundler:gemfile_lock gem:spec_remove bundle_audit:run copy_master] do
|
73
|
+
puts 'Ready to run rake release VERSION=x.y.z'.color(:green)
|
74
|
+
end
|
75
|
+
|
76
|
+
# Task for cleaning up the pkg
|
77
|
+
desc 'Clean pkg'
|
78
|
+
task :clean_pkg do
|
79
|
+
Hoe::MannsMethods.clean_pkg_method
|
80
|
+
end
|
81
|
+
|
82
|
+
# Tasks for bundle audit
|
83
|
+
namespace :bundle_audit do
|
84
|
+
desc 'Update bundle-audit database'
|
85
|
+
task :update do
|
86
|
+
Bundler::Audit::CLI.new.update
|
87
|
+
end
|
88
|
+
|
89
|
+
desc 'Check gems for vulns using bundle-audit'
|
90
|
+
task :check do
|
91
|
+
Bundler::Audit::CLI.new.check
|
92
|
+
end
|
93
|
+
|
94
|
+
desc 'Update vulns database and check gems using bundle-audit'
|
95
|
+
task :run do
|
96
|
+
Rake::Task['bundle_audit:update'].invoke
|
97
|
+
Rake::Task['bundle_audit:check'].invoke
|
98
|
+
end
|
99
|
+
end
|
100
|
+
task :bundle_audit do
|
101
|
+
Rake::Task['bundle_audit:run'].invoke
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|