Class: Gitem::Generator
- Inherits:
-
Object
- Object
- Gitem::Generator
- Defined in:
- lib/gitem/generator.rb
Constant Summary collapse
- TEMPLATE_PATH =
File.("index.html", __dir__)
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
Instance Method Summary collapse
- #export! ⇒ Object
-
#initialize(repo_path, output_dir = nil) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(repo_path, output_dir = nil) ⇒ Generator
Returns a new instance of Generator.
8 9 10 11 12 13 |
# File 'lib/gitem/generator.rb', line 8 def initialize(repo_path, output_dir = nil) @repo = Rugged::Repository.new(repo_path) @output_dir = output_dir || File.join(@repo.path, "srv") @processed_trees = Set.new @processed_blobs = Set.new end |
Instance Attribute Details
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
6 7 8 |
# File 'lib/gitem/generator.rb', line 6 def output_dir @output_dir end |
Instance Method Details
#export! ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/gitem/generator.rb', line 15 def export! setup_directories export_branches export_commits export_repo_info copy_template puts "✓ Generated: #{@output_dir}" end |