rconf 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -19,6 +19,7 @@ require 'rake/gempackagetask'
19
19
  require 'rake/clean'
20
20
 
21
21
  task :default => 'spec'
22
+ task :build => [ 'spec', 'gem' ]
22
23
 
23
24
  # == Unit Tests == #
24
25
 
@@ -103,7 +103,7 @@ module RightConf
103
103
  # === Return
104
104
  # path(String):: Path
105
105
  def pick_default_path(first_choice)
106
- path = first_choice ? DEFAULT_NGINX_INSTALL[0] : DEFAULT_NGINX_INSTALL[1]
106
+ path = DEFAULT_NGINX_INSTALL[first_choice && 0 || 1]
107
107
  end
108
108
 
109
109
  # Install passenger gem
@@ -228,30 +228,9 @@ module RightConf
228
228
  # === Return
229
229
  # true:: Always return true
230
230
  def setup_bashrc
231
- candidates = ['.bashrc', '.bash_profile']
232
- candidates.map! { |c| File.join(ENV['HOME'], c) }
233
- bashrc_path = candidates.detect { |c| File.exist?(c) }
234
- if bashrc_path
235
- content = IO.read(bashrc_path)
236
- unless content.include?(rvm_bash_activation)
237
- i = content.index(/^\s*PATH=[^$PATH]/)
238
- if i
239
- next_line = content.index("\n", i + 1)
240
- if next_line
241
- content.insert(next_line + 1, rvm_bash_activation + "\n")
242
- else
243
- content += "\n" + rvm_bash_activation
244
- end
245
- else
246
- content = rvm_bash_activation + "\n" + content
247
- end
248
- FileUtils.mv(bashrc_path, bashrc_path + '.old')
249
- File.open(bashrc_path, 'w') { |f| f.puts content }
250
- post_note 'rvm was installed, please reload your shell to activate it and re-run rconf'
251
- aborting(true)
252
- end
253
- else
254
- report_error("Failed to update bashrc to activate rvm, no bashrc found")
231
+ if EnvironmentUpdater.update(rvm_bash_activation, ['PATH'])
232
+ post_note 'rvm was installed, please reload your shell to activate it and re-run rconf'
233
+ aborting(true)
255
234
  end
256
235
  end
257
236
 
@@ -13,7 +13,7 @@ module RightConf
13
13
 
14
14
  MAJOR = 0
15
15
  MINOR = 7
16
- BUILD = 3
16
+ BUILD = 4
17
17
 
18
18
  VERSION = [MAJOR, MINOR, BUILD].map(&:to_s).join('.')
19
19
 
@@ -106,8 +106,7 @@ describe RightConf::RubyConfigurator do
106
106
  flexmock(IO).should_receive(:read).and_return(<<-EOS
107
107
  echo 'zobi la mouche'
108
108
  radio killed the radio star
109
- #PATH=something
110
- PATH=$PATH:should be fine
109
+ #PATH=something:should be fine
111
110
  this should not:
112
111
  PATH=something
113
112
  AFTER
@@ -117,8 +116,7 @@ AFTER
117
116
  @bashrc_content.should == <<-EOS
118
117
  echo 'zobi la mouche'
119
118
  radio killed the radio star
120
- #PATH=something
121
- PATH=$PATH:should be fine
119
+ #PATH=something:should be fine
122
120
  this should not:
123
121
  PATH=something
124
122
  #{@rvm_bash_activation}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rconf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.7.3
5
+ version: 0.7.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Raphael Simon
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-23 00:00:00 -07:00
13
+ date: 2011-03-30 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency