gem4rake 1.0.3 → 1.3.2

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 +36 -31
  4. metadata +10 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f548e37977489a6ca047b94c7d24ad46189567a2
4
- data.tar.gz: 203ea7e252bedcb70a1f9abb02b8dd63024e59fb
2
+ SHA256:
3
+ metadata.gz: 802d13662d217b7c970618047fd0a31d496b2ebd5b86ec1955b82901128c9493
4
+ data.tar.gz: 72bf80bbfb23d42ee3d064faf6f2fe8fc3abe870a5424fa8273651c73cde1d1d
5
5
  SHA512:
6
- metadata.gz: 7db9ab35dfe5b3b01addcde66180cab885b0e44d1e2bf26d5beb267e9f1ed1966a00aa2189998b25d8d207b9116a2279916ae4455e25ff8d103a75ba6ece66f0
7
- data.tar.gz: 49de7c8f2b733b366af0d8d2cc345aac1189b38fe94c8ab1210b882afb4295c2f3c941d68a49d91127e119bac9c0ffd5b13398030bd2818722b07a044abb467e
6
+ metadata.gz: 9cf1442e5335bb3f325427b4f971e3362fdb3f7b086cf2745562dabc36ceca4d971d2ceaaea94e80611ea6b6d775eaf93c4b8f4ce4867db3a2603cd0a5e7ee8e
7
+ data.tar.gz: d29ea1a4a23701155f4335ffe06c389d726bc14a0e0e91059069c5ee40d186c6a1ccdb7d61328f48a72b0259ea93f4bda3fdbbad687ceee926c2c2375d96b152
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.
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,53 @@ 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)
34
+ super()
35
35
  @name = File.basename(Dir.getwd) # Get Gem's name from CWD basename.
36
+ @version = version
37
+
38
+ build_task
39
+ install_tasks
40
+ push_task
41
+ clean_tasks
42
+ end
43
+
44
+ private
36
45
 
37
- desc "Install #{@name}-#{version}.gem"
38
- task :install => :build do
39
- sudo "gem install #{@name}-#{version}.gem"
46
+ def build_task
47
+ desc "Build #{@name}-#{@version}.gem"
48
+ task :build do
49
+ sh "gem build #{@name}.gemspec"
40
50
  end
51
+ end
41
52
 
42
- desc "Uninstall #{@name} gems"
43
- task :uninstall do
44
- sudo "gem uninstall #{@name}"
53
+ def install_tasks
54
+ desc "Install #{@name}-#{@version}.gem"
55
+ task install: :build do
56
+ sh "gem install #{@name}-#{@version}.gem"
45
57
  end
46
58
 
47
- desc "Cleanup #{@name} gems"
48
- task :cleanup do
49
- sudo "gem cleanup #{@name}"
59
+ desc "Uninstall #{@name} gems"
60
+ task :uninstall do
61
+ sh "gem uninstall #{@name}"
50
62
  end
63
+ end
51
64
 
52
- desc "Push #{@name}-#{version}.gem"
53
- task :push => :build do
54
- sh "gem push #{@name}-#{version}.gem"
65
+ def push_task
66
+ desc "Push #{@name}-#{@version}.gem"
67
+ task push: :build do
68
+ sh "gem push #{@name}-#{@version}.gem"
55
69
  end
70
+ end
56
71
 
57
- desc "Build #{@name}-#{version}.gem"
58
- task :build do
59
- sh "gem build #{@name}.gemspec"
72
+ def clean_tasks
73
+ desc "Cleanup #{@name} gems"
74
+ task :cleanup do
75
+ sh "gem cleanup #{@name}"
60
76
  end
61
77
 
62
78
  desc "Delete #{@name}-*.gem"
@@ -64,15 +80,4 @@ class Gem4Rake < ::Rake::TaskLib
64
80
  rm Dir.glob("#{@name}-*.gem")
65
81
  end
66
82
  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
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem4rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Korytov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2021-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '10'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '13'
22
+ version: '14'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,10 +29,10 @@ dependencies:
29
29
  version: '10'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '13'
32
+ version: '14'
33
33
  description: Tasks for developing Ruby Gems. Gem and .spec names must match directory
34
34
  basename
35
- email: vasily.korytov@icloud.com
35
+ email: v.korytov@outlook.com
36
36
  executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
@@ -43,7 +43,7 @@ homepage: https://github.com/chillum/gem4rake
43
43
  licenses:
44
44
  - Apache-2.0
45
45
  metadata: {}
46
- post_install_message:
46
+ post_install_message:
47
47
  rdoc_options: []
48
48
  require_paths:
49
49
  - lib
@@ -51,16 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.9.2
54
+ version: '2.4'
55
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubyforge_project:
62
- rubygems_version: 2.6.11
63
- signing_key:
61
+ rubygems_version: 3.2.3
62
+ signing_key:
64
63
  specification_version: 4
65
64
  summary: Rake tasks to assist developing Ruby Gems
66
65
  test_files: []