Class: Pah::Templates::Inflection

Inherits:
Pah::Template
  • Object
show all
Defined in:
lib/pah/templates/inflection.rb

Instance Method Summary collapse

Methods inherited from Pah::Template

#ask_unless_test, #copy_static_file, #git_commit, #static_files, #will_you_like_to?

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pah/templates/inflection.rb', line 4

def call
  api_acronym_config = <<API_ACRONYM

ActiveSupport::Inflector.inflections do |inflect|
  inflect.acronym 'API'
end
API_ACRONYM

  inject_into_file 'config/initializers/inflections.rb', api_acronym_config,  after: /'RESTful'\n#\ end\n/, verbose: false

  git add: 'config/initializers/inflections.rb'
  git_commit 'Add API acronym to inflections.rb.'
end