Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bundler, manual gemspec, require mechanize >= 1.0.0

  • Loading branch information...
commit 12b9093ea9350d6f427e68448036e7da20b56e62 1 parent 675fbfe
@aanand authored
View
3  Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+gemspec
+
View
20 Gemfile.lock
@@ -0,0 +1,20 @@
+PATH
+ remote: .
+ specs:
+ deadweight (0.2.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ mechanize (1.0.0)
+ nokogiri (>= 1.2.1)
+ nokogiri (1.4.4)
+ shoulda (2.11.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ deadweight!
+ mechanize
+ shoulda
View
22 Rakefile
@@ -1,21 +1,7 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "deadweight"
- gem.summary = "A coverage tool for finding unused CSS"
- gem.email = "aanand.prasad@gmail.com"
- gem.homepage = "http://github.com/aanand/deadweight"
- gem.authors = ["Aanand Prasad"]
-
- gem.add_dependency('hpricot')
- end
-
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+task :gem do
+ system "gem build deadweight.gemspec"
+ system "mkdir -p pkg"
+ system "mv deadweight-*.gem pkg"
end
require 'rake/testtask'
View
89 deadweight.gemspec
@@ -1,84 +1,19 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{deadweight}
- s.version = "0.1.3"
+ s.name = "deadweight"
+ s.version = "0.2.0"
+ s.authors = ["Aanand Prasad"]
+ s.email = "aanand.prasad@gmail.com"
+ s.homepage = "http://github.com/aanand/deadweight"
+ s.summary = "A coverage tool for finding unused CSS"
+ s.license = 'MIT'
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Aanand Prasad"]
- s.date = %q{2010-01-18}
- s.default_executable = %q{deadweight}
- s.email = %q{aanand.prasad@gmail.com}
- s.executables = ["deadweight"]
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "bin/deadweight",
- "deadweight.gemspec",
- "lib/deadweight.rb",
- "lib/deadweight/cli.rb",
- "lib/deadweight/rake_task.rb",
- "test/cli_test.rb",
- "test/deadweight_test.rb",
- "test/fixtures/index.html",
- "test/fixtures/index2.html",
- "test/fixtures/style.css",
- "test/rake_task_test.rb",
- "test/test_helper.rb",
- "vendor/gems/css_parser-1.0.0/lib/css_parser.rb",
- "vendor/gems/css_parser-1.0.0/lib/css_parser/parser.rb",
- "vendor/gems/css_parser-1.0.0/lib/css_parser/regexps.rb",
- "vendor/gems/css_parser-1.0.0/lib/css_parser/rule_set.rb",
- "vendor/gems/css_parser-1.0.0/test/fixtures/import-circular-reference.css",
- "vendor/gems/css_parser-1.0.0/test/fixtures/import-with-media-types.css",
- "vendor/gems/css_parser-1.0.0/test/fixtures/import1.css",
- "vendor/gems/css_parser-1.0.0/test/fixtures/simple.css",
- "vendor/gems/css_parser-1.0.0/test/fixtures/subdir/import2.css",
- "vendor/gems/css_parser-1.0.0/test/test_css_parser_basic.rb",
- "vendor/gems/css_parser-1.0.0/test/test_css_parser_downloading.rb",
- "vendor/gems/css_parser-1.0.0/test/test_css_parser_media_types.rb",
- "vendor/gems/css_parser-1.0.0/test/test_css_parser_misc.rb",
- "vendor/gems/css_parser-1.0.0/test/test_css_parser_regexps.rb",
- "vendor/gems/css_parser-1.0.0/test/test_helper.rb",
- "vendor/gems/css_parser-1.0.0/test/test_merging.rb",
- "vendor/gems/css_parser-1.0.0/test/test_rule_set.rb",
- "vendor/gems/css_parser-1.0.0/test/test_rule_set_creating_shorthand.rb",
- "vendor/gems/css_parser-1.0.0/test/test_rule_set_expanding_shorthand.rb"
- ]
- s.homepage = %q{http://github.com/aanand/deadweight}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{A coverage tool for finding unused CSS}
- s.test_files = [
- "test/cli_test.rb",
- "test/deadweight_test.rb",
- "test/rake_task_test.rb",
- "test/test_helper.rb"
- ]
+ s.add_development_dependency "shoulda"
+ s.add_development_dependency "mechanize"
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<hpricot>, [">= 0"])
- else
- s.add_dependency(%q<hpricot>, [">= 0"])
- end
- else
- s.add_dependency(%q<hpricot>, [">= 0"])
- end
+ s.files = `git ls-files LICENSE README.md bin lib vendor`.split
+ s.require_path = 'lib'
+ s.executables = Dir.glob("bin/*").map(&File.method(:basename))
end
View
14 lib/deadweight.rb
@@ -139,7 +139,7 @@ def fetch(path)
begin
page = agent.get(loc)
- rescue WWW::Mechanize::ResponseCodeError => e
+ rescue Mechanize::ResponseCodeError => e
raise FetchError.new("#{loc} returned a response code of #{e.response_code}")
end
@@ -178,7 +178,17 @@ def log
def initialize_agent
begin
require 'mechanize'
- return WWW::Mechanize.new
+
+ unless defined?(Mechanize::VERSION) and Mechanize::VERSION >= "1.0.0"
+ log.puts %{
+ =================================================================
+ A mechanize version of 1.0.0 or above is required.
+ Install it like so: gem install mechanize
+ =================================================================
+ }
+ end
+
+ return Mechanize.new
rescue LoadError
log.puts %{
=================================================================
Please sign in to comment.
Something went wrong with that request. Please try again.