Sha256: 0d34504998a49290b9c0dce4e19a43dbbe5d7f07b61e631c52f18f5c9b09dfb4

Contents?: true

Size: 738 Bytes

Versions: 18

Compression:

Stored size: 738 Bytes

Contents

module Berkshelf::API::RSpec
  module Server
    class << self
      include Berkshelf::API::Mixin::Services

      def clear_cache
        cache_manager.clear
      end

      def instance
        Berkshelf::API::Application.instance
      end

      def running?
        Berkshelf::API::Application.running?
      end

      def start(options = {})
        options = options.reverse_merge(port: 26210, log_location: "/dev/null", endpoints: [])
        Berkshelf::API::Application.config.endpoints = options[:endpoints]
        unless running?
          Berkshelf::API::Application.run!(options)
          cache_builder.build
        end
      end

      def stop
        Berkshelf::API::Application.shutdown
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
berkshelf-api-3.0.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.2.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.1.3 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.1.2 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.1.1 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.1.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-2.0.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.4.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.3.1 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.3.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.2.2 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.2.1 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.2.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.2.0.rc2 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.2.0.rc1 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.1.1 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.1.0 lib/berkshelf/api/rspec/server.rb
berkshelf-api-1.0.0 lib/berkshelf/api/rspec/server.rb