rvm-with 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.md ADDED
@@ -0,0 +1,3 @@
1
+ === 0.9.0 / 2012-04-28
2
+
3
+ * Initial release
data/Manifest.yml ADDED
@@ -0,0 +1,6 @@
1
+ - History.md
2
+ - Manifest.yml
3
+ - README.md
4
+ - Rakefile
5
+ - lib/rvm/with.rb
6
+ - lib/rvm/with/version.rb
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # RVM-with
2
+
3
+ ## Description
4
+
5
+ RVM Interactive scripting wrapper
6
+
7
+ ## Installation
8
+
9
+ RVM-with is now available as a separate gem
10
+
11
+ $ gem install rvm-with
12
+
13
+ ## Example
14
+
15
+ It should be simple as:
16
+
17
+ require "rvm-with"
18
+ RVM.with "1.9.3" do |r|
19
+ puts r.execute "rvm info"
20
+ end
21
+
22
+ This gem is based on [session gem](https://github.com/ahoward/session), so you can do all the same things you would do with it:
23
+
24
+ stdout, stderr = r.execute "rvm current"
25
+ if r.status == 0
26
+ puts stdout
27
+ else
28
+ puts "failed"
29
+ end
30
+
31
+ ## Development
32
+
33
+ $ rake spec
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ task :default => "spec:run"
2
+
3
+ namespace :spec do
4
+ desc "Run the tests."
5
+ task :run do
6
+ # TODO: Port over the tests.
7
+ end
8
+ end
9
+
data/lib/rvm/with.rb ADDED
@@ -0,0 +1,15 @@
1
+ require 'session'
2
+
3
+ module RVM
4
+ class ErrorLoadingRubyVersion < StandardError; end
5
+
6
+ def self.with version, &block
7
+ shell = Session::Bash.new
8
+ stdout, stderr = shell.execute "ruby_version_path=$( rvm #{version} do rvm env -- --path ) && source $ruby_version_path"
9
+ if shell.status == 0
10
+ block.call(shell)
11
+ else
12
+ raise ErrorLoadingRubyVersion.new("Could not load ruby version '#{version}' error: '#{stderr.strip}'.")
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module RVM
2
+ class With
3
+ VERSION="0.9.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'minitest'
2
+ require 'minitest/spec'
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rvm-with
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Michal Papis
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: session
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: minitest
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: RVM Interactive scripting wrapper
63
+ email:
64
+ - mpapis@gmail.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - History.md
70
+ - Manifest.yml
71
+ - README.md
72
+ - Rakefile
73
+ - lib/rvm/with.rb
74
+ - lib/rvm/with/version.rb
75
+ - spec/spec_helper.rb
76
+ homepage: https://github.com/mpapis/rvm-with
77
+ licenses: []
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 1.8.21
97
+ signing_key:
98
+ specification_version: 3
99
+ summary: RVM Interactive scripting wrapper
100
+ test_files:
101
+ - spec/spec_helper.rb