Class: Woro::Adapters::Base

Inherits:
Object
  • Object
show all
Includes:
Commander::UI
Defined in:
lib/woro/adapters/base.rb

Direct Known Subclasses

Ftp

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_initial_remote_task(app_name, access_token = nil) ⇒ Object

Creates an initial welcome gist on project setup initial welcome message

Parameters:

  • app_name (String)

    Name of the app is displayed in the



36
37
38
# File 'lib/woro/adapters/base.rb', line 36

def self.create_initial_remote_task(app_name, access_token = nil)
  # not implemented
end

Instance Method Details

#extract_description(content) ⇒ Object

Extract description from file content string.

String

description string

Parameters:

  • content (String)

    content of task file



10
11
12
# File 'lib/woro/adapters/base.rb', line 10

def extract_description(content)
  Woro::TaskList.extract_description content
end

#list_contentsHash

Returns the list of files included in the Gist

Returns:

  • (Hash)

    List of files in the format { filename: { data }}



22
23
24
# File 'lib/woro/adapters/base.rb', line 22

def list_contents
  fail('Requires implementation')
end

#list_filesArray

Returns the list of files included in the Gist

Returns:

  • (Array)

    List of file names



16
17
18
# File 'lib/woro/adapters/base.rb', line 16

def list_files
  fail('Requires implementation')
end

#push(task) ⇒ Object

Push this task’s file content to the Gist collection on the server. Existing contents by the same #file_name will be overriden, but can be accessed via Github or Gist’s API.



29
30
31
# File 'lib/woro/adapters/base.rb', line 29

def push(task)
  fail('Requires implementation')
end

#raw_url(file_name) ⇒ String

The raw url is a permalink for downloading the content rake task within the Gist as a file.

Parameters:

  • file_name (String)

    name of the file to retrieve the download url

Returns:

  • (String)

    HTTP-URL of addressed file within the gist collection



44
45
46
# File 'lib/woro/adapters/base.rb', line 44

def raw_url(file_name)
  fail('Requires implementation')
end