hubbard 0.0.12 → 0.0.13
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 +1 -1
- data/commands/list-permissions.rb +13 -1
- data/hubbard.gemspec +1 -1
- data/spec/yaml_spec.rb +10 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
@@ -3,12 +3,24 @@ authorize(project_name, 'admin')
|
|
3
3
|
dir = find_project_dir(project_name)
|
4
4
|
username = ARGV.shift
|
5
5
|
|
6
|
+
contents = ""
|
6
7
|
permissions_file = File.join(dir, ".permissions")
|
7
8
|
if File.exists?(permissions_file)
|
8
9
|
File.open(permissions_file, "r+") do |f|
|
9
10
|
f.flock(File::LOCK_EX)
|
10
11
|
contents = f.read
|
11
|
-
puts contents
|
12
12
|
f.flock(File::LOCK_UN)
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
if OPTIONS[:format] == :yaml
|
17
|
+
permissions = []
|
18
|
+
contents.split("\n").map do |l|
|
19
|
+
l.strip!
|
20
|
+
p = l.split('=')
|
21
|
+
permissions << { :user => p.first, :access => p.last }
|
22
|
+
end
|
23
|
+
puts YAML::dump(permissions)
|
24
|
+
elsif OPTIONS[:format] == :text
|
25
|
+
puts contents unless contents.empty?
|
26
|
+
end
|
data/hubbard.gemspec
CHANGED
data/spec/yaml_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe "Hubble with yaml output" do
|
|
11
11
|
reset_file_system
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should
|
14
|
+
it "should list-projects" do
|
15
15
|
hub("yammer", "create-project a a-desc")
|
16
16
|
hub("yammer", "create-project b b-desc")
|
17
17
|
hub("yammer", "create-project c c-desc")
|
@@ -20,7 +20,7 @@ describe "Hubble with yaml output" do
|
|
20
20
|
projects.should == ["a", "b", "c"]
|
21
21
|
end
|
22
22
|
|
23
|
-
it "should
|
23
|
+
it "should list repositories" do
|
24
24
|
hub("yammer", "create-project a a-desc")
|
25
25
|
hub("yammer", "create-repository a b")
|
26
26
|
|
@@ -29,4 +29,12 @@ describe "Hubble with yaml output" do
|
|
29
29
|
repositories.first[:name].should == "b"
|
30
30
|
repositories.first[:url].should == "#{ENV['USER']}@#{HUB_HOST}:a/b.git"
|
31
31
|
end
|
32
|
+
|
33
|
+
it "should list permissions" do
|
34
|
+
hub("yammer", "create-project a a-desc")
|
35
|
+
permissions = YAML::load(hub("yammer", "#{YAML_OPTION} list-permissions a"))
|
36
|
+
permissions.length.should == 1
|
37
|
+
permissions.first[:user].should == "yammer"
|
38
|
+
permissions.first[:access].should == "admin"
|
39
|
+
end
|
32
40
|
end
|