gem4rake 1.0.2 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/NOTICE +1 -1
- data/lib/gem4rake.rb +35 -31
- metadata +17 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e45d6169bce08be2a0211017c6becf9483b65c5a1669598783d4fcd3fd3fd6c
|
4
|
+
data.tar.gz: f78259e6894762ce908b431dd630704051f527cf41ff9af59a524e259c0368dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bffab2c7a78a105ea21639cfea4da31aa8b0b8c8aab6fbe524272d210e2209b99a34bd6689e7136f348365422fb3bb1041ee7dfdf5ca4ab376ea291c4f2fbd4a
|
7
|
+
data.tar.gz: dcd8805519f816d702532d763e78be3ed376b60764d6840cc2c9ac83f92d68b44b88780656c59489f78324e6656af8be4c5c6409fe6112afe3852d6420061b42
|
data/NOTICE
CHANGED
data/lib/gem4rake.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake/tasklib'
|
2
4
|
|
3
5
|
# Rake tasks to assist developing Ruby Gems.
|
4
6
|
#
|
5
7
|
# Gem's name must match current directory's basename.
|
6
|
-
#
|
7
8
|
# A `.spec` file with that name is also required.
|
8
9
|
#
|
9
10
|
# = Usage:
|
@@ -16,7 +17,7 @@ require 'rake/tasklib'
|
|
16
17
|
# = Example:
|
17
18
|
#
|
18
19
|
# $ rake -T
|
19
|
-
# rake build # Build autoup-1.0.4.gem
|
20
|
+
# rake build # Build autoup-1.0.4.gem
|
20
21
|
# rake clean # Delete autoup-*.gem
|
21
22
|
# rake cleanup # Cleanup autoup gems
|
22
23
|
# rake install # Install autoup-1.0.4.gem
|
@@ -25,38 +26,52 @@ require 'rake/tasklib'
|
|
25
26
|
#
|
26
27
|
# = Notes:
|
27
28
|
#
|
28
|
-
#
|
29
|
-
# * `SUDO=false` env. variable is set
|
30
|
-
# * on Windows
|
29
|
+
# If you got permission denied errors, you may need: `echo gem: --user-install > ~/.gemrc`
|
31
30
|
#
|
32
31
|
class Gem4Rake < ::Rake::TaskLib
|
33
32
|
# Initialize Rake tasks to assist developing Ruby Gems.
|
34
33
|
def initialize(version)
|
35
34
|
@name = File.basename(Dir.getwd) # Get Gem's name from CWD basename.
|
35
|
+
@version = version
|
36
|
+
|
37
|
+
build_task
|
38
|
+
install_tasks
|
39
|
+
push_task
|
40
|
+
clean_tasks
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
36
44
|
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
def build_task
|
46
|
+
desc "Build #{@name}-#{@version}.gem"
|
47
|
+
task :build do
|
48
|
+
sh "gem build #{@name}.gemspec"
|
40
49
|
end
|
50
|
+
end
|
41
51
|
|
42
|
-
|
43
|
-
|
44
|
-
|
52
|
+
def install_tasks
|
53
|
+
desc "Install #{@name}-#{@version}.gem"
|
54
|
+
task install: :build do
|
55
|
+
sh "gem install #{@name}-#{@version}.gem"
|
45
56
|
end
|
46
57
|
|
47
|
-
desc "
|
48
|
-
task :
|
49
|
-
|
58
|
+
desc "Uninstall #{@name} gems"
|
59
|
+
task :uninstall do
|
60
|
+
sh "gem uninstall #{@name}"
|
50
61
|
end
|
62
|
+
end
|
51
63
|
|
52
|
-
|
53
|
-
|
54
|
-
|
64
|
+
def push_task
|
65
|
+
desc "Push #{@name}-#{@version}.gem"
|
66
|
+
task push: :build do
|
67
|
+
sh "gem push #{@name}-#{@version}.gem"
|
55
68
|
end
|
69
|
+
end
|
56
70
|
|
57
|
-
|
58
|
-
|
59
|
-
|
71
|
+
def clean_tasks
|
72
|
+
desc "Cleanup #{@name} gems"
|
73
|
+
task :cleanup do
|
74
|
+
sh "gem cleanup #{@name}"
|
60
75
|
end
|
61
76
|
|
62
77
|
desc "Delete #{@name}-*.gem"
|
@@ -64,15 +79,4 @@ class Gem4Rake < ::Rake::TaskLib
|
|
64
79
|
rm Dir.glob("#{@name}-*.gem")
|
65
80
|
end
|
66
81
|
end
|
67
|
-
|
68
|
-
# Run the argument with sudo if not on Windows and ENV['SUDO'] != 'false'.
|
69
|
-
# Otherwise just run it.
|
70
|
-
def sudo(arg)
|
71
|
-
if ENV['SUDO'] != 'false' && ! Gem.win_platform?
|
72
|
-
sh 'sudo ' + arg
|
73
|
-
else
|
74
|
-
sh arg
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
82
|
end
|
metadata
CHANGED
@@ -1,32 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem4rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasily Korytov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '10
|
19
|
+
version: '10'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '14'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '10'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '14'
|
27
33
|
description: Tasks for developing Ruby Gems. Gem and .spec names must match directory
|
28
34
|
basename
|
29
|
-
email:
|
35
|
+
email: v.korytov@outlook.com
|
30
36
|
executables: []
|
31
37
|
extensions: []
|
32
38
|
extra_rdoc_files: []
|
@@ -43,17 +49,16 @@ require_paths:
|
|
43
49
|
- lib
|
44
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
51
|
requirements:
|
46
|
-
- -
|
52
|
+
- - ">="
|
47
53
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
54
|
+
version: '2.4'
|
49
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
56
|
requirements:
|
51
|
-
- -
|
57
|
+
- - ">="
|
52
58
|
- !ruby/object:Gem::Version
|
53
59
|
version: '0'
|
54
60
|
requirements: []
|
55
|
-
|
56
|
-
rubygems_version: 2.0.14
|
61
|
+
rubygems_version: 3.1.2
|
57
62
|
signing_key:
|
58
63
|
specification_version: 4
|
59
64
|
summary: Rake tasks to assist developing Ruby Gems
|