Module: BunBunBundle

Defined in:
lib/bun_bun_bundle.rb,
lib/bun_bun_bundle/config.rb,
lib/bun_bun_bundle/hanami.rb,
lib/bun_bun_bundle/helpers.rb,
lib/bun_bun_bundle/railtie.rb,
lib/bun_bun_bundle/version.rb,
lib/bun_bun_bundle/manifest.rb,
lib/bun_bun_bundle/safe_html.rb,
lib/bun_bun_bundle/reload_tag.rb,
lib/bun_bun_bundle/dev_cache_middleware.rb

Defined Under Namespace

Modules: HanamiIntegration, Helpers, ReloadTag, SafeHtml Classes: Config, DevCacheMiddleware, Manifest, Railtie

Constant Summary collapse

VERSION =
'0.1.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.asset_hostObject



23
24
25
# File 'lib/bun_bun_bundle.rb', line 23

def asset_host
  @asset_host || ''
end

.configObject



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

def config
  @config ||= Config.new
end

.environmentObject



27
28
29
# File 'lib/bun_bun_bundle.rb', line 27

def environment
  @environment || ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
end

.manifestObject



19
20
21
# File 'lib/bun_bun_bundle.rb', line 19

def manifest
  @manifest ||= Manifest.new
end

Class Method Details

.bun_pathObject

Returns the path to the bundled JS files shipped with the gem.



40
41
42
# File 'lib/bun_bun_bundle.rb', line 40

def bun_path
  File.expand_path('bun', __dir__)
end

.development?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/bun_bun_bundle.rb', line 31

def development?
  environment == 'development'
end

.production?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/bun_bun_bundle.rb', line 35

def production?
  environment == 'production'
end

.reset!Object

Resets all state. Useful for testing.



45
46
47
48
49
50
# File 'lib/bun_bun_bundle.rb', line 45

def reset!
  @config = nil
  @manifest = nil
  @asset_host = nil
  @environment = nil
end