module Rg::Helper

Constants

APP_PATH
JS_PATH

Public Class Methods

included(base) click to toggle source
# File lib/rg/helper.rb, line 36
def self.included(base)
  base.source_root File.dirname(__FILE__) + '/../generators/rg/templates'
end

Public Instance Methods

appName() click to toggle source
# File lib/rg/helper.rb, line 18
def appName
  @appName ||= bowerName || railsName
end
app_name() click to toggle source
# File lib/rg/helper.rb, line 14
def app_name
  @app_name ||= appName.underscore
end
bowerName() click to toggle source
# File lib/rg/helper.rb, line 26
def bowerName
  JSON.parse(
    File.read(
      Rails.root + 'bower.json'
    )
  )["name"]
rescue
  nil
end
camelizeLower(name) click to toggle source
# File lib/rg/helper.rb, line 10
def camelizeLower(name)
  name.camelize.sub(/./){ |c| c.downcase }
end
railsName() click to toggle source
# File lib/rg/helper.rb, line 22
def railsName
  camelizeLower(Rails.application.class.parent_name)
end