fabric 0.3.5 → 0.3.6

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Sam Phillips
1
+ Copyright (c) 2009 Setfire Media
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
data/fabric.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fabric}
8
- s.version = "0.3.5"
8
+ s.version = "0.3.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sam Phillips"]
12
- s.date = %q{2010-02-04}
12
+ s.date = %q{2010-02-12}
13
13
  s.default_executable = %q{fab}
14
14
  s.description = %q{Fabric is a small ruby app to perform tasks on servers via SSH. Built around net/ssh and taking heavy inspiration from Capistrano, it allows you to create policies for server management and perform sysadmin tasks without the need for a process/daemon/dependency or even ruby being installed on the remote server.}
15
15
  s.email = %q{sam.phillips@setfiremedia.com}
data/lib/fabric/map.rb CHANGED
@@ -75,6 +75,14 @@ class Map
75
75
  roles = roles.all(:name.not => role_conditions[:except])
76
76
  end
77
77
 
78
+ if role_conditions.include?(:groups)
79
+ role_conditions[:groups].each do |group|
80
+ users.each do |user|
81
+ user.groups.create(:name => group)
82
+ end
83
+ end
84
+ end
85
+
78
86
  raise DataMapper::ObjectNotFoundError if users.empty? or roles.empty?
79
87
 
80
88
  roles.each do |role|
@@ -178,6 +178,13 @@ describe Map do
178
178
  end
179
179
  end
180
180
 
181
+ describe "with specified :groups" do
182
+ it "should add those groups to those users" do
183
+ @map.grant 'test_user', :all, :groups => ['test_group']
184
+ User.first(:name => 'test_user').groups.first.name.should == 'test_group'
185
+ end
186
+ end
187
+
181
188
  it "should raise a Object Not Found if an invalid user identifier is passed" do
182
189
  lambda { @map.grant 'fake_user', 'test' }.should raise_error(DataMapper::ObjectNotFoundError)
183
190
  end
@@ -94,7 +94,6 @@ describe Server do
94
94
  end
95
95
 
96
96
  it "should identify accounts that require removing" do
97
- debugger
98
97
  @server.accounts_to_remove.should == Array(@doomed_user)
99
98
  end
100
99
 
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,12 @@ $:.unshift File.dirname(__FILE__) + '/../lib'
2
2
 
3
3
  require 'fabric'
4
4
  require 'fabric-test'
5
- require 'database_cleaner'
5
+
6
+ begin
7
+ require 'database_cleaner'
8
+ rescue LoadError
9
+ abort 'Database Cleaner is required to run specs - gem install database_cleaner'
10
+ end
6
11
 
7
12
  TEST_SERVER = Fabric::Test.settings['server']
8
13
  TEST_RUNNER = Fabric::Test.settings['runner']
data/tasks/jeweler.rake CHANGED
@@ -21,5 +21,5 @@ begin
21
21
  end
22
22
  Jeweler::GemcutterTasks.new
23
23
  rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
24
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fabric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Phillips
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-04 00:00:00 +00:00
12
+ date: 2010-02-12 00:00:00 +00:00
13
13
  default_executable: fab
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency