hubbard 0.0.13 → 0.0.14

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.13
1
+ 0.0.14
@@ -1,9 +1,16 @@
1
1
  if @username != 'admin'
2
- $stderr.puts "You don't have permission to do that"
3
- exit 3
2
+ $stderr.puts "You don't have permission to do that"
3
+ exit 3
4
4
  end
5
5
 
6
- Dir.entries(Hubbard::ACCOUNTS_PATH)).each do |account|
6
+ accounts = []
7
+ Dir.entries(Hubbard::ACCOUNTS_PATH).each do |account|
7
8
  next if account == '.' || account == '..'
8
- puts account
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
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hubbard}
8
- s.version = "0.0.13"
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-06}
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}
@@ -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")
@@ -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.13
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-06 00:00:00 -06:00
12
+ date: 2010-02-07 00:00:00 -06:00
13
13
  default_executable: hubbard
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency