Class: Changi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/changi/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#changelog_pathObject

Returns the value of attribute changelog_path.



3
4
5
# File 'lib/changi/configuration.rb', line 3

def changelog_path
  @changelog_path
end

#changelog_templateObject

Returns the value of attribute changelog_template.



7
8
9
# File 'lib/changi/configuration.rb', line 7

def changelog_template
  @changelog_template
end

#default_categoriesObject

Returns the value of attribute default_categories.



5
6
7
# File 'lib/changi/configuration.rb', line 5

def default_categories
  @default_categories
end

#entries_pathObject

Returns the value of attribute entries_path.



4
5
6
# File 'lib/changi/configuration.rb', line 4

def entries_path
  @entries_path
end

#updaterObject

Returns the value of attribute updater.



6
7
8
# File 'lib/changi/configuration.rb', line 6

def updater
  @updater
end

Class Method Details

.defaultObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/changi/configuration.rb', line 9

def self.default
  new.tap do |config|
    config.changelog_path     = File.join Dir.pwd, 'changelog.md'
    config.entries_path       = File.join Dir.pwd, 'changelog'
    config.default_categories = []
    config.updater            = Updater::PrependUpdater
    config.changelog_template = "# <%= release.version %>, <%= Time.now.strftime('%Y-%m-%d') %><%= release.notes and \", \\\#{release.notes}\" %>\n<% entry_set.entries_by_category.each do |category, entries| %>\n## <%= category %>\n\n<%=\n  entries.map do |e|\nif e.text.is_a?(Array)\n  e.text.map.with_index { |l, i| i == 0 ? \"* \\\#{l}\" : \"  \\\#{l}\" }.join(\"\\n\")\nelse\n  \"* \\\#{e.text.gsub(\"\\n\", ' ')}\"\nend\n  end.join(\"\\n\")\n%>\n<% end %>\n"
  end
end