server-blender 0.0.19 → 0.0.20

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.19
1
+ 0.0.20
@@ -73,6 +73,7 @@ function supported_version()
73
73
  . /etc/lsb-release
74
74
 
75
75
  case "`distribution`" in
76
+ "Ubuntu 9.10") true;;
76
77
  "Ubuntu 10.04") true;;
77
78
  "Ubuntu 10.10") true;;
78
79
  *) false;;
@@ -217,7 +218,7 @@ ENV
217
218
 
218
219
  ( rm /etc/login.defs; awk "/^\s*ENV_SUPATH/{sub(/.*/, \"ENV_SUPATH PATH=$ROOT_PATH\")};/^\s*ENV_PATH/{sub(/.*/, \"ENV_PATH PATH=$USER_PATH\")};{print}" > /etc/login.defs ) < /etc/login.defs
219
220
 
220
- etckeeper commit "after PATH update"
221
+ etckeeper commit "after PATH update" || true
221
222
  }
222
223
 
223
224
  function install_rubygems()
@@ -252,8 +253,9 @@ else
252
253
  install_stuff
253
254
  install_system_ruby
254
255
  install_rubygems
256
+ #add_gems_to_system_path
255
257
 
256
- etckeeper commit "bootstrapped"
258
+ etckeeper commit "bootstrapped" || true # might have nothing to commit
257
259
  fi
258
260
 
259
261
  log "Installing some gems"
@@ -1,7 +1,7 @@
1
1
  set -ue
2
2
 
3
3
  SHADOW_PUPPET_VERSION="0.3.2"
4
- MANIFEST_VERSION="0.1.0"
4
+ MANIFEST_VERSION="0.1.2"
5
5
 
6
6
  trap "echo FAILED" EXIT
7
7
 
@@ -6,7 +6,7 @@ module Blender
6
6
 
7
7
  def run(*cmd)
8
8
  STDERR.puts ">> #{cmd * ' '}"
9
- system(*cmd) unless @dry
9
+ @dry || system(*cmd)
10
10
  end
11
11
 
12
12
  end
@@ -8,6 +8,15 @@ class Blender::Cli::Start < Blender::Cli
8
8
  def parse_options(args)
9
9
  options = {}
10
10
 
11
+ args, extra_args = args.inject([[]]) do |result, element|
12
+ if element == '--'
13
+ result << []
14
+ else
15
+ result.last << element
16
+ end
17
+ result
18
+ end
19
+
11
20
  opts = OptionParser.new do |opts|
12
21
  opts.banner = "Usage: blender start [OPTIONS] [-- [ec2run options]]"
13
22
  opts.separator "Options:"
@@ -67,7 +76,7 @@ blender start -- -g default -g test
67
76
 
68
77
  raise("unexpected: #{args*" "}\n#{opts}") unless args.empty?
69
78
 
70
- options
79
+ return options, extra_args
71
80
  end
72
81
 
73
82
  def default_ami(options = {})
@@ -94,10 +103,11 @@ blender start -- -g default -g test
94
103
  end
95
104
 
96
105
  def execute
97
- options = parse_options(@args)
98
- start_ami(options, *@args)
106
+ options, extra = parse_options(@args)
107
+ start_ami(options, extra)
99
108
 
100
109
  rescue => e
110
+ puts e.backtrace
101
111
  abort(e.to_s)
102
112
  end
103
113
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{server-blender}
8
- s.version = "0.0.19"
8
+ s.version = "0.0.20"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Vitaly Kushner"]
12
- s.date = %q{2010-12-10}
12
+ s.date = %q{2011-01-17}
13
13
  s.default_executable = %q{blender}
14
14
  s.description = %q{Boostrap and manage servers with shadow_puppet
15
15
 
@@ -60,19 +60,25 @@ blender start -- -g default -g test
60
60
  end
61
61
 
62
62
  it "should parse -a" do
63
- @start.parse_options(%w/-a ami123/)[:ami].should == "ami123"
63
+ @start.parse_options(%w/-a ami123/).first[:ami].should == "ami123"
64
64
  end
65
65
 
66
66
  it "should parse -k" do
67
- @start.parse_options(%w/-k mykey/)[:key].should == "mykey"
67
+ @start.parse_options(%w/-k mykey/).first[:key].should == "mykey"
68
68
  end
69
69
 
70
70
  it "should parse --64" do
71
- @start.parse_options(%w/--64/)[64].should == true
71
+ @start.parse_options(%w/--64/).first[64].should == true
72
72
  end
73
73
 
74
74
  it "should parse -n" do
75
- @start.parse_options(%w/-n/)[:dry].should == true
75
+ @start.parse_options(%w/-n/).first[:dry].should == true
76
+ end
77
+
78
+ it "should allow extra args after --" do
79
+ args = %w/-a qwe -k somme_key -- -x foo -y bar baz/
80
+ opts, extra = @start.parse_options(args)
81
+ extra.should == %w/-x foo -y bar baz/
76
82
  end
77
83
 
78
84
  end
@@ -145,7 +151,13 @@ blender start -- -g default -g test
145
151
  end
146
152
  end
147
153
 
148
-
154
+ describe :execute do
155
+ it "should call run with proper arguments" do
156
+ @start = Blender::Cli::Start.new %w/-a qwe -k bar -- -g baz/
157
+ mock(@start).run(*%w/ec2run qwe -k bar -g baz/) {true}
158
+ @start.execute
159
+ end
160
+ end
149
161
 
150
162
 
151
163
 
@@ -5,6 +5,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
5
  require 'blender'
6
6
  require 'spec'
7
7
  require 'spec/autorun'
8
+ require 'activesupport'
8
9
 
9
10
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
11
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-blender
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 19
10
- version: 0.0.19
9
+ - 20
10
+ version: 0.0.20
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vitaly Kushner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-10 00:00:00 +02:00
18
+ date: 2011-02-01 00:00:00 +02:00
19
19
  default_executable: blender
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency