Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
105 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,59 @@ | ||
require "rubygems" | ||
require "pathname" | ||
require "rake" | ||
require "rake/testtask" | ||
require 'rake/clean' | ||
require 'rake/testtask' | ||
require 'fileutils' | ||
|
||
# Gem | ||
require "rake/gempackagetask" | ||
|
||
NAME = "fullfeed" | ||
SUMMARY = "Fullfeed RSS creator" | ||
GEM_VERSION = "0.4.6" | ||
|
||
spec = Gem::Specification.new do |s| | ||
s.name = NAME | ||
s.summary = s.description = SUMMARY | ||
s.author = "siuying" | ||
s.email = "siu.ying@gmail.com" | ||
s.version = GEM_VERSION | ||
s.platform = Gem::Platform::RUBY | ||
s.require_path = 'lib' | ||
s.files = %w(README Rakefile) + Dir.glob("{examples,lib,test}/**/*") | ||
|
||
# s.executables = ["rackup"] | ||
s.add_dependency('ruby-cache', '>= 0.3.0') | ||
s.add_dependency('hpricot', '>= 0.6.1') | ||
task :default => :package | ||
|
||
# PACKAGING ============================================================ | ||
|
||
# Load the gemspec using the same limitations as github | ||
def spec | ||
@spec ||= | ||
begin | ||
require 'rubygems/specification' | ||
data = File.read('fullfeed.gemspec') | ||
spec = nil | ||
Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join | ||
spec | ||
end | ||
end | ||
|
||
Rake::GemPackageTask.new(spec) do |pkg| | ||
pkg.gem_spec = spec | ||
end | ||
|
||
desc "Install the FullFeed as a gem" | ||
desc "Install the Fullfeed as a gem" | ||
task :install => [:repackage] do | ||
sh %{gem install pkg/#{spec.name}-#{spec.version}} | ||
end | ||
end | ||
|
||
# Gemspec Helpers ==================================================== | ||
def source_version | ||
line = File.read('lib/fullfeed.rb')[/^\s*VERSION = .*/] | ||
line.match(/.*VERSION = '(.*)'/)[1] | ||
end | ||
|
||
task 'fullfeed.gemspec' => FileList['lib/**','bin/**','examples/**','Rakefile','LICENSE','README'] do |f| | ||
# read spec file and split out manifest section | ||
spec = File.read(f.name) | ||
head, manifest, tail = spec.split(" # = MANIFEST =\n") | ||
# replace version and date | ||
head.sub!(/\.version = '.*'/, ".version = '#{source_version}'") | ||
head.sub!(/\.date = '.*'/, ".date = '#{Date.today.to_s}'") | ||
# determine file list from git ls-files | ||
files = `git ls-files`. | ||
split("\n"). | ||
sort. | ||
reject{ |file| file =~ /^\./ }. | ||
reject{ |file| file =~ /^.+\/\./ }. | ||
reject { |file| file =~ /^doc/ }. | ||
map{ |file| " #{file}" }. | ||
join("\n") | ||
# piece file back together and write... | ||
manifest = " s.files = %w[\n#{files}\n ]\n" | ||
spec = [head,manifest,tail].join(" # = MANIFEST =\n") | ||
File.open(f.name, 'w') { |io| io.write(spec) } | ||
puts "updated #{f.name}" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,58 @@ | ||
NAME = "fullfeed" | ||
SUMMARY = "Fullfeed RSS creator" | ||
GEM_VERSION = "0.4.6" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = NAME | ||
s.summary = s.description = SUMMARY | ||
s.specification_version = 2 if s.respond_to? :specification_version= | ||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
|
||
s.name = "fullfeed" | ||
s.summary = s.description = "Create full text RSS feed from RSS" | ||
|
||
s.author = "siuying" | ||
s.email = "siu.ying@gmail.com" | ||
s.version = GEM_VERSION | ||
|
||
s.version = '0.4.7' | ||
s.date = '2009-06-09' | ||
s.platform = Gem::Platform::RUBY | ||
s.require_path = 'lib' | ||
s.files = %w(README Rakefile) + Dir.glob("{examples,lib,test}/**/*") | ||
|
||
# s.executables = ["rackup"] | ||
s.add_dependency('ruby-cache', '>= 0.3.0') | ||
s.add_dependency('hpricot', '>= 0.6.1') | ||
end | ||
|
||
# = MANIFEST = | ||
s.files = %w[ | ||
LICENSE | ||
README | ||
Rakefile | ||
examples/applenews_hk.rb | ||
examples/extractors/apple_news_extractor.rb | ||
examples/extractors/yahoo_news_hong_kong_extractor.rb | ||
examples/server/controller/feed_controller.rb | ||
examples/server/server.rb | ||
examples/server/views/index.erb | ||
examples/sinatra/web.rb | ||
examples/ynews_hk.rb | ||
examples/ynews_hk_db.rb | ||
fullfeed.gemspec | ||
lib/fullfeed.rb | ||
lib/fullfeed/agent/agent_factory.rb | ||
lib/fullfeed/agent/appengine_agent.rb | ||
lib/fullfeed/agent/base.rb | ||
lib/fullfeed/agent/mechanize_agent.rb | ||
lib/fullfeed/agent/open_uri_agent.rb | ||
lib/fullfeed/extractor/base_extractor.rb | ||
lib/fullfeed/extractor/extractor_factory.rb | ||
lib/fullfeed/extractor/text_extractor.rb | ||
lib/fullfeed/extractor/xpath_extractor.rb | ||
lib/fullfeed/feed.rb | ||
lib/fullfeed/filters/base_filter.rb | ||
lib/fullfeed/filters/convert_encoding_filter.rb | ||
lib/fullfeed/filters/excess_space_filter.rb | ||
lib/fullfeed/filters/uppercase_filter.rb | ||
lib/fullfeed/store/base.rb | ||
lib/fullfeed/store/db_store.rb | ||
lib/fullfeed/store/memory_store.rb | ||
lib/fullfeed/store/store_factory.rb | ||
test/load_files.rb | ||
test/test_agent.rb | ||
test/test_store.rb | ||
] | ||
# = MANIFEST = | ||
|
||
s.rubygems_version = '1.1.1' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters