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 CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'erb'
4
4
 
5
5
  class Gembox
6
- VERSION = '1.2.0'
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
@@ -2,4 +2,6 @@ PS1="gembox:\w> "
2
2
  export PATH=<%= @dir %>/usr/bin:$PATH
3
3
  alias gem='ruby <%= @dir %>/dispatch.rb'
4
4
  export GEM_PATH=<%= @dir %>/gems
5
- export GEM_HOME=<%= @dir %>/gems
5
+ export GEM_HOME=<%= @dir %>/gems
6
+
7
+ ruby dispatch.rb load_config
@@ -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 'query'
11
- puts 'here'
12
- system("gem query #{ARGV.join(' ')}")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toastyapps-gembox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Mongeau