Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

-jeweler +bundler

  • Loading branch information...
commit 9aa51791e9b1307398cbbab9aab753165b7649dc 1 parent 5f61d6d
@ambethia authored
View
5 .document
@@ -1,5 +0,0 @@
-README.rdoc
-lib/**/*.rb
-bin/*
-features/**/*.feature
-LICENSE
View
9 .gitignore
@@ -1,5 +1,4 @@
-*.sw?
-.DS_Store
-coverage
-rdoc
-pkg
+.bundle
+Gemfile.lock
+pkg/*
+rdoc/*
View
2  Gemfile
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
View
51 Rakefile
@@ -1,57 +1,10 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "rack-google_analytics"
- gem.summary = %Q{Google Analytics for Rack applications}
- gem.description = %Q{Embeds GA tracking code in the bottom of HTML documents}
- gem.email = "jasper@ambethia.com"
- gem.homepage = "http://github.com/ambethia/rack-google_analytics"
- gem.authors = ["Jason L Perry"]
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+require 'bundler/gem_tasks'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
+ test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
- test.rcov_opts << "--exclude 'var/*,gems/*'"
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install relevance-rcov"
- end
-end
-
-task :test => :check_dependencies
-
task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION')
- version = File.read('VERSION')
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "rack-google_analytics #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc .options << "--all"
-end
View
1  VERSION
@@ -1 +0,0 @@
-1.0.1
View
1  lib/rack-google_analytics.rb
@@ -0,0 +1 @@
+require 'rack/google_analytics'
View
60 rack-google_analytics.gemspec
@@ -1,50 +1,24 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE
-# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
-# -*- encoding: utf-8 -*-
+Gem::Specification.new do |spec|
+ spec.name = 'rack-google_analytics'
+ spec.version = '1.0.1'
+ spec.authors = ['Jason L Perry']
+ spec.date = '2009-11-04'
+ spec.summary = 'Google Analytics for Rack applications'
+ spec.description = 'Embeds Google Analytics tracking code in the bottom of HTML documents'
+ spec.email = 'jasper@ambethia.com'
+ spec.homepage = 'http://github.com/ambethia/rack-google_analytics'
-Gem::Specification.new do |s|
- s.name = %q{rack-google_analytics}
- s.version = "1.0.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Jason L Perry"]
- s.date = %q{2009-11-04}
- s.description = %q{Embeds GA tracking code in the bottom of HTML documents}
- s.email = %q{jasper@ambethia.com}
- s.extra_rdoc_files = [
- "LICENSE",
+ spec.extra_rdoc_files = [
+ "LICENSE",
"README.rdoc"
]
- s.files = [
- ".document",
- ".gitignore",
- "LICENSE",
+ spec.files = [
"README.rdoc",
- "Rakefile",
- "VERSION",
- "lib/rack/google_analytics.rb",
- "rack-google_analytics.gemspec",
- "test/rack/google_analytics_test.rb",
- "test/test_helper.rb"
+ "lib/rack-google_analytics.rb",
+ "lib/rack/google_analytics.rb"
]
- s.homepage = %q{http://github.com/ambethia/rack-google_analytics}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Google Analytics for Rack applications}
- s.test_files = [
- "test/rack/google_analytics_test.rb",
- "test/test_helper.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ spec.require_paths = %w[lib]
+ spec.test_files = %w[test/rack/google_analytics_test.rb]
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
+ spec.add_dependency 'rack'
end
View
9 test/rack/google_analytics_test.rb
@@ -1,6 +1,8 @@
-require 'test_helper'
+require 'test/unit'
require 'rack/mock'
+require 'rack/google_analytics'
+
class Rack::GoogleAnalyticsTest < Test::Unit::TestCase
def test_embed_tracking_code_at_the_end_of_html_body
@@ -24,11 +26,11 @@ def test_should_buff_content_length_by_the_size_of_tracker_code
assert_equal HTML_DOC.length + app.send(:tracking_code, WEB_PROPERTY_ID).length, req.content_length
end
end
-
+
def test_should_include_pageTracker_definition
assert_match( /#{Regexp.escape('var pageTracker = _gat.')}/, request.body)
end
-
+
def test_should_append_prefix_to_pageTracker_definition
assert_match( /#{Regexp.escape('var conductor_pageTracker = _gat.')}/, request(:prefix => 'conductor_').body)
end
@@ -48,7 +50,6 @@ def test_multiple_top_level_domains_should_supercede_domain_name
def test_should_allow_domain_name
assert_match( /#{Regexp.escape('pageTracker._setDomainName(".test.com")')}/, request(:domain_name => '.test.com').body)
end
-
private
WEB_PROPERTY_ID = "UA-0000000-1"
View
7 test/test_helper.rb
@@ -1,7 +0,0 @@
-require 'rubygems'
-require 'test/unit'
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'rack/google_analytics'
-
Please sign in to comment.
Something went wrong with that request. Please try again.