Module: Ruport::Generator::Helpers

Defined in:
lib/ruport/util/generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#check_for_filesObject


10
11
12
13
14
15
16
17
18
# File 'lib/ruport/util/generator.rb', line 10

def check_for_files
  if File.exist? "lib/reports/#{ARGV[1]}.rb"
    raise "Report #{ARGV[1]} exists!"
  end

  if File.exist? "lib/controllers/#{ARGV[1]}.rb"
    raise "Controller #{ARGV[1]} exists!"
  end
end

#format_class_name(string) ⇒ Object


6
7
8
# File 'lib/ruport/util/generator.rb', line 6

def format_class_name(string)
  string.downcase.split("_").map { |s| s.capitalize }.join
end