p8-redirect 0.3.2 → 0.3.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -6,5 +6,6 @@ bin/redirect_app
6
6
  example.rb
7
7
  example.ru
8
8
  lib/redirect.rb
9
+ lib/redirect/test.rb
9
10
  spec/helper.rb
10
11
  spec/rack_spec.rb
data/bin/redirect_app CHANGED
@@ -29,24 +29,7 @@ FileUtils.mkdir_p("#{project}/test") unless File.directory?("#{project}/test")
29
29
  # create sample test
30
30
  open("#{project}/test/#{project}_test.rb", "w") do |f|
31
31
  f.puts %(require 'rubygems'
32
- require 'test/unit'
33
- require 'redirect'
34
-
35
- class Test::Unit::TestCase
36
-
37
- def assert_redirects(from, to)
38
- res = Rack::MockRequest.new(APP[:redirect_app]).get(from)
39
- res.headers.should == { 'Location' => to, 'Content-Type' => 'text/html' }
40
- res.body.should == "Redirecting to: \#{to}"
41
- end
42
-
43
- end
44
-
45
- APP = {}
46
-
47
- def redirect(*redirects)
48
- APP[:redirect_app] = Rack::Redirect.new(*redirects)
49
- end
32
+ require 'redirect/test'
50
33
 
51
34
  require File.dirname(__FILE__) + '/../#{project}.rb'
52
35
 
data/lib/redirect.rb CHANGED
@@ -5,7 +5,7 @@ require 'rack/request'
5
5
  require 'rack/response'
6
6
 
7
7
  module Redirect
8
- VERSION = '0.3.2'
8
+ VERSION = '0.3.2.1'
9
9
 
10
10
  def self.default_code= default_code
11
11
  @default_code = default_code
@@ -0,0 +1,18 @@
1
+ require 'redirect'
2
+ require 'test/unit'
3
+
4
+ class Test::Unit::TestCase
5
+
6
+ def assert_redirects(from, to)
7
+ res = Rack::MockRequest.new(APP[:redirect_app]).get(from)
8
+ res.headers.should == { 'Location' => to, 'Content-Type' => 'text/html' }
9
+ res.body.should == "Redirecting to: \#{to}"
10
+ end
11
+
12
+ end
13
+
14
+ APP = {}
15
+
16
+ def redirect(*redirects)
17
+ APP[:redirect_app] = Rack::Redirect.new(*redirects)
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p8-redirect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petrik de Heus
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-24 00:00:00 -08:00
12
+ date: 2009-03-03 00:00:00 -08:00
13
13
  default_executable: redirect_app
14
14
  dependencies: []
15
15
 
16
- description: Redirect is a simple Ruby redirect DSL build on Rack
16
+ description: Redirect is a simple Ruby redirect DSL build on Rack. It's like a simple Ruby mod_rewrite, so you can write and test your redirects in Ruby.
17
17
  email:
18
18
  - FIX@example.com
19
19
  executables:
@@ -33,6 +33,7 @@ files:
33
33
  - example.rb
34
34
  - example.ru
35
35
  - lib/redirect.rb
36
+ - lib/redirect/test.rb
36
37
  - spec/helper.rb
37
38
  - spec/rack_spec.rb
38
39
  has_rdoc: true