gemi 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +35 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/bin/gemi +73 -0
- data/gemirc.yml +12 -0
- metadata +59 -0
data/README
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= gemi
|
2
|
+
|
3
|
+
gemi is a simple tool for installing gems for multiple rubys.
|
4
|
+
|
5
|
+
== Install
|
6
|
+
|
7
|
+
1. gem install gemcutter
|
8
|
+
|
9
|
+
2. gem tumble
|
10
|
+
|
11
|
+
3. gem install gemi
|
12
|
+
|
13
|
+
or:
|
14
|
+
|
15
|
+
gem install gemi --source=http://gemcutter.org
|
16
|
+
|
17
|
+
== Setup
|
18
|
+
|
19
|
+
$ gemi
|
20
|
+
|
21
|
+
then edit ~/.gemirc
|
22
|
+
|
23
|
+
== Usage
|
24
|
+
|
25
|
+
$ gemi foobar
|
26
|
+
|
27
|
+
installs the gem 'foobar' for your rubys.
|
28
|
+
|
29
|
+
== Contact
|
30
|
+
|
31
|
+
http://github.com/yhara/gemi
|
32
|
+
|
33
|
+
yhara (Yutaka HARA)
|
34
|
+
yutaka.hara.gmail.com
|
35
|
+
http://route477.net/
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
PROJECT_NAME = "gemi"
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
rescue LoadError
|
6
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
7
|
+
end
|
8
|
+
|
9
|
+
Jeweler::Tasks.new do |gemspec|
|
10
|
+
gemspec.name = "#{PROJECT_NAME}"
|
11
|
+
gemspec.summary = "Installing gems for multiple rubys"
|
12
|
+
gemspec.email = "yutaka.hara/at/gmail.com"
|
13
|
+
gemspec.homepage = "http://github.com/yhara/#{PROJECT_NAME}"
|
14
|
+
gemspec.description = gemspec.summary
|
15
|
+
gemspec.authors = ["Yutaka HARA"]
|
16
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/bin/gemi
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'optparse'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
class Gemi
|
7
|
+
GEMIRC = File.expand_path("~/.gemirc")
|
8
|
+
|
9
|
+
def initialize(arg)
|
10
|
+
@arg = arg
|
11
|
+
@rubys = []
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
if gemirc_exists?
|
16
|
+
Gemi.usage! if @arg.empty?
|
17
|
+
|
18
|
+
@rubys = load_gemirc
|
19
|
+
install_gems
|
20
|
+
else
|
21
|
+
setup
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def gemirc_exists?
|
26
|
+
File.exist?(GEMIRC)
|
27
|
+
end
|
28
|
+
|
29
|
+
def load_gemirc
|
30
|
+
YAML.load_file(GEMIRC)
|
31
|
+
end
|
32
|
+
|
33
|
+
def install_gems
|
34
|
+
@rubys.each do |ruby|
|
35
|
+
puts "------- installing for #{ruby[:name]} ..."
|
36
|
+
cmd = "#{ruby[:command]} install #{@arg} #{ruby[:options]}"
|
37
|
+
puts cmd
|
38
|
+
system cmd
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def setup
|
43
|
+
create_gemirc
|
44
|
+
puts "Created #{GEMIRC}"
|
45
|
+
puts "please edit it before using gemi."
|
46
|
+
end
|
47
|
+
|
48
|
+
def create_gemirc
|
49
|
+
template_path = File.expand_path("../gemirc.yml", File.dirname(__FILE__))
|
50
|
+
FileUtils.cp(template_path, GEMIRC)
|
51
|
+
end
|
52
|
+
|
53
|
+
# command line options
|
54
|
+
|
55
|
+
@opt = OptionParser.new{|o|
|
56
|
+
o.on("-h", "--help"){
|
57
|
+
Gemi.usage!
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
def self.parse_argv
|
62
|
+
@opt.parse!(ARGV)
|
63
|
+
|
64
|
+
return ARGV.join(" ")
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.usage!
|
68
|
+
puts @opt.to_s
|
69
|
+
exit
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
Gemi.new(Gemi.parse_argv).run
|
data/gemirc.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
- :name: 'MRI 1.8' # used just for showing messages
|
2
|
+
:command: 'sudo gem' # gem command to install
|
3
|
+
:options: # options for 'gem install'
|
4
|
+
|
5
|
+
- :name: 'MRI 1.9'
|
6
|
+
:command: 'gem-1.9'
|
7
|
+
:options: '--format-executable' # install bin/foobar as foobar-1.9
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gemi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yutaka HARA
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-25 00:00:00 +09:00
|
13
|
+
default_executable: gemi
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Installing gems for multiple rubys
|
17
|
+
email: yutaka.hara/at/gmail.com
|
18
|
+
executables:
|
19
|
+
- gemi
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
files:
|
25
|
+
- README
|
26
|
+
- Rakefile
|
27
|
+
- VERSION
|
28
|
+
- bin/gemi
|
29
|
+
- gemirc.yml
|
30
|
+
has_rdoc: true
|
31
|
+
homepage: http://github.com/yhara/gemi
|
32
|
+
licenses: []
|
33
|
+
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options:
|
36
|
+
- --charset=UTF-8
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
51
|
+
requirements: []
|
52
|
+
|
53
|
+
rubyforge_project:
|
54
|
+
rubygems_version: 1.3.5
|
55
|
+
signing_key:
|
56
|
+
specification_version: 3
|
57
|
+
summary: Installing gems for multiple rubys
|
58
|
+
test_files: []
|
59
|
+
|