toastyapps-gembox 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gembox.rb +3 -2
- data/lib/templates/bashrc +3 -1
- data/lib/templates/dispatch.rb +12 -3
- metadata +1 -1
data/lib/gembox.rb
CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
|
|
3
3
|
require 'erb'
|
4
4
|
|
5
5
|
class Gembox
|
6
|
-
VERSION = '1.
|
6
|
+
VERSION = '1.3.0'
|
7
7
|
attr_accessor :dir, :cfg
|
8
8
|
attr_accessor :cfg
|
9
9
|
|
@@ -62,6 +62,7 @@ class Gembox
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
File.open("gems.yaml", "w") { |f| f.puts gemdata.to_yaml }
|
65
|
+
end
|
65
66
|
|
66
67
|
def load_config
|
67
68
|
@cfg = load_yaml(@cfg_path)
|
@@ -71,4 +72,4 @@ class Gembox
|
|
71
72
|
File.exists?(path) ? YAML.load(File.open(path)) : nil
|
72
73
|
end
|
73
74
|
|
74
|
-
end
|
75
|
+
end
|
data/lib/templates/bashrc
CHANGED
data/lib/templates/dispatch.rb
CHANGED
@@ -7,9 +7,18 @@ command=args.shift
|
|
7
7
|
case command
|
8
8
|
when 'install'
|
9
9
|
system("gem --config-file <%= @dir %>/.gemrc #{command} --bindir <%= @dir %>/usr/bin #{ARGV.join(' ')}")
|
10
|
-
when '
|
11
|
-
|
12
|
-
|
10
|
+
when 'load_config'
|
11
|
+
cfg_path = `cd ~/ && pwd`.chomp + "/.gemboxrc"
|
12
|
+
if File.exists?(cfg_path)
|
13
|
+
data = YAML.load(File.open(cfg_path).read)
|
14
|
+
if data['symlink']
|
15
|
+
data['symlink'].each do |symlink|
|
16
|
+
if `gem query -i -n #{symlink}`.chomp == 'false'
|
17
|
+
system("ruby <%= @dir %>/dispatch.rb symlink #{symlink}")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
13
22
|
when 'symlink'
|
14
23
|
data = YAML.load(File.open('<%= @dir %>/gems.yaml').read)
|
15
24
|
gem_name = args.shift
|