Class: Chaplin

Inherits:
Object
  • Object
show all
Defined in:
lib/chaplin.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/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: Parser, Responses Classes: ApiEndpoint, Server

Instance Method Summary collapse

Constructor Details

#initialize(project_path) ⇒ Chaplin

Returns a new instance of Chaplin.



8
9
10
11
# File 'lib/chaplin.rb', line 8

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

Instance Method Details

#serverObject



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

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