Class: PuppetHerald::App::LogicImpl

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-herald/app/frontend.rb

Overview

Frontend logic impl internal class

Instance Method Summary collapse

Constructor Details

#initializeLogicImpl

Returns a new instance of LogicImpl.



12
13
14
# File 'lib/puppet-herald/app/frontend.rb', line 12

def initialize
  @js = PuppetHerald::Javascript.new
end

Instance Method Details

#app_htmlObject

Gets an app.html



17
18
19
20
21
22
23
24
25
26
# File 'lib/puppet-herald/app/frontend.rb', line 17

def app_html
  if PuppetHerald.in_prod?
    minified = '.min'
    files = ['/app.min.js']
  else
    minified = ''
    files = @js.files
  end
  [minified, files]
end

#uglify(mapname) ⇒ Hash

Uglify an application JS’s into one minified JS file

Parameters:

  • mapname (String)

    name of source map to be put into uglified JS

Returns:

  • (Hash)

    a hash with uglified JS and source map



30
31
32
# File 'lib/puppet-herald/app/frontend.rb', line 30

def uglify(mapname)
  @js.uglify mapname
end