Class: Buildr::IntellijIdea::IdeaFile

Inherits:
Object
  • Object
show all
Defined in:
lib/buildr/intellij_idea/idea_file.rb

Overview

Abstract base class for IdeaModule and IdeaProject

Direct Known Subclasses

IdeaModule, IdeaProject

Constant Summary collapse

DEFAULT_SUFFIX =
""

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#buildr_projectObject (readonly)

Returns the value of attribute buildr_project.



7
8
9
# File 'lib/buildr/intellij_idea/idea_file.rb', line 7

def buildr_project
  @buildr_project
end

#idObject



20
21
22
# File 'lib/buildr/intellij_idea/idea_file.rb', line 20

def id
  @id ||= buildr_project.name.split(':').last
end

#suffixObject



12
13
14
# File 'lib/buildr/intellij_idea/idea_file.rb', line 12

def suffix
  @suffix ||= DEFAULT_SUFFIX
end

#templateObject

Returns the value of attribute template.



10
11
12
# File 'lib/buildr/intellij_idea/idea_file.rb', line 10

def template
  @template
end

Instance Method Details

#add_component(name, attrs = {}, &xml) ⇒ Object



24
25
26
# File 'lib/buildr/intellij_idea/idea_file.rb', line 24

def add_component(name, attrs = {}, &xml)
  self.components << create_component(name, attrs, &xml)
end

#filenameObject



16
17
18
# File 'lib/buildr/intellij_idea/idea_file.rb', line 16

def filename
  buildr_project.path_to("#{name}.#{extension}")
end

#write(f) ⇒ Object



28
29
30
# File 'lib/buildr/intellij_idea/idea_file.rb', line 28

def write(f)
  document.write f
end