Class: Nuker::Commands::Push
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, dir, options = {}) ⇒ Push
constructor
A new instance of Push.
Methods inherited from Base
Constructor Details
#initialize(project, dir, options = {}) ⇒ Push
Returns a new instance of Push.
10 11 12 13 |
# File 'lib/nuker/commands/push.rb', line 10 def initialize(project, dir, = {}) @project = project @dir = dir end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
8 9 10 |
# File 'lib/nuker/commands/push.rb', line 8 def dir @dir end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/nuker/commands/push.rb', line 8 def project @project end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/nuker/commands/push.rb', line 15 def execute FileUtils.chdir(dir) do content = targz_util.pack(files) resource.post_tar_gz("projects/#{project}/pushes", content) end rescue RestClient::ResourceNotFound raise Nuker::ClientError, "Unknown project \"#{project}\"" end |