refraction 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -65,7 +65,9 @@ class Refraction
65
65
  if options.is_a?(String)
66
66
  @uri = URI.parse(options)
67
67
  else
68
- @uri.port = nil
68
+ if [:scheme, :protocol, :host, :port].any? {|k| options[k]}
69
+ @uri.port = nil
70
+ end
69
71
  options.each do |k,v|
70
72
  k = 'scheme' if k == :protocol
71
73
  @uri.send("#{k}=", v)
@@ -0,0 +1,53 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{refraction}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Pivotal Labs", "Josh Susser", "Sam Pierson", "Wai Lun Mang"]
12
+ s.date = %q{2009-10-29}
13
+ s.description = %q{Reflection is a Rails plugin and standalone Rack middleware library. Give up quirky config syntax and use plain old Ruby for your rewrite and redirection rules.}
14
+ s.email = %q{gems@pivotallabs.com}
15
+ s.extra_rdoc_files = [
16
+ "README.md"
17
+ ]
18
+ s.files = [
19
+ "MIT-LICENSE",
20
+ "README.md",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "geminstaller.yml",
24
+ "install.rb",
25
+ "lib/refraction.rb",
26
+ "refraction.gemspec",
27
+ "spec/refraction_spec.rb",
28
+ "spec/spec_helper.rb"
29
+ ]
30
+ s.homepage = %q{http://github.com/pivotal/refraction}
31
+ s.rdoc_options = ["--charset=UTF-8"]
32
+ s.require_paths = ["lib"]
33
+ s.rubygems_version = %q{1.3.5}
34
+ s.summary = %q{Rack middleware replacement for mod_rewrite}
35
+ s.test_files = [
36
+ "spec/refraction_spec.rb",
37
+ "spec/spec_helper.rb"
38
+ ]
39
+
40
+ if s.respond_to? :specification_version then
41
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
+ s.specification_version = 3
43
+
44
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
45
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
46
+ else
47
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
48
+ end
49
+ else
50
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
51
+ end
52
+ end
53
+
@@ -93,6 +93,22 @@ describe Refraction do
93
93
  end
94
94
  end
95
95
 
96
+ describe "using hash arguments but not changing scheme, host, or port" do
97
+ before do
98
+ Refraction.configure do |req|
99
+ req.permanent! :path => "/bar", :query => "baz"
100
+ end
101
+ end
102
+
103
+ it "should not clear the port" do
104
+ env = Rack::MockRequest.env_for('http://bar.com:3000/', :method => 'get')
105
+ app = mock('app')
106
+ response = Refraction.new(app).call(env)
107
+ response[0].should == 301
108
+ response[1]['Location'].should == "http://bar.com:3000/bar?baz"
109
+ end
110
+ end
111
+
96
112
  describe "temporary redirect for found" do
97
113
  before(:each) do
98
114
  Refraction.configure do |req|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refraction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-10-29 00:00:00 -07:00
15
+ date: 2009-11-13 00:00:00 -08:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ files:
41
41
  - geminstaller.yml
42
42
  - install.rb
43
43
  - lib/refraction.rb
44
+ - refraction.gemspec
44
45
  - spec/refraction_spec.rb
45
46
  - spec/spec_helper.rb
46
47
  has_rdoc: true