rconf 0.5.5 → 0.5.6
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.
data/lib/rconf/command.rb
CHANGED
@@ -34,7 +34,7 @@ module RightConf
|
|
34
34
|
end
|
35
35
|
res = Platform.dispatch(command, *args) { :execute }
|
36
36
|
if @verbose
|
37
|
-
msg = (([command] + args).join(' ') + ' => ' +
|
37
|
+
msg = (([@prefix, command] + args).compact.join(' ') + ' => ' +
|
38
38
|
res.status.to_s + ': ' + res.output).grey
|
39
39
|
report(msg)
|
40
40
|
end
|
@@ -54,8 +54,6 @@ module RightConf
|
|
54
54
|
when /^Using /
|
55
55
|
report_success
|
56
56
|
check_rvmrc
|
57
|
-
Command.execute('rvm', version, 'exec', 'gem', 'install', 'rconf',
|
58
|
-
:abort_on_failure => "Failed to install rconf gem in #{version}")
|
59
57
|
post_note "Configuration required switching the active ruby\nPlease 'cd' into the project directory again to activate it"
|
60
58
|
else
|
61
59
|
report_fatal("Failed to use #{version}:\n#{out}")
|
@@ -71,6 +69,8 @@ module RightConf
|
|
71
69
|
report_check("Creating gemset #{gemset} for #{version}")
|
72
70
|
Command.execute('rvm', version, 'gemset', 'create', gemset,
|
73
71
|
:abort_on_failure => "Failed to create gemset '#{gemset}'")
|
72
|
+
Command.execute('rvm', "#{version}@#{gemset}", 'exec', 'gem', 'install', 'rconf',
|
73
|
+
:abort_on_failure => "Failed to install rconf gem in #{version}@#{gemset}")
|
74
74
|
report_success
|
75
75
|
end
|
76
76
|
report_check("Switching to gemset #{gemset}")
|
@@ -191,7 +191,7 @@ module RightConf
|
|
191
191
|
f.puts "type -P rconf &>/dev/null && { rconf; }"
|
192
192
|
f.puts "type -P rconf &>/dev/null || { echo 'rconf not installed, skipping (see .rvmrc)'; }"
|
193
193
|
end
|
194
|
-
Command.execute('rvm', 'trust', 'rvmrc')
|
194
|
+
Command.execute('rvm', "#{version}@#{gemset}", 'trust', 'rvmrc')
|
195
195
|
report_success
|
196
196
|
rescue Exception => e
|
197
197
|
report_failure
|
data/lib/rconf/version.rb
CHANGED
@@ -26,14 +26,14 @@ describe RightConf::PackagesConfigurator do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should install packages on Ubuntu' do
|
29
|
-
flexmock(RightConf::Command.instance).should_receive(:execute).with(
|
29
|
+
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
30
30
|
'sudo', 'aptitude', 'install', 'deb1', 'deb2',
|
31
31
|
{:abort_on_failure=>"Failed to install packages"}).and_return(success_result)
|
32
32
|
@configurator.run_linux_ubuntu
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should install packages on Centos' do
|
36
|
-
flexmock(RightConf::Command.instance).should_receive(:execute).with(
|
36
|
+
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
37
37
|
'sudo', 'yum', 'install', '-y', 'cent1', 'cent2',
|
38
38
|
{:abort_on_failure=>"Failed to install packages"}).and_return(success_result)
|
39
39
|
@configurator.run_linux_centos
|
@@ -13,6 +13,8 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
13
13
|
|
14
14
|
describe RightConf::RubyConfigurator do
|
15
15
|
|
16
|
+
RVM_VERSION = RightConf::RubyConfigurator::RVM_VERSION
|
17
|
+
|
16
18
|
def success_result(output=nil)
|
17
19
|
flexmock('res', :success? => true, :output => output)
|
18
20
|
end
|
@@ -27,30 +29,30 @@ describe RightConf::RubyConfigurator do
|
|
27
29
|
|
28
30
|
it 'should succeed on linux when rvm succeeds' do
|
29
31
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
30
|
-
'rvm', '--version').and_return(success_result("rvm #{
|
32
|
+
'rvm', '--version').and_return(success_result("rvm #{RVM_VERSION}"))
|
31
33
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
32
|
-
'rvm', 'list').and_return(success_result("=> rvm #{
|
34
|
+
'rvm', 'list').and_return(success_result("=> rvm #{RVM_VERSION}"))
|
33
35
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
34
36
|
'rvm', 'use', '0').and_return(success_result('Using'))
|
35
37
|
@configurator.run_linux
|
36
38
|
end
|
37
39
|
|
38
40
|
it 'should install rvm if needed' do
|
39
|
-
rvm_tar = "rvm-#{
|
41
|
+
rvm_tar = "rvm-#{RVM_VERSION}.tar.gz"
|
40
42
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
41
43
|
'rvm', '--version').and_return(success_result("rvm"))
|
42
44
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
43
|
-
'rvm', 'list').and_return(success_result("=> rvm #{
|
45
|
+
'rvm', 'list').and_return(success_result("=> rvm #{RVM_VERSION}"))
|
44
46
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
45
47
|
'curl', '-O', '-f',
|
46
48
|
"http://rvm.beginrescueend.com/releases/#{rvm_tar}",
|
47
|
-
{:abort_on_failure=>"Failed to download rvm #{
|
49
|
+
{:abort_on_failure=>"Failed to download rvm #{RVM_VERSION}"}).and_return(success_result)
|
48
50
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
49
51
|
'tar', 'zxf', rvm_tar,
|
50
|
-
{:abort_on_failure=>"Failed to extract rvm tgz from
|
52
|
+
{:abort_on_failure=>"Failed to extract rvm tgz from #{File.expand_path(File.join(File.dirname(__FILE__), '..', '..', "rvm-#{RVM_VERSION}.tar.gz"))}"}).and_return(success_result)
|
51
53
|
flexmock(Dir).should_receive(:chdir).and_yield
|
52
54
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
53
|
-
'./install', {:abort_on_failure=>"Failed to install rvm #{
|
55
|
+
'./install', {:abort_on_failure=>"Failed to install rvm #{RVM_VERSION}"}).and_return(success_result)
|
54
56
|
flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
|
55
57
|
'rvm', 'use', '0').and_return(success_result('Using'))
|
56
58
|
@configurator.run_linux
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rconf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 5
|
10
|
-
version: 0.5.5
|
4
|
+
prerelease:
|
5
|
+
version: 0.5.6
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Raphael Simon
|
@@ -26,10 +21,6 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 9
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 5
|
33
24
|
version: "2.5"
|
34
25
|
type: :development
|
35
26
|
version_requirements: *id001
|
@@ -41,10 +32,6 @@ dependencies:
|
|
41
32
|
requirements:
|
42
33
|
- - ~>
|
43
34
|
- !ruby/object:Gem::Version
|
44
|
-
hash: 25
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
- 9
|
48
35
|
version: "0.9"
|
49
36
|
type: :development
|
50
37
|
version_requirements: *id002
|
@@ -117,23 +104,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
104
|
requirements:
|
118
105
|
- - ">="
|
119
106
|
- !ruby/object:Gem::Version
|
120
|
-
hash: 3
|
121
|
-
segments:
|
122
|
-
- 0
|
123
107
|
version: "0"
|
124
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
109
|
none: false
|
126
110
|
requirements:
|
127
111
|
- - ">="
|
128
112
|
- !ruby/object:Gem::Version
|
129
|
-
hash: 3
|
130
|
-
segments:
|
131
|
-
- 0
|
132
113
|
version: "0"
|
133
114
|
requirements: []
|
134
115
|
|
135
116
|
rubyforge_project: rconf
|
136
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.5.0
|
137
118
|
signing_key:
|
138
119
|
specification_version: 3
|
139
120
|
summary: Cross platform environment configuration
|