Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Jul 18, 2018
0 parents commit 907c9ec
Show file tree
Hide file tree
Showing 72 changed files with 5,374 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.byebug_history
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec

gem "puma"
91 changes: 91 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
PATH
remote: .
specs:
cuprite (0.1.0)
capybara (>= 2.1, < 4)
cliver (~> 0.3)
websocket-driver (~> 0.7)

GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.3)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
afm (0.2.2)
byebug (10.0.2)
capybara (3.3.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
xpath (~> 3.1)
cliver (0.3.2)
diff-lcs (1.3)
hashery (2.1.2)
image_size (2.0.0)
launchy (2.4.3)
addressable (~> 2.3)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
mustermann (1.0.2)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
pdf-reader (2.1.0)
Ascii85 (~> 1.0.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
public_suffix (3.0.2)
puma (3.11.4)
rack (2.0.5)
rack-protection (2.0.3)
rack
rack-test (1.0.0)
rack (>= 1.0, < 3)
rake (12.3.1)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
ruby-rc4 (0.1.5)
sinatra (2.0.3)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.3)
tilt (~> 2.0)
tilt (2.0.8)
ttfunk (1.5.1)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.1.0)
nokogiri (~> 1.8)

PLATFORMS
ruby

DEPENDENCIES
byebug (~> 10.0)
cuprite!
image_size (~> 2.0)
launchy (~> 2.4)
pdf-reader (~> 2.1)
puma
rake (~> 12.3)
rspec (~> 3.7)
sinatra (~> 2.0)

BUNDLED WITH
1.16.2
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require "bundler/setup"
require "rspec/core/rake_task"

require "capybara/cuprite/version"

RSpec::Core::RakeTask.new("test")
task default: :test
8 changes: 8 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby

require "irb"
require "irb/completion"

require "cuprite"

IRB.start
5 changes: 5 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

require "bundler/setup"
require File.expand_path("spec/support/test_app")
run TestApp
31 changes: 31 additions & 0 deletions cuprite.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
lib = File.expand_path("lib", __dir__)
$:.unshift lib unless $:.include?(lib)

require "capybara/cuprite/version"

Gem::Specification.new do |s|
s.name = "cuprite"
s.version = Capybara::Cuprite::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Dmitry Vorotilin"]
s.email = ["d.vorotilin@gmail.com"]
s.homepage = "https://github.com/machinio/cuprite"
s.summary = "Headless Chrome driver for Capybara"
s.description = "Culprite is a driver for Capybara that allows you to" \
"run your tests on a headless Chrome browser"
s.license = "MIT"
s.require_paths = ["lib/capybara"]
s.files = Dir["{lib}/**/*"]

s.add_runtime_dependency "capybara", ">= 2.1", "< 4"
s.add_runtime_dependency "websocket-driver", "~> 0.7"
s.add_runtime_dependency "cliver", "~> 0.3"

s.add_development_dependency "image_size", "~> 2.0"
s.add_development_dependency "pdf-reader", "~> 2.1"
s.add_development_dependency "rake", "~> 12.3"
s.add_development_dependency "rspec", "~> 3.7"
s.add_development_dependency "sinatra", "~> 2.0"
s.add_development_dependency "launchy", "~> 2.4"
s.add_development_dependency "byebug", "~> 10.0"
end
25 changes: 25 additions & 0 deletions lib/capybara/cuprite.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

require "capybara"

module Capybara::Cuprite
require "cuprite/driver"
require "cuprite/browser"
require "cuprite/node"
require "cuprite/errors"
require "cuprite/cookie"

class << self
def windows?
RbConfig::CONFIG["host_os"] =~ /mingw|mswin|cygwin/
end

def mri?
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
end
end
end

Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(app)
end
Loading

0 comments on commit 907c9ec

Please sign in to comment.