Class: JaxrsDoc::Site
- Inherits:
-
Object
- Object
- JaxrsDoc::Site
- Defined in:
- lib/site.rb
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#project_version ⇒ Object
readonly
Returns the value of attribute project_version.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(resources, output_location, options = {}) ⇒ Site
constructor
A new instance of Site.
Constructor Details
#initialize(resources, output_location, options = {}) ⇒ Site
Returns a new instance of Site.
11 12 13 14 15 16 17 |
# File 'lib/site.rb', line 11 def initialize(resources, output_location, = {}) @resources = resources.sort! @project_version = [:project_version] @project_name = [:project_name] make_output_dir(output_location) copy_resources_to_output_dir end |
Instance Attribute Details
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
9 10 11 |
# File 'lib/site.rb', line 9 def output_dir @output_dir end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
9 10 11 |
# File 'lib/site.rb', line 9 def project_name @project_name end |
#project_version ⇒ Object (readonly)
Returns the value of attribute project_version.
9 10 11 |
# File 'lib/site.rb', line 9 def project_version @project_version end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
9 10 11 |
# File 'lib/site.rb', line 9 def resources @resources end |
Instance Method Details
#generate ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/site.rb', line 19 def generate @resources.each { |resource| File.open(resource_file_path(resource.name), "w") { |f| content = ERB.new(JaxrsDoc::Templates.get_resource_page).result(binding) f.syswrite(content) } } File.open(index_file_path, "w") { |f| content = ERB.new(JaxrsDoc::Templates.get_index_page).result(binding) f.syswrite(content) } @output_dir end |