gem4rake 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/NOTICE +15 -0
- data/lib/gem4rake.rb +76 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 29bc08efc15b6137b05a38a9cc9adbd26a22b0cb
|
4
|
+
data.tar.gz: e943b4863c796317a3a4176af8dd20ac7ebd2c0a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d9d95333b818e5c3240c98bc2a2e724544dab8e952f06be623cb07cf4cceb35d2fd9907eedff2ffb79dbbbd4221e543bf4e30bf71d74c08e25aae13e9a13ddd0
|
7
|
+
data.tar.gz: bee368e6650bea44258d5147bacedcd05ed383ed7d51ac6c362319218f100a65a4f4f694302dd42e27c687b7a55e237945cec5741ad89b860a4d61a827c202be
|
data/NOTICE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
gem4rake: https://github.com/chillum/gem4rake
|
2
|
+
|
3
|
+
Copyright 2015 Vasily Korytov
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this software except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
data/lib/gem4rake.rb
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'rake/tasklib'
|
2
|
+
|
3
|
+
# Rake tasks to assist developing Ruby Gems.
|
4
|
+
#
|
5
|
+
# Gem's name must match current directory's basename.
|
6
|
+
#
|
7
|
+
# = Usage:
|
8
|
+
#
|
9
|
+
# Put this in your `Rakefile`:
|
10
|
+
#
|
11
|
+
# require 'gem4rake'
|
12
|
+
# Gem4Rake.new $your_app_version
|
13
|
+
#
|
14
|
+
# = Example:
|
15
|
+
#
|
16
|
+
# $ rake -T
|
17
|
+
# rake build # Build autoup-1.0.4.gem
|
18
|
+
# rake clean # Delete autoup-*.gem
|
19
|
+
# rake cleanup # Cleanup autoup gems
|
20
|
+
# rake install # Install autoup-1.0.4.gem
|
21
|
+
# rake push # Push autoup-1.0.4.gem
|
22
|
+
# rake uninstall # Uninstall autoup gems
|
23
|
+
#
|
24
|
+
# = Notes:
|
25
|
+
#
|
26
|
+
# We use `sudo` on `install`, `uninstall` and `cleanup` unless:
|
27
|
+
# * `SUDO=false` env. variable is set
|
28
|
+
# * on Windows
|
29
|
+
#
|
30
|
+
class Gem4Rake < ::Rake::TaskLib
|
31
|
+
# Initialize Rake tasks to assist developing Ruby Gems.
|
32
|
+
def initialize(version)
|
33
|
+
@name = File.basename(Dir.getwd) # Get Gem's name from CWD basename.
|
34
|
+
|
35
|
+
desc "Install #{@name}-#{version}.gem"
|
36
|
+
task :install => :build do
|
37
|
+
sudo "gem install #{@name}-#{version}.gem"
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Uninstall #{@name} gems"
|
41
|
+
task :uninstall do
|
42
|
+
sudo "gem uninstall #{@name}"
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "Cleanup #{@name} gems"
|
46
|
+
task :cleanup do
|
47
|
+
sudo "gem cleanup #{@name}"
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "Push #{@name}-#{version}.gem"
|
51
|
+
task :push => :build do
|
52
|
+
sh "gem push #{@name}-#{version}.gem"
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Build #{@name}-#{version}.gem"
|
56
|
+
task :build do
|
57
|
+
sh "gem build #{@name}.gemspec"
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "Delete #{@name}-*.gem"
|
61
|
+
task :clean do
|
62
|
+
rm Dir.glob("#{@name}-*.gem")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Run the argument with sudo if not on Windows and ENV['SUDO'] != 'false'.
|
67
|
+
# Otherwise just run it.
|
68
|
+
def sudo(arg)
|
69
|
+
if ENV['SUDO'] != 'false' && ! Gem.win_platform?
|
70
|
+
sh 'sudo ' + arg
|
71
|
+
else
|
72
|
+
sh arg
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gem4rake
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vasily Korytov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '10.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '10.0'
|
27
|
+
description: Tasks for developing Ruby Gems. Gem's name must match directory basename
|
28
|
+
email: vasily.korytov@yandex.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- NOTICE
|
34
|
+
- lib/gem4rake.rb
|
35
|
+
homepage: https://github.com/chillum/gem4rake
|
36
|
+
licenses:
|
37
|
+
- Apache-2.0
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.9.2
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 2.0.14
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Rake tasks to assist developing Ruby Gems
|
59
|
+
test_files: []
|