Sha256: e351834b6637829b82c93f309df4eadb9f272da5702a708bd46bf90a9eda647e

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

module Nucleon
module Action
class Save < Nucleon.plugin_class(:action)
  
  include Mixin::Action::Project
  include Mixin::Action::Commit
  include Mixin::Action::Push
 
  #-----------------------------------------------------------------------------
  # Settings
  
  def configure
    super do 
      codes :project_failure,
            :commit_failure,
            :push_failure
      
      register :path, :str, Dir.pwd
      register :files, :array, '.'
      
      project_config
      commit_config(false)
      push_config
    end
  end
  
  #---
  
  def arguments
    [ :files ]
  end

  #-----------------------------------------------------------------------------
  # Operations
   
  def execute          
    super do
      info('nucleon.actions.save.start')
          
      if project = project_load(settings[:path], false, false)
        if commit(project, settings[:files])
          myself.status = code.push_failure unless push(project)
        else
          myself.status = code.commit_failure
        end
      else
        myself.status = code.project_failure
      end
    end
  end
end
end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nucleon-0.1.19 lib/nucleon/action/save.rb
nucleon-0.1.18 lib/nucleon/action/save.rb
nucleon-0.1.17 lib/nucleon/action/save.rb
nucleon-0.1.16 lib/nucleon/action/save.rb
nucleon-0.1.15 lib/nucleon/action/save.rb
nucleon-0.1.14 lib/nucleon/action/save.rb
nucleon-0.1.13 lib/nucleon/action/save.rb
nucleon-0.1.12 lib/nucleon/action/save.rb
nucleon-0.1.11 lib/nucleon/action/save.rb
nucleon-0.1.10 lib/nucleon/action/save.rb