Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE #87

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ gem 'unicorn'
group :test, :development do
gem 'rack-test'
gem 'test-unit'
gem "webmock"
end
7 changes: 6 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ GEM
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
ruby
Expand All @@ -43,9 +47,10 @@ DEPENDENCIES
sinatra
test-unit
unicorn
webmock

RUBY VERSION
ruby 3.2.0p0

BUNDLED WITH
2.4.1
2.4.1
5 changes: 5 additions & 0 deletions claw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ class Claw < Sinatra::Base
redirect format(link, version: version, release: filename), 302
end

def page_view(distro, page)
# Run this async
@google_analytics.page_view(distro, page)
end

def get_version_from_filename(filename)
match = /.*_(?<version>[\d.]+(-beta\.[\d]+)?)_.*/.match(filename)
match[:version]
Expand Down
10 changes: 10 additions & 0 deletions claw_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require_relative 'claw'
require 'test/unit'
require 'rack/test'
require 'webmock/test_unit'

VERSIONED_V8_RELEASE_LINK = 'https://s3-us-west-1.amazonaws.com/v8-cf-cli-releases/releases/v%{version}/%{release}'
VERSIONED_V7_RELEASE_LINK = 'https://s3-us-west-1.amazonaws.com/v7-cf-cli-releases/releases/v%{version}/%{release}'
Expand Down Expand Up @@ -59,6 +60,15 @@
class ClawTest < Test::Unit::TestCase
include Rack::Test::Methods

# TODO: test if timeout does not block our request
# TODO: that we are calling our tracking function from all expected locations
# TODO:

def setup
stub_request(:get, /www.google-analytics.com/).
to_return(status: 200, body: "", headers: {})
end

def app
Claw
end
Expand Down
Loading