module NumberToIndianCurrency

Constants

VERSION

Public Class Methods

initialize() click to toggle source
# File lib/number_to_indian_currency.rb, line 6
def self.initialize
  return if @intialized
  if defined?(ActionView)
    ActionView::Base.send :include, CurrencyHelper
    NumberToIndianCurrency.install
    @intialized = true
  else
    puts "ActionView is not available."
  end
end
install() click to toggle source
# File lib/number_to_indian_currency.rb, line 17
def self.install
  filename = 'rupees.css'
  sourcefile = File.join('lib/assets/stylesheets', filename)
  destfile = File.join(File.dirname(__FILE__), '../app/assets/stylesheets/', filename)
  unless File.exists?(destfile) &&
    FileUtils.identical?(destfile, sourcefile)
    begin
      FileUtils.mkdir_p File.dirname(destfile)
      FileUtils.cp sourcefile, destfile
    rescue Exception => e
      puts e.message
    end
  end
end