Class: Chaplin

Inherits:
Object
  • Object
show all
Defined in:
lib/chaplin.rb,
lib/chaplin/new.rb,
lib/chaplin/parser.rb,
lib/chaplin/server.rb,
lib/chaplin/api_endpoint.rb,
lib/chaplin/parser/pages.rb,
lib/chaplin/parser/config.rb,
lib/chaplin/parser/router.rb,
lib/chaplin/inline_partial.rb,
lib/chaplin/responses/page.rb,
lib/chaplin/parser/redirects.rb,
lib/chaplin/responses/redirect.rb,
lib/chaplin/parser/api_endpoints.rb,
lib/chaplin/parser/declaration_file.rb

Defined Under Namespace

Modules: New, Parser, Responses Classes: ApiEndpoint, InlinePartial, Server

Instance Method Summary collapse

Constructor Details

#initialize(project_path) ⇒ Chaplin

Returns a new instance of Chaplin.



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

def initialize(project_path)
  @project_path = project_path
  @config = Parser::Config.new(@project_path)
end

Instance Method Details

#serverObject



15
16
17
18
19
20
21
# File 'lib/chaplin.rb', line 15

def server
  ApiEndpoint.configure(@config.api_url, @config.default_headers, @config.basic_auth)
  Server.setup(@project_path)
  build_server
  setup_404_page
  Server.new
end