Module: Biogem::Naming
- Included in:
- Jeweler::Generator
- Defined in:
- lib/bio-gem/mod/biogem.rb
Instance Method Summary collapse
- #engine_dirs ⇒ Object
- #engine_filename ⇒ Object
- #engine_module_name ⇒ Object
- #engine_name ⇒ Object
- #engine_name_prefix ⇒ Object
- #engine_namespace ⇒ Object
- #lib_sub_module ⇒ Object
- #sub_module ⇒ Object
Instance Method Details
#engine_dirs ⇒ Object
61 62 63 |
# File 'lib/bio-gem/mod/biogem.rb', line 61 def engine_dirs %w{app app/controllers app/views app/helpers config app/views/foos} end |
#engine_filename ⇒ Object
69 70 71 |
# File 'lib/bio-gem/mod/biogem.rb', line 69 def engine_filename "#{engine_name}.rb" end |
#engine_module_name ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/bio-gem/mod/biogem.rb', line 73 def engine_module_name module_name = project_name.split('-').map{|module_sub_name| module_sub_name.capitalize}.join module_name.instance_eval do # Handle underscore in routing template def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end module_name end |
#engine_name ⇒ Object
65 66 67 |
# File 'lib/bio-gem/mod/biogem.rb', line 65 def engine_name "#{project_name}-engine" end |
#engine_name_prefix ⇒ Object
88 89 90 |
# File 'lib/bio-gem/mod/biogem.rb', line 88 def engine_name_prefix project_name.split('-').gsub(/-/,'_')<<'_' end |
#engine_namespace ⇒ Object
92 93 94 |
# File 'lib/bio-gem/mod/biogem.rb', line 92 def engine_namespace "/#{[:biogem_engine]}" end |
#lib_sub_module ⇒ Object
100 101 102 |
# File 'lib/bio-gem/mod/biogem.rb', line 100 def lib_sub_module path(lib_dir,"bio",sub_module.downcase) end |
#sub_module ⇒ Object
96 97 98 |
# File 'lib/bio-gem/mod/biogem.rb', line 96 def sub_module project_name.split('-')[1..-1].map{|x| x.capitalize}.join end |