rgz 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +21 -0
- data/Rakefile +1 -0
- data/bin/rgz +11 -0
- data/lib/rgz.rb +30 -0
- data/lib/rgz/version.rb +3 -0
- data/rgz.gemspec +24 -0
- metadata +54 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# RGZ
|
2
|
+
|
3
|
+
## USAGE: generating an rgz file
|
4
|
+
|
5
|
+
Assuming you have a gem project "dummy" that has "Gemfile".
|
6
|
+
|
7
|
+
$ rgz
|
8
|
+
|
9
|
+
Generates "ruby" directory and "ruby.rgz" file. Use the rgz file later.
|
10
|
+
|
11
|
+
## USAGE: using the rgz file
|
12
|
+
|
13
|
+
require 'rgz'
|
14
|
+
$LOAD_PATH.concat Rgz.include_paths 'the-rgz-file-path.rgz'
|
15
|
+
require 'a-library-in-the-rgz-file'
|
16
|
+
|
17
|
+
## Author
|
18
|
+
|
19
|
+
Tatsuhiro Ujihisa
|
20
|
+
|
21
|
+
<http://ujihisa.blogspot.com>
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/rgz
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) + '/../lib/'
|
3
|
+
require 'rgz'
|
4
|
+
|
5
|
+
# fname = ARGV.shift or abort 'give me an .rgz file!'
|
6
|
+
# abort "it's not an .rgz file!" unless /\.rgz\z/ =~ fname
|
7
|
+
# abort "the file doesn't exist" unless File.exist? fname
|
8
|
+
# p Rgz::include_paths fname
|
9
|
+
|
10
|
+
dir = ARGV.shift or Dir.pwd
|
11
|
+
Rgz.make_rgz dir
|
data/lib/rgz.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'rgz/version'
|
3
|
+
|
4
|
+
module Rgz
|
5
|
+
RgzNotFound = Class.new Exception
|
6
|
+
|
7
|
+
def include_paths(libpath)
|
8
|
+
raise RgzNotFound unless File.exist? libpath
|
9
|
+
libpath = File.expand_path libpath
|
10
|
+
t = Dir.mktmpdir
|
11
|
+
Dir.chdir t do
|
12
|
+
tar_xzvf libpath
|
13
|
+
end
|
14
|
+
Dir.glob(t + '/**/lib')
|
15
|
+
end
|
16
|
+
module_function :include_paths
|
17
|
+
|
18
|
+
def make_rgz(dir)
|
19
|
+
system 'bundle install .'
|
20
|
+
system 'tar czvf ruby.rgz ruby'
|
21
|
+
end
|
22
|
+
module_function :make_rgz
|
23
|
+
|
24
|
+
def tar_xzvf(path)
|
25
|
+
# FIXME: don't use tar external command(?)
|
26
|
+
system 'tar', 'xzvf', path, [:err, :out] => '/dev/null' # TODO /dev/null
|
27
|
+
end
|
28
|
+
module_function :tar_xzvf
|
29
|
+
private :tar_xzvf
|
30
|
+
end
|
data/lib/rgz/version.rb
ADDED
data/rgz.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "rgz/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rgz"
|
7
|
+
s.version = Rgz::VERSION
|
8
|
+
s.authors = ["ujihisa"]
|
9
|
+
s.email = ["ujihisa at gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{something like jar for cruby}
|
12
|
+
s.description = %q{something like jar for cruby}
|
13
|
+
|
14
|
+
s.rubyforge_project = "rgz"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rgz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- ujihisa
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-11-24 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: something like jar for cruby
|
15
|
+
email:
|
16
|
+
- ujihisa at gmail.com
|
17
|
+
executables:
|
18
|
+
- rgz
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- bin/rgz
|
27
|
+
- lib/rgz.rb
|
28
|
+
- lib/rgz/version.rb
|
29
|
+
- rgz.gemspec
|
30
|
+
homepage: ''
|
31
|
+
licenses: []
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubyforge_project: rgz
|
50
|
+
rubygems_version: 1.8.11
|
51
|
+
signing_key:
|
52
|
+
specification_version: 3
|
53
|
+
summary: something like jar for cruby
|
54
|
+
test_files: []
|