rconf 0.9.17 → 0.9.18

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
@@ -75,6 +75,27 @@ module RightConf
75
75
  execute('rvm', *args)
76
76
  end
77
77
 
78
+ # Execute rvm command
79
+ #
80
+ # === Parameters
81
+ # command(String):: rvm command to run
82
+ # args(Array):: Command arguments
83
+ #
84
+ # === Options
85
+ # abort_on_failure(bool):: Whether to raise an exception in case command
86
+ # returns an error (false by default)
87
+ # env:: Hash of environment variables keyed by name
88
+ #
89
+ # === Return
90
+ # result(CommandResult):: Result of execution (output and exit status)
91
+ def execute_rvm(command, *args)
92
+ report_fatal('Failed to run in ruby context, no ruby specified') unless @rvm_prefix
93
+ commands = @rvm_prefix + [ command ]
94
+ args = commands + args
95
+ execute('rvm', *args)
96
+ end
97
+
98
+
78
99
  # Execute given command with given arguments using 'sudo'
79
100
  #
80
101
  # === Parameters
@@ -110,7 +110,7 @@ module RightConf
110
110
  else
111
111
  report_failure
112
112
  report_check("Installing rubygems #{rubygems}")
113
- Command.execute_in_ruby('rubygems', rubygems, :abort_on_failure => 'Failed to install rubygems')
113
+ Command.execute_rvm('rubygems', rubygems, :abort_on_failure => 'Failed to install rubygems')
114
114
  report_success
115
115
  end
116
116
  end
data/lib/rconf/version.rb CHANGED
@@ -13,7 +13,7 @@ module RightConf
13
13
 
14
14
  MAJOR = 0
15
15
  MINOR = 9
16
- BUILD = 17
16
+ BUILD = 18
17
17
 
18
18
  VERSION = [MAJOR, MINOR, BUILD].map(&:to_s).join('.')
19
19
 
@@ -29,16 +29,16 @@ describe RightConf::RubyConfigurator do
29
29
  it 'should succeed on linux when rvm succeeds' do
30
30
  should_execute('rvm', '--version').once.and_return(success_result("rvm #{RVM_VERSION}"))
31
31
  should_execute('rvm', 'current').once.and_return(success_result("0@"))
32
- should_execute('rvm', '0@', 'gem', '--version').once.and_return(success_result('1'))
32
+ should_execute('rvm', '0@', 'exec', '--', 'gem', '--version').once.and_return(success_result('1'))
33
33
  @configurator.run_linux
34
34
  end
35
35
 
36
36
  it 'should install rvm if needed' do
37
- rvm_tar = "rvm-#{RVM_VERSION}.tar.gz"
37
+ rvm_tar = "rvm-#{RVM_VERSION}.tar.gz"
38
38
  should_execute('rvm', '--version').once.and_return(success_result("rvm"))
39
39
  should_execute('curl', '-O', '-f', "https://rvm.beginrescueend.com/releases/#{rvm_tar}",
40
40
  {:abort_on_failure=>"Failed to download rvm #{RVM_VERSION}"}).once.and_return(success_result)
41
- should_execute('tar', 'zxf', rvm_tar,
41
+ should_execute('tar', 'zxf', rvm_tar,
42
42
  {:abort_on_failure=>"Failed to extract rvm tgz from #{File.expand_path(File.join(File.dirname(__FILE__), '..', '..', "rvm-#{RVM_VERSION}.tar.gz"))}"}).once.and_return(success_result)
43
43
  flexmock(Dir).should_receive(:chdir).and_yield
44
44
  should_execute('./install', {:abort_on_failure=>"Failed to install rvm #{RVM_VERSION}"}).once.and_return(success_result)
@@ -49,7 +49,7 @@ describe RightConf::RubyConfigurator do
49
49
  it 'should install rubygems if needed' do
50
50
  should_execute('rvm', '--version').once.and_return(success_result("rvm #{RVM_VERSION}"))
51
51
  should_execute('rvm', 'current').once.and_return(success_result("0@"))
52
- should_execute('rvm', '0@', 'gem', '--version').once.and_return(success_result('0'))
52
+ should_execute('rvm', '0@', 'exec', '--', 'gem', '--version').once.and_return(success_result('0'))
53
53
  should_execute('rvm', '0@', 'rubygems', '1',
54
54
  {:abort_on_failure=>'Failed to install rubygems'}).once.and_return(success_result)
55
55
  @configurator.run_linux
metadata CHANGED
@@ -1,68 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rconf
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- - 17
9
- version: 0.9.17
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.18
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Raphael Simon
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-02-25 00:00:00 -08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-03-12 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70325338382960 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 2
30
- - 5
31
- version: "2.5"
20
+ - !ruby/object:Gem::Version
21
+ version: '2.5'
32
22
  type: :development
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: flexmock
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70325338382960
25
+ - !ruby/object:Gem::Dependency
26
+ name: flexmock
27
+ requirement: &70325338382440 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
29
+ requirements:
40
30
  - - ~>
41
- - !ruby/object:Gem::Version
42
- segments:
43
- - 0
44
- - 9
45
- version: "0.9"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.9'
46
33
  type: :development
47
- version_requirements: *id002
48
- description: |
49
- rconf configures the environment for a given application. rconf reads
50
- the content of an application configuration file and installs and/or
51
- configures the required tools for running or developing the corresponding
52
- application. rconf can easily be extended to configure new tools and makes
53
- it easy to support multiple platforms.
54
- Consult the README.rdoc file for information on how to write rconf
55
- configuration files.
56
-
57
- email:
34
+ prerelease: false
35
+ version_requirements: *70325338382440
36
+ description: ! "rconf configures the environment for a given application. rconf reads\nthe
37
+ content of an application configuration file and installs and/or\nconfigures the
38
+ required tools for running or developing the corresponding\napplication. rconf can
39
+ easily be extended to configure new tools and makes\nit easy to support multiple
40
+ platforms.\nConsult the README.rdoc file for information on how to write rconf \nconfiguration
41
+ files.\n"
42
+ email:
58
43
  - raphael@rightscale.com
59
- executables:
44
+ executables:
60
45
  - rconf
61
46
  extensions: []
62
-
63
47
  extra_rdoc_files: []
64
-
65
- files:
48
+ files:
66
49
  - .gitignore
67
50
  - Gemfile
68
51
  - LICENSE
@@ -118,39 +101,31 @@ files:
118
101
  - spec/ruby_extensions_spec.rb
119
102
  - spec/spec_helper.rb
120
103
  - spec/support/package_installer_spec.rb
121
- has_rdoc: true
122
104
  homepage: http://rubygems.org/gems/rconf
123
105
  licenses: []
124
-
125
106
  post_install_message:
126
107
  rdoc_options: []
127
-
128
- require_paths:
108
+ require_paths:
129
109
  - lib
130
- required_ruby_version: !ruby/object:Gem::Requirement
110
+ required_ruby_version: !ruby/object:Gem::Requirement
131
111
  none: false
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- segments:
136
- - 0
137
- version: "0"
138
- required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ! '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
117
  none: false
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- segments:
144
- - 0
145
- version: "0"
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
146
122
  requirements: []
147
-
148
123
  rubyforge_project: rconf
149
- rubygems_version: 1.3.7
124
+ rubygems_version: 1.8.15
150
125
  signing_key:
151
126
  specification_version: 3
152
127
  summary: Cross platform environment configuration
153
- test_files:
128
+ test_files:
154
129
  - spec/command_spec.rb
155
130
  - spec/configurator_spec.rb
156
131
  - spec/configurators/build_configurator_spec.rb