Module: Namey

Defined in:
lib/namey.rb,
lib/namey/parser.rb,
lib/namey/version.rb,
lib/namey/generator.rb

Defined Under Namespace

Classes: Generator, Parser

Constant Summary collapse

NAME =
"namey"
VERSION =
"0.0.12"

Class Method Summary collapse

Class Method Details

.db_pathObject



2
3
4
# File 'lib/namey.rb', line 2

def self.db_path
  @@db_path ||= "#{'jdbc:' if RUBY_PLATFORM == 'java'}sqlite://" + File.join(self.libdir, "..", "data", "names.db")
end

.db_path=(x) ⇒ Object



5
6
7
# File 'lib/namey.rb', line 5

def self.db_path=(x)
  @@db_path = x
end

.libdirObject

Return a directory with the project libraries.



13
14
15
16
17
18
# File 'lib/namey.rb', line 13

def self.libdir
  t = ["#{File.expand_path(File.dirname(__FILE__))}", "#{Gem.dir}/gems/#{Namey::NAME}-#{Namey::VERSION}"]

  t.each {|i| return i if File.readable?(i) }
  raise "both paths are invalid: #{t}"
end