p8-redirect 0.3.2 → 0.3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Manifest.txt +1 -0
- data/bin/redirect_app +1 -18
- data/lib/redirect.rb +1 -1
- data/lib/redirect/test.rb +18 -0
- metadata +4 -3
data/Manifest.txt
CHANGED
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
|
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
@@ -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-
|
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
|