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 CHANGED
@@ -1 +1 @@
1
- 0.0.12
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hubbard}
8
- s.version = "0.0.12"
8
+ s.version = "0.0.13"
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"]
@@ -11,7 +11,7 @@ describe "Hubble with yaml output" do
11
11
  reset_file_system
12
12
  end
13
13
 
14
- it "should load list-projects" do
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 create repositories" do
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
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.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Foemmel