Module: Lattice

Defined in:
lib/lattice.rb,
lib/lattice/cli.rb,
lib/lattice/server.rb,
lib/lattice/version.rb,
lib/lattice/resource.rb,
lib/lattice/generator.rb,
lib/lattice/application.rb,
lib/lattice/request_logger.rb,
lib/lattice/generators/app_base.rb

Defined Under Namespace

Modules: Generator, Generators Classes: Application, CLI, RequestLogger, Resource, Server

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.appObject



10
11
12
13
# File 'lib/lattice.rb', line 10

def app
  raise "no application set" unless defined?(@app)
  @app
end

.loggerObject



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

def logger
  @logger || Celluloid.logger
end

Class Method Details

.rootObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/lattice.rb', line 19

def root
  @root || begin
    pwd = Dir.pwd
    gemfile = File.join pwd, 'Gemfile'

    # FIXME: Kinda hax :|
    unless File.read(gemfile)["gem 'lattice'"]
      raise "couldn't find app in: '#{Dir.pwd}'"
    end

    pwd
  end
end

.root=(path) ⇒ Object



15
16
17
# File 'lib/lattice.rb', line 15

def root=(path)
  @root = Pathname.new(path)
end