Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forgot to add a bunch of files generated by newgem
- Loading branch information
Showing
17 changed files
with
2,127 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
== 2.1.0 2008-01-20 | ||
|
||
* created a gem version from Rails plugin |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
CHANGELOG | ||
LICENSE | ||
Manifest.txt | ||
README | ||
Rakefile | ||
config/hoe.rb | ||
config/requirements.rb | ||
init.rb | ||
lib/will_paginate.rb | ||
lib/will_paginate/collection.rb | ||
lib/will_paginate/core_ext.rb | ||
lib/will_paginate/finder.rb | ||
lib/will_paginate/version.rb | ||
lib/will_paginate/view_helpers.rb | ||
log/debug.log | ||
script/destroy | ||
script/generate | ||
script/txt2html | ||
setup.rb | ||
tasks/deployment.rake | ||
tasks/environment.rake | ||
tasks/website.rake | ||
test/array_pagination_test.rb | ||
test/boot.rb | ||
test/console | ||
test/finder_test.rb | ||
test/fixtures/admin.rb | ||
test/fixtures/developer.rb | ||
test/fixtures/developers_projects.yml | ||
test/fixtures/project.rb | ||
test/fixtures/projects.yml | ||
test/fixtures/replies.yml | ||
test/fixtures/reply.rb | ||
test/fixtures/schema.rb | ||
test/fixtures/topic.rb | ||
test/fixtures/topics.yml | ||
test/fixtures/user.rb | ||
test/fixtures/users.yml | ||
test/helper.rb | ||
test/lib/activerecord_test_case.rb | ||
test/lib/activerecord_test_connector.rb | ||
test/lib/load_fixtures.rb | ||
test/pagination_test.rb | ||
website/index.html | ||
website/index.txt | ||
website/stylesheets/screen.css | ||
website/template.rhtml |
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
require 'will_paginate/version' | ||
|
||
AUTHOR = ['Mislav Marohnić', 'PJ Hyett'] # can also be an array of Authors | ||
EMAIL = 'mislav.marohnic@gmail.com' | ||
DESCRIPTION = "A Rails plugin that provides pagination solutions when querying models and rendering pagination links in views." | ||
GEM_NAME = 'will_paginate' # what ppl will type to install your gem | ||
RUBYFORGE_PROJECT = 'will-paginate' # The unix name for your project | ||
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org" | ||
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}" | ||
|
||
@config_file = "~/.rubyforge/user-config.yml" | ||
@config = nil | ||
RUBYFORGE_USERNAME = "unknown" | ||
def rubyforge_username | ||
unless @config | ||
begin | ||
@config = YAML.load(File.read(File.expand_path(@config_file))) | ||
rescue | ||
puts <<-EOS | ||
ERROR: No rubyforge config file found: #{@config_file} | ||
Run 'rubyforge setup' to prepare your env for access to Rubyforge | ||
- See http://newgem.rubyforge.org/rubyforge.html for more details | ||
EOS | ||
exit | ||
end | ||
end | ||
RUBYFORGE_USERNAME.replace @config["username"] | ||
end | ||
|
||
|
||
REV = nil | ||
# UNCOMMENT IF REQUIRED: | ||
# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil | ||
VERS = WillPaginate::VERSION::STRING + (REV ? ".#{REV}" : "") | ||
RDOC_OPTS = ['--quiet', '--title', 'Will Paginate documentation', | ||
"--opname", "index.html", | ||
"--line-numbers", | ||
"--main", "README", | ||
"--inline-source"] | ||
|
||
class Hoe | ||
def extra_deps | ||
@extra_deps.reject! { |x| Array(x).first == 'hoe' } | ||
@extra_deps | ||
end | ||
end | ||
|
||
# Generate all the Rake tasks | ||
# Run 'rake -T' to see list of generated tasks (from gem root directory) | ||
hoe = Hoe.new(GEM_NAME, VERS) do |p| | ||
p.author = AUTHOR | ||
p.description = DESCRIPTION | ||
p.email = EMAIL | ||
p.summary = DESCRIPTION | ||
p.url = HOMEPATH | ||
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT | ||
p.test_globs = ["test/**/test_*.rb"] | ||
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean. | ||
|
||
# == Optional | ||
p.changes = p.paragraphs_of("CHANGELOG", 0..1).join("\n\n") | ||
p.extra_deps = [ %w(activesupport >=1.4.4) ] | ||
|
||
#p.spec_extras = {} # A hash of extra values to set in the gemspec. | ||
end | ||
|
||
CHANGES = hoe.changes | ||
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}" | ||
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc') | ||
hoe.rsync_args = '-av --delete --ignore-errors' |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
require 'rubygems' | ||
%w[rake hoe newgem rubigen].each do |req_gem| | ||
begin | ||
require req_gem | ||
rescue LoadError | ||
puts "This Rakefile requires the '#{req_gem}' RubyGem." | ||
puts "Installation: gem install #{req_gem} -y" | ||
exit | ||
end | ||
end | ||
|
||
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib])) | ||
|
||
require 'will_paginate' |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module WillPaginate #:nodoc: | ||
module VERSION #:nodoc: | ||
MAJOR = 2 | ||
MINOR = 1 | ||
TINY = 0 | ||
|
||
STRING = [MAJOR, MINOR, TINY].join('.') | ||
end | ||
end |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
APP_ROOT = File.join(File.dirname(__FILE__), '..') | ||
|
||
begin | ||
require 'rubigen' | ||
rescue LoadError | ||
require 'rubygems' | ||
require 'rubigen' | ||
end | ||
require 'rubigen/scripts/destroy' | ||
|
||
ARGV.shift if ['--help', '-h'].include?(ARGV[0]) | ||
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] | ||
RubiGen::Scripts::Destroy.new.run(ARGV) |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
APP_ROOT = File.join(File.dirname(__FILE__), '..') | ||
|
||
begin | ||
require 'rubigen' | ||
rescue LoadError | ||
require 'rubygems' | ||
require 'rubigen' | ||
end | ||
require 'rubigen/scripts/generate' | ||
|
||
ARGV.shift if ['--help', '-h'].include?(ARGV[0]) | ||
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] | ||
RubiGen::Scripts::Generate.new.run(ARGV) |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
begin | ||
require 'newgem' | ||
rescue LoadError | ||
puts "\n\nGenerating the website requires the newgem RubyGem" | ||
puts "Install: gem install newgem\n\n" | ||
exit(1) | ||
end | ||
require 'redcloth' | ||
require 'syntax/convertors/html' | ||
require 'erb' | ||
require File.dirname(__FILE__) + '/../lib/will_paginate/version.rb' | ||
|
||
version = WillPaginate::VERSION::STRING | ||
download = 'http://rubyforge.org/projects/will_paginate' | ||
|
||
class Fixnum | ||
def ordinal | ||
# teens | ||
return 'th' if (10..19).include?(self % 100) | ||
# others | ||
case self % 10 | ||
when 1: return 'st' | ||
when 2: return 'nd' | ||
when 3: return 'rd' | ||
else return 'th' | ||
end | ||
end | ||
end | ||
|
||
class Time | ||
def pretty | ||
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}" | ||
end | ||
end | ||
|
||
def convert_syntax(syntax, source) | ||
return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'') | ||
end | ||
|
||
if ARGV.length >= 1 | ||
src, template = ARGV | ||
template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml') | ||
|
||
else | ||
puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html") | ||
exit! | ||
end | ||
|
||
template = ERB.new(File.open(template).read) | ||
|
||
title = nil | ||
body = nil | ||
File.open(src) do |fsrc| | ||
title_text = fsrc.readline | ||
body_text = fsrc.read | ||
syntax_items = [] | ||
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){ | ||
ident = syntax_items.length | ||
element, syntax, source = $1, $2, $3 | ||
syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>" | ||
"syntax-temp-#{ident}" | ||
} | ||
title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip | ||
body = RedCloth.new(body_text).to_html | ||
body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] } | ||
end | ||
stat = File.stat(src) | ||
created = stat.ctime | ||
modified = stat.mtime | ||
|
||
$stdout << template.result(binding) |
Oops, something went wrong.