Class: Versionius::Builder
- Inherits:
-
Object
- Object
- Versionius::Builder
- Defined in:
- lib/versionius/builder.rb
Instance Method Summary collapse
-
#initialize(repository_path, version_file_path) ⇒ Builder
constructor
A new instance of Builder.
- #run ⇒ Object
Constructor Details
#initialize(repository_path, version_file_path) ⇒ Builder
Returns a new instance of Builder.
6 7 8 9 |
# File 'lib/versionius/builder.rb', line 6 def initialize(repository_path, version_file_path) @repository_path = repository_path @version_file_path = version_file_path end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/versionius/builder.rb', line 11 def run repo = Grit::Repo.new(@repository_path) File.open(File.join(@version_file_path, Versionius::FILE_NAME), "w+") do |file| tag = repo..last unless tag.nil? file.puts "#{Versionius::TAG_TITLE} #{tag.name}" commits = (repo) if repo..size > 1 end (commits || repo.commits).each do |commit| file.puts commit. end end end |