gemi 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/History.txt +7 -0
  2. data/VERSION +1 -1
  3. data/bin/gemi +20 -3
  4. data/gemi.gemspec +7 -3
  5. data/gemirc.yml +2 -0
  6. metadata +3 -2
@@ -0,0 +1,7 @@
1
+ 2009-10-03 version 0.0.5
2
+
3
+ * fix: gem options can be given
4
+
5
+ 2009-08-26 version 0.0.4
6
+
7
+ * initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/bin/gemi CHANGED
@@ -22,6 +22,8 @@ class Gemi
22
22
  end
23
23
  end
24
24
 
25
+ private
26
+
25
27
  def gemirc_exists?
26
28
  File.exist?(GEMIRC)
27
29
  end
@@ -33,12 +35,22 @@ class Gemi
33
35
  def install_gems
34
36
  @rubys.each do |ruby|
35
37
  puts "------- installing for #{ruby[:name]} ..."
36
- cmd = "#{ruby[:command]} install #{@arg} #{ruby[:options]}"
38
+ cmd = "#{gem_home(ruby)} #{ruby[:command]} install #{@arg} #{ruby[:options]}"
37
39
  puts cmd
38
40
  system cmd
39
41
  end
40
42
  end
41
43
 
44
+ def gem_home(ruby)
45
+ if ruby[:gem_home]
46
+ # Note: single quote(') is needed to run the command in shell
47
+ # see the reference of Kernel#system
48
+ "GEM_HOME='#{File.expand_path ruby[:gem_home]}'"
49
+ else
50
+ ""
51
+ end
52
+ end
53
+
42
54
  def setup
43
55
  create_gemirc
44
56
  puts "Created #{GEMIRC}"
@@ -53,14 +65,19 @@ class Gemi
53
65
  # command line options
54
66
 
55
67
  @opt = OptionParser.new{|o|
56
- o.banner = "Usage: #$0 foo bar [gem-options] [options]\nOptions:"
68
+ o.banner = "Usage: #$0 [gemi-options] foo bar [gem-options]\n" +
69
+ "Gemi Options:"
57
70
  o.on("-h", "--help", "show this message"){
58
71
  Gemi.usage!
59
72
  }
60
73
  }
61
74
 
62
75
  def self.parse_argv
63
- @opt.parse!(ARGV)
76
+ gemi_opts = []
77
+ while ARGV[0] =~ /\A-/
78
+ gemi_opts.push ARGV.shift
79
+ end
80
+ @opt.parse!(gemi_opts)
64
81
 
65
82
  return ARGV.join(" ")
66
83
  end
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{gemi}
5
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Yutaka HARA"]
9
- s.date = %q{2009-08-26}
12
+ s.date = %q{2009-10-03}
10
13
  s.default_executable = %q{gemi}
11
14
  s.description = %q{Installing gems for multiple rubys}
12
15
  s.email = %q{yutaka.hara/at/gmail.com}
@@ -15,7 +18,8 @@ Gem::Specification.new do |s|
15
18
  "README"
16
19
  ]
17
20
  s.files = [
18
- "README",
21
+ "History.txt",
22
+ "README",
19
23
  "Rakefile",
20
24
  "VERSION",
21
25
  "bin/gemi",
data/gemirc.yml CHANGED
@@ -1,10 +1,12 @@
1
1
  - :name: 'MRI 1.8' # used just for showing messages
2
2
  :command: 'sudo gem' # gem command to install
3
3
  :options: # options for 'gem install'
4
+ # :gem_home: ~/.gem1.8
4
5
 
5
6
  - :name: 'MRI 1.9'
6
7
  :command: 'gem-1.9'
7
8
  :options: '--format-executable' # install bin/foobar as foobar-1.9
9
+ # :gem_home: ~/.gem1.9
8
10
 
9
11
 
10
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yutaka HARA
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-26 00:00:00 +09:00
12
+ date: 2009-10-03 00:00:00 +09:00
13
13
  default_executable: gemi
14
14
  dependencies: []
15
15
 
@@ -22,6 +22,7 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README
24
24
  files:
25
+ - History.txt
25
26
  - README
26
27
  - Rakefile
27
28
  - VERSION