class Azuki::Command::Sharing
manage collaborators on an app
Public Instance Methods
add()
click to toggle source
sharing:add EMAIL add a collaborator to an app
Example:
$ azuki sharing:add collaborator@example.com Adding collaborator@example.com to example collaborators... done
# File lib/azuki/command/sharing.rb, line 38 def add unless email = shift_argument error("Usage: azuki sharing:add EMAIL\nMust specify EMAIL to add sharing.") end validate_arguments! action("Adding #{email} to #{app} collaborators") do api.post_collaborator(app, email) end end
index()
click to toggle source
sharing list collaborators on an app
Example:
$ azuki sharing === example Collaborators collaborator@example.com email@example.com
# File lib/azuki/command/sharing.rb, line 20 def index validate_arguments! # this is never empty, as it always includes the owner collaborators = api.get_collaborators(app).body styled_header("#{app} Collaborators") styled_array(collaborators.map {|collaborator| collaborator["email"]}) end
remove()
click to toggle source
sharing:remove EMAIL remove a collaborator from an app
Example:
$ azuki sharing:remove collaborator@example.com Removing collaborator@example.com to example collaborators... done
# File lib/azuki/command/sharing.rb, line 58 def remove unless email = shift_argument error("Usage: azuki sharing:remove EMAIL\nMust specify EMAIL to remove sharing.") end validate_arguments! action("Removing #{email} from #{app} collaborators") do api.delete_collaborator(app, email) end end
transfer()
click to toggle source
sharing:transfer EMAIL transfer an app to a new owner
Example:
$ azuki sharing:transfer collaborator@example.com Transferring example to collaborator@example.com... done
# File lib/azuki/command/sharing.rb, line 78 def transfer unless email = shift_argument error("Usage: azuki sharing:transfer EMAIL\nMust specify EMAIL to transfer an app.") end validate_arguments! action("Transferring #{app} to #{email}") do api.put_app(app, "transfer_owner" => email) end end