Permalink
Browse files

Switched over to Jeweler gem for gem packaging.

  • Loading branch information...
1 parent b30e020 commit ddc6394902b4484e756f68af900c17d9f94df991 @nowk committed Feb 15, 2010
Showing with 49 additions and 64 deletions.
  1. +2 −1 .gitignore
  2. +3 −0 Changelog.md
  3. +0 −9 History.txt
  4. +0 −9 Manifest.txt
  5. +16 −15 README.rdoc → README.md
  6. +28 −30 Rakefile
View
@@ -1,4 +1,5 @@
doc
pkg
rcov
-vendor
+vendor
+bin
View
@@ -0,0 +1,3 @@
+### sinatra-pagin - 0.0.1 / 2010-02-14
+
+* Initial Release
View
@@ -1,9 +0,0 @@
-=== 0.0.1 / 2010-02-14
-
-* Adding it back in. [Yung Hwa Kwon]
-* Removed Sinatra::Application on register call. [Yung Hwa Kwon]
-* Found the flaw in my test, which kept failing the multiple iterations of /page/#. Oopsy. [Yung Hwa Kwon]
-* A small change to the wording in the test. [Yung Hwa Kwon]
-* Fixed a bug in the helper#page method [Yung Hwa Kwon]
-* Updated the Readme a it. Added MIT License [Yung Hwa Kwon]
-* Initial Build + tests. [Yung Hwa Kwon]
View
@@ -1,9 +0,0 @@
-Gemfile
-History.txt
-Manifest.txt
-README.rdoc
-Rakefile
-lib/sinatra/pagin.rb
-spec/pagin_spec.rb
-spec/spec.opts
-spec/spec_helper.rb
@@ -1,17 +1,16 @@
-= sinatra-pagin
-
-* http://github.com/nowk/sinatra-pagin
-
-== DESCRIPTION:
+Sinatra::Pagin*
+=
Small utility to process paginated urls without modifying the mapped paths in your Sinatra app
-== FEATURES/PROBLEMS:
+---
+
+### FEATURES/PROBLEMS:
* Parses ../page/# off your urls to allow simple route mappings
* Saves page # for internal use
-== SYNOPSIS:
+### SYNOPSIS:
Given you have mapped paths as such:
@@ -26,7 +25,7 @@ Given you have mapped paths as such:
end
# => "http://example.org/a/pathed/path"
-
+
Without changing those paths, you can run a paginated url.
http://example.org/page/2
@@ -35,7 +34,7 @@ Without changing those paths, you can run a paginated url.
http://example.org/a/pathed/path/page/45
# => get "/a/pathed/path"
-Use the helper method +page+ to get the provide page number.
+Use the helper method `page` to get the provide page number.
http://example.org/page/2
@@ -44,9 +43,8 @@ Use the helper method +page+ to get the provide page number.
end
# => hello world, you asked for page 2
-
-+page+ returns 1 as a default.
+`page` returns 1 as a default.
It also supports `.:format` in your path.
@@ -58,19 +56,22 @@ It also supports `.:format` in your path.
# => path_info == /a/pathed/path.js
# => page == 45
-== REQUIREMENTS:
+### REQUIREMENTS:
-* Sinatra
+* [Sinatra](http://www.sinatrarb.com/)
-== INSTALL:
+### INSTALL:
Install the gem:
+
sudo gem install sinatra-pagin
Require in your app:
+
require 'sinatra/pagin'
-== LICENSE:
+---
+### LICENSE:
(The MIT License)
View
@@ -1,53 +1,52 @@
require 'rubygems'
+# GEM
begin
- require 'hoe'
-
- Hoe.plugins.delete :rubyforge
- Hoe.plugin :gemcutter
- Hoe.plugin :clean
- Hoe.plugin :git
-
- Hoe.spec 'sinatra-pagin' do
- developer('Yung H Kwon', 'yung.kwon@example.com')
+ require 'jeweler'
- extra_deps << ['sinatra', '>= 0.9.4']
- extra_dev_deps = [
- ['rack-test', '>= 0.5.2'],
- ['rspec', '>= 1.2.8'],
- ['webrat', '>= 0.7.0']
- ]
-
- # self.rubyforge_name = 'nowk-sinatra-pagin' # if different than 'sinatra-pagin'
- self.readme_file = 'README.rdoc'
- self.history_file = 'History.txt'
- self.test_globs = 'spec/*_spec.rb'
- self.version = '0.0.1'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "sinatra-pagin"
+ gem.summary = %Q{Small utility to process paginated urls without modifying the mapped paths in your Sinatra app}
+ gem.description = %Q{Small utility to process paginated urls without modifying the mapped paths in your Sinatra app}
+ gem.email = "yung.kwon@nowk.net"
+ gem.homepage = "http://github.com/nowk/sinatra-pagin"
+ gem.authors = ["Yung Hwa Kwon"]
+ gem.add_dependency "sinatra", ">= 0.9.4"
+
+ { 'rack-test' => '>= 0.5.2',
+ 'rspec' => '>= 1.2.8',
+ 'webrat' => '>= 0.7.0'
+ }.each_pair do |g, v|
+ gem.add_development_dependency g, v
+ end
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
+
+ Jeweler::GemcutterTasks.new
rescue LoadError
- puts "Hoe is required. To install please run `sudo gem install hoe`"
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-#
-
+# Test Rakes
begin
require 'spec'
require 'spec/rake/spectask'
task :default => :spec
- namespace :spec do
- Spec::Rake::SpecTask.new do |t|
- #t.ruby_opts = ['-rtest/unit']
- t.spec_files = FileList['spec/*_spec.rb']
- end
+ desc "Run Rspec tests"
+ Spec::Rake::SpecTask.new(:spec) do |t|
+ #t.spec_opts = ['spec/spec.opts']
+ t.spec_files = FileList['spec/*_spec.rb']
end
+ desc "Run CI tests"
task :ci => 'setup:gem_bundle' do
Rake::Task[:spec].invoke
end
namespace :setup do
+ desc "Setup required gems/goodies for CI test. Server has only the essential minimums."
task :gem_bundle do
sh "gem bundle --only test"
require "vendor/gems/environment"
@@ -58,4 +57,3 @@ rescue LoadError
puts "I <3 Rspec, or any good testing unit for that matter."
puts "RSpec required. To install Rspec, please run sudo gem install rspec."
end
-

0 comments on commit ddc6394

Please sign in to comment.