rconf 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rconf CHANGED
@@ -35,6 +35,7 @@ where [options] are:
35
35
  opt :configurators, 'Show available configurators'
36
36
  opt :config, 'Set path to configuration file', :type => :string
37
37
  opt :output, 'Output file (output to STDOUT by default)', :type => :string
38
+ opt :force, 'Run rconf even if configuration file has not changed'
38
39
  opt :verbose, 'Print debug output'
39
40
  end
40
41
  if opts[:config].nil? && !opts[:configurators]
@@ -91,6 +92,7 @@ where [options] are:
91
92
  begin
92
93
  lang = Language.load(options[:config])
93
94
  report_fatal("Validation of configuration file failed:\n -#{lang.validation_errors.join("\n -").map(&:red)}") unless lang.validation_errors.empty?
95
+ Profile.reset if options[:force]
94
96
  Dir.chdir(File.dirname(options[:config])) { lang.configurators.each(&:run) }
95
97
  report("Successfully configured #{File.basename(options[:config], '.rc').blue} for #{Platform.family.to_s.blue}")
96
98
  rescue Exception => e
@@ -34,7 +34,7 @@ module RightConf
34
34
  report_check("Installing the following packages:\n#{debian.join(' ')}\nThis could take a while")
35
35
  opts = debian.dup
36
36
  opts << { :abort_on_failure => 'Failed to install packages' } if abort_on_failure
37
- Command.execute('sudo', 'aptitude', 'install', *opts)
37
+ Command.execute('sudo', 'apt-get', 'install', '-y', *opts)
38
38
  report_success
39
39
  end
40
40
  alias :run_linux_debian :run_linux_ubuntu
@@ -65,7 +65,7 @@ module RightConf
65
65
  if res.output =~ /^#{gemset}$/
66
66
  report_success
67
67
  else
68
- report_fail
68
+ report_failure
69
69
  report_check("Creating gemset #{gemset} for #{version}")
70
70
  Command.execute('rvm', version, 'gemset', 'create', gemset,
71
71
  :abort_on_failure => "Failed to create gemset '#{gemset}'")
@@ -51,6 +51,15 @@ module RightConf
51
51
  true
52
52
  end
53
53
 
54
+ # Delete profile from disk
55
+ #
56
+ # === Return
57
+ # true:: Always return true
58
+ def reset
59
+ File.delete(profile_path) if File.file?(profile_path)
60
+ true
61
+ end
62
+
54
63
  # Entire profile with all settings
55
64
  #
56
65
  # === Return
@@ -13,7 +13,7 @@ module RightConf
13
13
 
14
14
  MAJOR = 0
15
15
  MINOR = 6
16
- BUILD = 1
16
+ BUILD = 2
17
17
 
18
18
  VERSION = [MAJOR, MINOR, BUILD].map(&:to_s).join('.')
19
19
 
@@ -27,7 +27,7 @@ describe RightConf::PackagesConfigurator do
27
27
 
28
28
  it 'should install packages on Ubuntu' do
29
29
  flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
30
- 'sudo', 'aptitude', 'install', 'deb1', 'deb2').and_return(success_result)
30
+ 'sudo', 'apt-get', 'install', '-y', 'deb1', 'deb2').and_return(success_result)
31
31
  @configurator.run_linux_ubuntu
32
32
  end
33
33
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rconf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.1
5
+ version: 0.6.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Raphael Simon