yhara-gemi 0.0.2

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.
Files changed (7) hide show
  1. data/README +35 -0
  2. data/Rakefile +16 -0
  3. data/VERSION +1 -0
  4. data/bin/gemi +74 -0
  5. data/gemi.gemspec +40 -0
  6. data/gemirc.yml +12 -0
  7. 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.4
data/bin/gemi ADDED
@@ -0,0 +1,74 @@
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.banner = "Usage: #$0 foo bar [gem-options] [options]\nOptions:"
57
+ o.on("-h", "--help", "show this message"){
58
+ Gemi.usage!
59
+ }
60
+ }
61
+
62
+ def self.parse_argv
63
+ @opt.parse!(ARGV)
64
+
65
+ return ARGV.join(" ")
66
+ end
67
+
68
+ def self.usage!
69
+ puts @opt.to_s
70
+ exit
71
+ end
72
+ end
73
+
74
+ Gemi.new(Gemi.parse_argv).run
data/gemi.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{gemi}
5
+ s.version = "0.0.4"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Yutaka HARA"]
9
+ s.date = %q{2009-08-26}
10
+ s.default_executable = %q{gemi}
11
+ s.description = %q{Installing gems for multiple rubys}
12
+ s.email = %q{yutaka.hara/at/gmail.com}
13
+ s.executables = ["gemi"]
14
+ s.extra_rdoc_files = [
15
+ "README"
16
+ ]
17
+ s.files = [
18
+ "README",
19
+ "Rakefile",
20
+ "VERSION",
21
+ "bin/gemi",
22
+ "gemi.gemspec",
23
+ "gemirc.yml"
24
+ ]
25
+ s.homepage = %q{http://github.com/yhara/gemi}
26
+ s.rdoc_options = ["--charset=UTF-8"]
27
+ s.require_paths = ["lib"]
28
+ s.rubygems_version = %q{1.3.5}
29
+ s.summary = %q{Installing gems for multiple rubys}
30
+
31
+ if s.respond_to? :specification_version then
32
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
33
+ s.specification_version = 3
34
+
35
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
36
+ else
37
+ end
38
+ else
39
+ end
40
+ end
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: yhara-gemi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
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 -07: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
+ - gemi.gemspec
30
+ - gemirc.yml
31
+ has_rdoc: false
32
+ homepage: http://github.com/yhara/gemi
33
+ licenses:
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
+