Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Birthday! Waiting for my patch though:
- Loading branch information
0 parents
commit ff5dcea
Showing
8 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "task"] | ||
path = task | ||
url = git://github.com/godfat/gemgem.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# gem-compact [![Build Status](https://secure.travis-ci.org/godfat/gem-compact.png?branch=master)](http://travis-ci.org/godfat/gem-compact) | ||
|
||
by Lin Jen-Shin ([godfat](http://godfat.org)) | ||
|
||
## LINKS: | ||
|
||
* [github](https://github.com/godfat/gem-compact) | ||
* [rubygems](https://rubygems.org/gems/gem-compact) | ||
|
||
## DESCRIPTION: | ||
|
||
Clean up gems for all the paths, including development dependencies. | ||
|
||
## REQUIREMENTS: | ||
|
||
* Tested with MRI (official CRuby), Rubinius and JRuby. | ||
|
||
## INSTALLATION: | ||
|
||
gem install gem-compact | ||
|
||
## SYNOPSIS: | ||
|
||
gem compact | ||
gem compact rake | ||
|
||
## CONTRIBUTORS: | ||
|
||
* Lin Jen-Shin (@godfat) | ||
|
||
## LICENSE: | ||
|
||
Apache License 2.0 (Apache-2) | ||
|
||
Copyright (c) 2017, Lin Jen-Shin (godfat) | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
<http://www.apache.org/licenses/LICENSE-2.0> | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
begin | ||
require "#{__dir__}/task/gemgem" | ||
rescue LoadError | ||
sh 'git submodule update --init --recursive' | ||
exec Gem.ruby, '-S', $PROGRAM_NAME, *ARGV | ||
end | ||
|
||
Gemgem.init(__dir__) do |s| | ||
s.name = 'gem-compact' | ||
s.version = '0.5.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- encoding: utf-8 -*- | ||
# stub: gem-compact 0.5.0 ruby lib | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "gem-compact".freeze | ||
s.version = "0.5.0" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= | ||
s.require_paths = ["lib".freeze] | ||
s.authors = ["Lin Jen-Shin (godfat)".freeze] | ||
s.date = "2017-11-04" | ||
s.description = "Clean up gems for all the paths, including development dependencies.".freeze | ||
s.email = ["godfat (XD) godfat.org".freeze] | ||
s.files = [ | ||
".gitmodules".freeze, | ||
"README.md".freeze, | ||
"Rakefile".freeze, | ||
"gem-compact.gemspec".freeze, | ||
"lib/rubygems/commands/compact_command.rb".freeze, | ||
"lib/rubygems_plugin.rb".freeze, | ||
"pkg/gem-compact-0.5.0.gem".freeze, | ||
"task/README.md".freeze, | ||
"task/gemgem.rb".freeze] | ||
s.homepage = "https://github.com/godfat/gem-compact".freeze | ||
s.licenses = ["Apache-2".freeze] | ||
s.rubygems_version = "2.7.1".freeze | ||
s.summary = "Clean up gems for all the paths, including development dependencies.".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
class Gem::Commands::CompactCommand < Gem::Command | ||
def description | ||
'Clean up gems for all the paths' | ||
end | ||
|
||
def initialize | ||
super('compact', description) | ||
end | ||
|
||
def execute | ||
require 'rubygems/commands/cleanup_command' | ||
|
||
cmd = Gem::Commands::CleanupCommand.new | ||
args, build_args = options.values_at(:args, :build_args) | ||
args.unshift('--no-check-development') | ||
|
||
with_path do | ||
cmd.invoke_with_build_args(args, build_args) | ||
end | ||
end | ||
|
||
private | ||
|
||
def with_path | ||
path = Gem.path | ||
path.each do |dir| | ||
Gem.use_paths(dir) | ||
yield | ||
end | ||
ensure | ||
Gem.use_paths(*path) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
require 'rubygems/command_manager' | ||
Gem::CommandManager.instance.register_command(:compact) |
Binary file not shown.