Class: WaxTasks::LocalBranch

Inherits:
Branch
  • Object
show all
Defined in:
lib/wax_tasks/branch.rb

Overview

Branch object for ‘$ wax:push` task when run on local machine using local credentials

Instance Attribute Summary collapse

Attributes inherited from Branch

#success, #target

Instance Method Summary collapse

Methods inherited from Branch

inherited, #push, #rebuild

Constructor Details

#initialize(site, target) ⇒ LocalBranch

Returns a new instance of LocalBranch.



101
102
103
104
105
106
107
108
# File 'lib/wax_tasks/branch.rb', line 101

def initialize(site, target)
  super(site, target)

  @origin       = `git config --get remote.origin.url`.strip
  @commit_msg   = "Updated via local task at #{Time.now.utc}"
  @baseurl      = @origin.split('/').last.gsub('.git', '')
  @success_msg  = "Deploying to #{@target} branch from local task."
end

Instance Attribute Details

#baseurlString

the site baseurl to build with (if on gh-pages)

Returns:

  • (String)

    the current value of baseurl



100
101
102
# File 'lib/wax_tasks/branch.rb', line 100

def baseurl
  @baseurl
end

#commit_msgString

the commit message to use on push

Returns:

  • (String)

    the current value of commit_msg



100
101
102
# File 'lib/wax_tasks/branch.rb', line 100

def commit_msg
  @commit_msg
end

#originString

the current repository remote

Returns:

  • (String)

    the current value of origin



100
101
102
# File 'lib/wax_tasks/branch.rb', line 100

def origin
  @origin
end

#success_msgString

informative message to be output to console

Returns:

  • (String)

    the current value of success_msg



100
101
102
# File 'lib/wax_tasks/branch.rb', line 100

def success_msg
  @success_msg
end