Sha256: 1662d6628cb85097e98822a6fa139583ea15a5d7d3de96d032b04aecf9436d7d

Contents?: true

Size: 932 Bytes

Versions: 2

Compression:

Stored size: 932 Bytes

Contents

require 'sinatra/base'

require 'puppet-herald/app/configuration'
require 'puppet-herald/app/api'
require 'puppet-herald/app/frontend'

# A module for Herald
module PuppetHerald
  # Class for an Herald sinatra application
  class Application < Sinatra::Application
    use PuppetHerald::App::Configuration
    use PuppetHerald::App::Frontend
    use PuppetHerald::App::Api

    class << self
      # Executes the Herald application
      #
      # @param options [Hash] an extra options for Rack server
      # @param block [block] an extra configuration block
      # @return [Sinatra::Application] an Herald application
      def run!(options = {}, &block)
        PuppetHerald::App::Configuration.configure_app
        super options, *block
      end

      # Deconfigure application
      #
      # @return [nil]
      def quit!
        PuppetHerald::App::Configuration.deconfigure_app
        super
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-herald-0.8.1 lib/puppet-herald/application.rb
puppet-herald-0.8.0 lib/puppet-herald/application.rb