Sha256: 7530510ffbd0d56da877187926b8abe65c4bb6ab1d2fa40eff3af3e8f29b51d3

Contents?: true

Size: 787 Bytes

Versions: 8

Compression:

Stored size: 787 Bytes

Contents

module Percy
  module Capybara
    class Client
      module Builds
        def current_build
          return if !enabled?  # Silently skip if the client is disabled.
          @current_build ||= client.create_build(client.config.repo)
        end
        alias_method :initialize_build, :current_build

        def build_initialized?
          !!@current_build
        end

        def finalize_current_build
          return if !enabled?  # Silently skip if the client is disabled.
          if !build_initialized?
            raise Percy::Capybara::Client::BuildNotInitializedError.new(
              'Failed to finalize build because no build has been initialized.')
          end
          client.finalize_build(current_build['data']['id'])
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
percy-capybara-0.3.0 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.5 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.4 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.3 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.2 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.1 lib/percy/capybara/client/builds.rb
percy-capybara-0.2.0 lib/percy/capybara/client/builds.rb
percy-capybara-0.1.3 lib/percy/capybara/client/builds.rb