fabric 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/VERSION +1 -1
- data/fabric.gemspec +2 -2
- data/lib/fabric/map.rb +8 -0
- data/spec/classes/map_spec.rb +7 -0
- data/spec/classes/server_spec.rb +0 -1
- data/spec/spec_helper.rb +6 -1
- data/tasks/jeweler.rake +1 -1
- metadata +2 -2
data/LICENSE
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
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.
|
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-
|
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|
|
data/spec/classes/map_spec.rb
CHANGED
@@ -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
|
data/spec/classes/server_spec.rb
CHANGED
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
|
-
|
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
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.
|
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-
|
12
|
+
date: 2010-02-12 00:00:00 +00:00
|
13
13
|
default_executable: fab
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|