Module: Frails

Extended by:
Frails
Included in:
Frails
Defined in:
lib/frails.rb,
lib/frails/utils.rb,
lib/frails/version.rb,
lib/frails/log_subscriber.rb,
lib/frails/component/test_helpers.rb,
lib/frails/monkey/action_view/renderer.rb,
lib/frails/monkey/action_view/partial_renderer.rb,
lib/frails/monkey/action_view/abstract_renderer.rb,
lib/frails/monkey/action_view/template_renderer.rb

Defined Under Namespace

Modules: Component, Helper, Monkey, SideLoadAssets, Utils Classes: DevServer, DevServerProxy, Engine, LogSubscriber, Manifest, ManifestManager

Constant Summary collapse

VERSION =
'0.8.2'
@@public_output_path =
'assets'
@@manifest_path =
'manifest.json'
@@dev_server_host =
'localhost'
@@dev_server_port =
8080

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Frails)

    the object that the method was called on



34
35
36
# File 'lib/frails.rb', line 34

def self.setup
  yield self
end

Instance Method Details

#components_pathObject



51
52
53
# File 'lib/frails.rb', line 51

def components_path
  @components_path ||= Rails.root.join('app', 'components')
end

#configObject



38
39
40
41
42
43
44
45
# File 'lib/frails.rb', line 38

def config
  {
    public_output_path: @@public_output_path,
    dev_server_host: @@dev_server_host,
    dev_server_port: @@dev_server_port,
    manifest_path: @@manifest_path
  }
end

#config_as_jsonObject



47
48
49
# File 'lib/frails.rb', line 47

def config_as_json
  config.merge({ rails_env: Rails.env }).transform_keys { |key| key.to_s.camelize :lower }.to_json
end

#dev_serverObject



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

def dev_server
  @dev_server ||= Frails::DevServer.new
end

#manifestObject



14
15
16
# File 'lib/frails.rb', line 14

def manifest
  @manifest ||= Frails::ManifestManager.new
end