hubbard 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/commands/list-users.rb +11 -4
- data/hubbard.gemspec +2 -2
- data/spec/hubbard_spec.rb +12 -0
- data/spec/yaml_spec.rb +8 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.14
|
data/commands/list-users.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
if @username != 'admin'
|
2
|
-
|
3
|
-
|
2
|
+
$stderr.puts "You don't have permission to do that"
|
3
|
+
exit 3
|
4
4
|
end
|
5
5
|
|
6
|
-
|
6
|
+
accounts = []
|
7
|
+
Dir.entries(Hubbard::ACCOUNTS_PATH).each do |account|
|
7
8
|
next if account == '.' || account == '..'
|
8
|
-
|
9
|
+
accounts << account
|
10
|
+
end
|
11
|
+
|
12
|
+
if OPTIONS[:format] == :yaml
|
13
|
+
puts YAML::dump(accounts)
|
14
|
+
else
|
15
|
+
accounts.each { |a| puts a }
|
9
16
|
end
|
data/hubbard.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{hubbard}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matthew Foemmel"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-07}
|
13
13
|
s.default_executable = %q{hubbard}
|
14
14
|
s.description = %q{Hubbard is a command line tool for managing git repositories.}
|
15
15
|
s.email = %q{git@foemmel.com}
|
data/spec/hubbard_spec.rb
CHANGED
@@ -248,6 +248,18 @@ describe "Hubble" do
|
|
248
248
|
hub("kipper", "add-key laptop", "ssh-rsa yabbadabba fdsa")
|
249
249
|
end
|
250
250
|
|
251
|
+
it "should list users for admin" do
|
252
|
+
hub("kipper", "add-key laptop", "ssh-rsa yabbadabba fdsa")
|
253
|
+
users = hub("admin", "list-users").split("\n").map { |l| l.split[0] }
|
254
|
+
users.size.should == 1
|
255
|
+
users.first.should == "kipper"
|
256
|
+
end
|
257
|
+
|
258
|
+
it "should not list users for non-admin" do
|
259
|
+
hub("kipper", "add-key laptop", "ssh-rsa yabbadabba fdsa")
|
260
|
+
lambda { hub("kipper", "list-users") }.should raise_error
|
261
|
+
end
|
262
|
+
|
251
263
|
it "should allow admin to run-as another user" do
|
252
264
|
hub("admin", "run-as kipper create-project foo foo-desc")
|
253
265
|
projects = list_projects("kipper")
|
data/spec/yaml_spec.rb
CHANGED
@@ -37,4 +37,12 @@ describe "Hubble with yaml output" do
|
|
37
37
|
permissions.first[:user].should == "yammer"
|
38
38
|
permissions.first[:access].should == "admin"
|
39
39
|
end
|
40
|
+
|
41
|
+
it "should list users for admin" do
|
42
|
+
hub("kipper", "add-key laptop", "ssh-rsa yabbadabba fdsa")
|
43
|
+
hub("yammer", "add-key ipad", "ssh-rsa fadadada chacaha")
|
44
|
+
users = YAML::load(hub("admin", "#{YAML_OPTION} list-users"))
|
45
|
+
users.size.should == 2
|
46
|
+
users.should == ["kipper", "yammer"]
|
47
|
+
end
|
40
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubbard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Foemmel
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-07 00:00:00 -06:00
|
13
13
|
default_executable: hubbard
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|