gs 0.0.4 → 0.0.5

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 (3) hide show
  1. data/README +3 -2
  2. data/bin/gs +15 -30
  3. metadata +2 -2
data/README CHANGED
@@ -10,8 +10,9 @@ SYNOPSIS
10
10
 
11
11
  DESCRIPTION
12
12
  When called with no arguments, it starts a shell session and
13
- configures the variables GEM_HOME, GEM_PATH and PATH to point to
14
- the $PWD/.gs directory.
13
+ configures the variables GEM_HOME, GEM_PATH and PATH to point
14
+ to the $PWD/.gs directory. In addition, it sets the GEM_SET
15
+ variable with the name of the current gemset (useful for PS1).
15
16
 
16
17
  init
17
18
  Creates the $PWD/.gs directory.
data/bin/gs CHANGED
@@ -13,8 +13,9 @@ SYNOPSIS
13
13
 
14
14
  DESCRIPTION
15
15
  When called with no arguments, it starts a shell session and
16
- configures the variables GEM_HOME, GEM_PATH and PATH to point to
17
- the $PWD/.gs directory.
16
+ configures the variables GEM_HOME, GEM_PATH and PATH to point
17
+ to the $PWD/.gs directory. In addition, it sets the GEM_SET
18
+ variable with the name of the current gemset (useful for PS1).
18
19
 
19
20
  init
20
21
  Creates the $PWD/.gs directory.
@@ -23,38 +24,22 @@ DESCRIPTION
23
24
  Displays this message.
24
25
  EOS
25
26
 
26
- rc = <<EOS
27
- . ~/.bashrc
27
+ subshell = [
28
+ "env",
29
+ %Q{GEM_HOME="$PWD/.gs"},
30
+ %Q{GEM_PATH="$PWD/.gs:`gem env path`"},
31
+ %Q{GEM_SET="`basename $PWD`"},
32
+ %Q{PATH="$PWD/.gs/bin:$PATH"},
33
+ %Q{$SHELL} ].join(" ")
28
34
 
29
- export GEM_HOME="$PWD/.gs"
30
- export GEM_PATH="$PWD/.gs:`gem env path`"
31
- export GEM_SET="`basename $PWD`"
32
- export PATH="$PWD/.gs/bin:$PATH"
33
- EOS
34
-
35
- # Start a subshell with the init file .gs/config. If the file doesn't
36
- # exist, exit with an error.
37
- def use
35
+ case ARGV[0]
36
+ when "init" then Dir.mkdir(".gs")
37
+ when "help" then puts help
38
+ else
38
39
  if Dir.exists?(".gs")
39
- exec "bash --init-file .gs/config"
40
+ exec subshell
40
41
  else
41
42
  puts "Directory .gs not found. Try `gs help`."
42
43
  exit 1
43
44
  end
44
45
  end
45
-
46
- # Create the .gs directory and the .gs/config file.
47
- def init(rc)
48
- Dir.mkdir(".gs")
49
- File.write(".gs/config", rc)
50
- end
51
-
52
- def help
53
- puts help
54
- end
55
-
56
- case ARGV[0]
57
- when "init" then init(rc)
58
- when "help" then puts help
59
- else use
60
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000 Z
12
+ date: 2012-04-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Gemset management
15
15
  email: