marionetta 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,9 +24,9 @@ module Marionetta
24
24
  return groups
25
25
  end
26
26
 
27
- def add_server()
28
- server = Marionetta.default_server
29
- yield server
27
+ def add_server(server = nil)
28
+ server ||= Marionetta.default_server
29
+ yield server if block_given?
30
30
  @servers << server
31
31
  end
32
32
 
data/lib/marionetta.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Marionetta
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  DESCRIPTION = 'For lightweight puppet mastery. Organise
4
4
  multiple machines via rsync and SSH rather
5
5
  than using puppet master'
@@ -4,6 +4,12 @@ require 'marionetta/group'
4
4
  describe Marionetta::Group do
5
5
  it 'should add server map' do
6
6
  vagrant = Marionetta::Group.new
7
+ vagrant.add_server({:hostname => 'localhost'})
8
+ vagrant.servers.count.should == 1
9
+ end
10
+
11
+ it 'should add server map from block' do
12
+ vagrant = Marionetta::Group.new
7
13
 
8
14
  vagrant.add_server do |s|
9
15
  s[:hostname] = 'vagrant@192.168.33.11'
@@ -13,6 +19,17 @@ describe Marionetta::Group do
13
19
  vagrant.servers.count.should == 1
14
20
  end
15
21
 
22
+ it 'should extend provided map when block also given' do
23
+ vagrant = Marionetta::Group.new
24
+
25
+ vagrant.add_server(:hostname => 'localhost') do |s|
26
+ s[:additional] = true
27
+ end
28
+
29
+ vagrant.servers.first.has_key?(:hostname).should == true
30
+ vagrant.servers.first.has_key?(:additional).should == true
31
+ end
32
+
16
33
  it 'should add sub groups' do
17
34
  staging = Marionetta::Group.new
18
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionetta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: