wwtd 0.8.0 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28a58b4b1f31df206d8fe64c4f6113289bc1f74c
4
- data.tar.gz: 4dd575d2d517be4bab185c293840637eb0777ee3
3
+ metadata.gz: 9d9ae340ebde5c58a6443316f36e1c26752f4614
4
+ data.tar.gz: 0cb0c16415a6de251e2c836e2063d6bf40ec61ed
5
5
  SHA512:
6
- metadata.gz: 37ed689748aaca642e3b05afa2c17434db599e784e0df53e1fa6ba5734d9a65344e5a4b1a6fa5502f0fe2009db91a9b9b63b07bc00bc258425924bcaf36c94f6
7
- data.tar.gz: 020bade5fc8f65a4acdde7f4772b8ea7adab4075e1deebd9a28280f5590e4e9f6891c8826ba3bdd60ddb96a94581a38bcd0395f73862b8b2bf2857ad0299ae89
6
+ metadata.gz: c7574429770ae432b3d82b505cc1f24eae15dccd4e8b8cac6a615ddb87247d369d0472506f3a15bdc07942fa0811481907fcb13807f605bdb24202b56bf6530a
7
+ data.tar.gz: a9d04375884d559c22ccc37902fe973aaf56e81642eb511708ec58bc9cd6002635fcb0557e16ef3e4531a1957a1c54d8fb7d2cd97c46651375e548404f7852c4
@@ -6,6 +6,7 @@ module WWTD
6
6
  end
7
7
 
8
8
  # - rvm: "rvm xxx do"
9
+ # - chruby: "chruby-exec xxx --"
9
10
  # - others: env hash
10
11
  # - unknown: nil
11
12
  def switch_statement(version, options={})
@@ -14,6 +15,9 @@ module WWTD
14
15
  if rvm_executable
15
16
  command = "rvm #{version} do "
16
17
  command if cache_command("#{command} ruby -v")
18
+ elsif chruby_executable
19
+ command = "chruby-exec #{version} -- "
20
+ command if cache_command("#{command} ruby -v")
17
21
  elsif options[:rerun]
18
22
  if rbenv_executable
19
23
  # cannot call different ruby from inside ruby, but ok for copy-paste
@@ -54,6 +58,10 @@ module WWTD
54
58
  cache_command("which rbenv")
55
59
  end
56
60
 
61
+ def chruby_executable
62
+ cache_command("which chruby-exec")
63
+ end
64
+
57
65
  def cache_command(command)
58
66
  cache(command) do
59
67
  if result = capture(command)
@@ -1,3 +1,3 @@
1
1
  module WWTD
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wwtd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it