Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small things, more administrative than anything.

Hoe.
  • Loading branch information...
commit d1c484983ea4a9c75b691e234078026d0126c411 1 parent 7ff0d3c
@nowk authored
View
6 Gemfile
@@ -1,4 +1,8 @@
only :test do
- gem 'sinatra', '0.9.4'
+ gem 'sinatra', '>= 0.9.4'
+ # these should be installed on your testing location
+ #gem 'rack-test', '>= 0.5.2'
+ #gem 'rspec', '>= 1.2.8'
+ #gem 'webrat', '>= 0.7.0'
end
View
36 README.md → README.rdoc
@@ -1,13 +1,10 @@
-Sinatra::Pagin*
-=
+= Sinatra::Pagin*
-**Small utility to process paginated urls without modifying the mapped paths in your Sinatra app**
+Small utility to process paginated urls without modifying the mapped paths in your Sinatra app
-***
+== Usage, _if you actually want to use this..._
-### Usage, *if you actually want to use this...*
-
-To install, just grab the git, then require in your [Sinatra][0] app
+To install, just grab the git, then require in your Sinatra (http://www.sinatrarb.com/) app
require 'lib/sinatra/pagin' # or wherever you install this ultimately
@@ -35,7 +32,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
@@ -45,7 +42,7 @@ Use the helper method *`page`* to get the provide page number.
# => 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.
@@ -57,27 +54,21 @@ It also supports `.:format` in your path.
# => path_info == /a/pathed/path.js
# => page == 45
-***
-
-### TODO
+=== TODO
- Maybe gemspec
- Fix whatever breaks along the way.
- Whatever else...
-***
-
-### Resources
+=== Resources
-- [Checked with Integrity][1]
+- Checked with Integrity (http://ci.damncarousel.com/sintra-pagin)
-***
-
-### License
+== License
The MIT License
-Copyright (c) 2010 Yung Hwa Kwon
+Copyright (c) 2010 Yung Hwa Kwon (yung.kwon@nowk.net)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -95,7 +86,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE
-
-[0]: http://www.sinatrarb.com/
-[1]: http://ci.damncarousel.com/sintra-pagin
+THE SOFTWARE
View
28 Rakefile
@@ -1,4 +1,28 @@
require 'rubygems'
+require 'hoe'
+
+Hoe.plugin :gemcutter
+Hoe.plugin :clean
+Hoe.plugin :git
+
+Hoe.spec 'sinatra-pagin' do
+ developer('Yung H Kwon', 'yung.kwon@example.com')
+
+ 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'
+end
+
+#
begin
require 'spec'
@@ -6,7 +30,7 @@ begin
task :default => :spec
- task :spec do
+ namespace :spec do
Spec::Rake::SpecTask.new do |t|
#t.ruby_opts = ['-rtest/unit']
t.spec_files = FileList['spec/*_spec.rb']
@@ -25,7 +49,7 @@ begin
end
rescue LoadError
- puts "RSpec required. To install Rspec, please run sudo gem install rspec."
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
View
4 spec/pagin_spec.rb
@@ -1,6 +1,4 @@
-require File.join(File.dirname(__FILE__), 'spec_helper')
-require 'sinatra'
-require File.join(File.dirname(__FILE__), '..', 'lib', 'sinatra/pagin')
+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
class MyTestApp < Sinatra::Base
set :environment, :test
View
1  spec/spec.opts
@@ -0,0 +1 @@
+--color
View
7 spec/spec_helper.rb
@@ -1,6 +1,11 @@
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
-require 'spec'
+require 'sinatra'
+require 'sinatra/pagin'
require 'rack/test'
+require 'spec'
+require 'spec/autorun'
require "webrat"
#require 'mocha'
Please sign in to comment.
Something went wrong with that request. Please try again.