gem4rake 1.0.2 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/NOTICE +1 -1
  3. data/lib/gem4rake.rb +35 -31
  4. metadata +17 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 99016b1b1b983a0c8a6a9e4a73493063a41d67c4
4
- data.tar.gz: 239b4c66f83b6f3c41e2361dd737f8b4ac66e8da
2
+ SHA256:
3
+ metadata.gz: 3e45d6169bce08be2a0211017c6becf9483b65c5a1669598783d4fcd3fd3fd6c
4
+ data.tar.gz: f78259e6894762ce908b431dd630704051f527cf41ff9af59a524e259c0368dd
5
5
  SHA512:
6
- metadata.gz: 651fb0b67043667b38c2750f0d0e637c1c22326bb52c3e941ac890f286f751c9fe4f89bc2c66c762d0b93f189e0616053f631589baa6e34379db4420ba8c983a
7
- data.tar.gz: ca2e194e01004466c4dc49b80c31f24309069fbc78ea86b4395f480ce467ec6cdc2f8dc2c0f14c46ba37591ef9cd3580a0bd7c29bc6027a1d3d184684bd43d24
6
+ metadata.gz: bffab2c7a78a105ea21639cfea4da31aa8b0b8c8aab6fbe524272d210e2209b99a34bd6689e7136f348365422fb3bb1041ee7dfdf5ca4ab376ea291c4f2fbd4a
7
+ data.tar.gz: dcd8805519f816d702532d763e78be3ed376b60764d6840cc2c9ac83f92d68b44b88780656c59489f78324e6656af8be4c5c6409fe6112afe3852d6420061b42
data/NOTICE CHANGED
@@ -1,6 +1,6 @@
1
1
  gem4rake: https://github.com/chillum/gem4rake
2
2
 
3
- Copyright 2015 Vasily Korytov
3
+ Copyright 2015-2019 Vasily Korytov
4
4
 
5
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
6
  you may not use this software except in compliance with the License.
@@ -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
- # We use `sudo` on `install`, `uninstall` and `cleanup` unless:
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
- desc "Install #{@name}-#{version}.gem"
38
- task :install => :build do
39
- sudo "gem install #{@name}-#{version}.gem"
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
- desc "Uninstall #{@name} gems"
43
- task :uninstall do
44
- sudo "gem uninstall #{@name}"
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 "Cleanup #{@name} gems"
48
- task :cleanup do
49
- sudo "gem cleanup #{@name}"
58
+ desc "Uninstall #{@name} gems"
59
+ task :uninstall do
60
+ sh "gem uninstall #{@name}"
50
61
  end
62
+ end
51
63
 
52
- desc "Push #{@name}-#{version}.gem"
53
- task :push => :build do
54
- sh "gem push #{@name}-#{version}.gem"
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
- desc "Build #{@name}-#{version}.gem"
58
- task :build do
59
- sh "gem build #{@name}.gemspec"
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.0.2
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: 2015-10-27 00:00:00.000000000 Z
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.0'
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: '10.0'
32
+ version: '14'
27
33
  description: Tasks for developing Ruby Gems. Gem and .spec names must match directory
28
34
  basename
29
- email: vasily.korytov@yandex.com
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: 1.9.2
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
- rubyforge_project:
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