Module: Lynx

Defined in:
lib/lynx.rb,
lib/lynx/d_s_l.rb,
lib/lynx/error.rb,
lib/lynx/config.rb,
lib/lynx/version.rb,
lib/lynx/pipe/get.rb,
lib/lynx/pipe/run.rb,
lib/lynx/pipe/basic.rb,
lib/lynx/pipe/debug.rb,
lib/lynx/pipe/write.rb,
lib/lynx/system_out.rb,
lib/lynx/pipe/append.rb,
lib/lynx/pipe/import.rb,
lib/lynx/pipe/p_open.rb,
lib/lynx/command/dump.rb,
lib/lynx/command/basic.rb

Defined Under Namespace

Modules: Command, Pipe, SystemOut Classes: Config, DSL, Error

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.append(*args) ⇒ Object



29
30
31
# File 'lib/lynx.rb', line 29

def append(*args)
  Pipe::Append.new(*args)
end

.config(options) ⇒ Object



12
13
14
# File 'lib/lynx.rb', line 12

def config(options)
  Lynx::DSL.new(options)
end

.debug(*args) ⇒ Object



53
54
55
# File 'lib/lynx.rb', line 53

def debug(*args)
  Pipe::Debug.new(*args)
end

.getObject



41
42
43
# File 'lib/lynx.rb', line 41

def get
  Pipe::Get.new
end

.import(*args) ⇒ Object



49
50
51
# File 'lib/lynx.rb', line 49

def import(*args)
  Pipe::Import.new(*args)
end

.popen(*args) ⇒ Object



37
38
39
# File 'lib/lynx.rb', line 37

def popen(*args)
  Pipe::POpen.new(*args)
end

.rails(env = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lynx.rb', line 16

def rails(env = nil)
  if defined?(Rails)
    env ||= Rails.env
    hash = Rails.configuration.database_configuration
  elsif File.exists?('config/database.yml')
    hash = YAML::load(ERB.new(IO.read('config/database.yml')).result)
  else
    raise RuntimeError, 'unable to find configuration file'
  end

  config(hash[env.to_s])
end

.runObject



33
34
35
# File 'lib/lynx.rb', line 33

def run
  Pipe::Run.new
end

.write(*args) ⇒ Object



45
46
47
# File 'lib/lynx.rb', line 45

def write(*args)
  Pipe::Write.new(*args)
end