Class: Changi::Configuration
- Inherits:
-
Object
- Object
- Changi::Configuration
- Defined in:
- lib/changi/configuration.rb
Instance Attribute Summary collapse
-
#changelog_path ⇒ Object
Returns the value of attribute changelog_path.
-
#changelog_template ⇒ Object
Returns the value of attribute changelog_template.
-
#default_categories ⇒ Object
Returns the value of attribute default_categories.
-
#entries_path ⇒ Object
Returns the value of attribute entries_path.
-
#updater ⇒ Object
Returns the value of attribute updater.
Class Method Summary collapse
Instance Attribute Details
#changelog_path ⇒ Object
Returns the value of attribute changelog_path.
3 4 5 |
# File 'lib/changi/configuration.rb', line 3 def changelog_path @changelog_path end |
#changelog_template ⇒ Object
Returns the value of attribute changelog_template.
7 8 9 |
# File 'lib/changi/configuration.rb', line 7 def changelog_template @changelog_template end |
#default_categories ⇒ Object
Returns the value of attribute default_categories.
5 6 7 |
# File 'lib/changi/configuration.rb', line 5 def default_categories @default_categories end |
#entries_path ⇒ Object
Returns the value of attribute entries_path.
4 5 6 |
# File 'lib/changi/configuration.rb', line 4 def entries_path @entries_path end |
#updater ⇒ Object
Returns the value of attribute updater.
6 7 8 |
# File 'lib/changi/configuration.rb', line 6 def updater @updater end |
Class Method Details
.default ⇒ Object
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 |