Module: EpubForge::Action::SharedActionInterface

Included in:
ThorAction
Defined in:
lib/action/thor_action.rb

Instance Method Summary collapse

Instance Method Details

#description(str = nil) ⇒ Object



4
5
6
7
# File 'lib/action/thor_action.rb', line 4

def description( str = nil )
  @description = str if str
  @description
end

#keywords(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/action/thor_action.rb', line 9

def keywords( *args )
  if args.epf_blank?
    @keywords ||= []
  else 
    @keywords = args.map(&:to_s)
  end
  
  @keywords
end

#project_not_requiredObject

Most actions require – nay, demand! – a project to act upon. Add the line ‘project_not_required’ to the class definition to keep it from failing out if it can’t find an existing project. Used for things like initializing new projects, or… my imagination fails me.



34
35
36
# File 'lib/action/thor_action.rb', line 34

def project_not_required
  @project_required = false
end

#project_required?Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/action/thor_action.rb', line 24

def project_required?
  @project_required = true if @project_required.nil?
  @project_required
end

#usage(str = nil) ⇒ Object



19
20
21
22
# File 'lib/action/thor_action.rb', line 19

def usage( str = nil )
  @usage = str if str
  @usage
end