Permalink
Browse files

gemified

  • Loading branch information...
1 parent 87106eb commit 2adac8c856fe5bc27d344673660b7ce9d368c9b7 Kyle Maxwell committed with cantino Aug 30, 2010
Showing with 76 additions and 7 deletions.
  1. +5 −0 .document
  2. +22 −0 .gitignore
  3. +1 −1 README
  4. +35 −0 Rakefile
  5. +13 −0 bin/readability
  6. +0 −6 test_on_url.rb
View
5 .document
@@ -0,0 +1,5 @@
+README.rdoc
+lib/**/*.rb
+bin/*
+features/**/*.feature
+LICENSE
View
22 .gitignore
@@ -1 +1,23 @@
pkg/*
+=======
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
View
2 README
@@ -6,4 +6,4 @@ http://lab.arc90.com/experiments/readability/
Given a html document, it pulls out the main body text and cleans it up.
-Ruby port by starrhorne and iterationlabs
+Ruby port by starrhorne and iterationlabs. Gemification by fizx.
View
35 Rakefile
@@ -1,10 +1,45 @@
require 'rubygems'
require 'rake'
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "ruby-readability"
+ gem.summary = %Q{TODO: one-line summary of your gem}
+ gem.description = %Q{TODO: longer description of your gem}
+ gem.email = "kmaxwell@twitter.com"
+ gem.homepage = "http://github.com/fizx/ruby-readability"
+ gem.authors = ["Kyle Maxwell"]
+ gem.add_development_dependency "rspec", ">= 1.2.9"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+task :spec => :check_dependencies
+
task :default => :spec
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "ruby-readability #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
View
13 bin/readability
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+$KCODE='u'
+require 'rubygems'
+require 'open-uri'
+require File.dirname(__FILE__) + '/../lib/readability'
+
+if ARGV.length != 1
+ STDERR.puts "Usage: #{File.basename($0)} URL"
+ exit 1
+end
+
+text = open(ARGV.first).read
+puts Readability::Document.new(text).content
View
6 test_on_url.rb
@@ -1,6 +0,0 @@
-require 'rubygems'
-require 'open-uri'
-require 'lib/readability'
-
-text = open(ARGV.first).read
-p Readability::Document.new(text).content

0 comments on commit 2adac8c

Please sign in to comment.