mataki-subdomain_routes 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  begin
6
6
  require 'jeweler'
7
7
  Jeweler::Tasks.new do |gem|
8
- gem.name = "subdomain_routes"
8
+ gem.name = "mataki-subdomain_routes"
9
9
  gem.summary = %Q{A Rails library for incorporating subdomains into route generation and recognition.}
10
10
  gem.description = <<-EOF
11
11
  SubdomainRoutes add subdomain conditions to the Rails routing system. Routes may be restricted to
@@ -14,14 +14,15 @@ begin
14
14
  generated URL (or path) will be changed if the requested route has a different subdomain to that of
15
15
  the current request. Model-based subdomain routes can also be defined.
16
16
  EOF
17
- gem.email = "mdholling@gmail.com"
18
- gem.homepage = "http://github.com/mholling/subdomain_routes"
19
- gem.authors = ["Matthew Hollingworth"]
17
+ gem.email = "matsumura.aki@gmail.com"
18
+ gem.homepage = "http://github.com/mataki/subdomain_routes"
19
+ gem.authors = ["Matthew Hollingworth", "Akihiro Matsumura"]
20
20
  gem.add_dependency 'actionpack', ">= 2.2.1"
21
21
  gem.has_rdoc = false
22
22
 
23
23
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
24
24
  end
25
+ Jeweler::GemcutterTasks.new
25
26
  rescue LoadError
26
27
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
27
28
  end
data/VERSION.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
- :patch: 1
3
- :major: 0
4
2
  :minor: 3
3
+ :patch: 2
4
+ :build:
5
+ :major: 0
data/history.txt ADDED
@@ -0,0 +1,21 @@
1
+ SubdomainRoutes Revision History
2
+
3
+ Version 0.3.2
4
+ * Remove Deprecation warning for Rails 2.3.9
5
+
6
+ Version 0.3.1
7
+ * Fixed bug whereby port number was not preserved when a subdomain route changed
8
+ the subdomain in the host (Matsumara Akihiro, Matthew Hollingworth).
9
+ * Similarly, added fixes to preserve https protocol when host is changed.
10
+
11
+ Version 0.3.0
12
+
13
+ * Added this revision history.
14
+ * Added #assert_recognizes_with_host and #assert_generates_with_host methods to
15
+ ActionController::Assertions::RoutingAssertions, allowing testing of subdomain routes
16
+ if you're into that sort of thing.
17
+ * Modified ActionController::Routing::Route#significant_keys to include the subdomain
18
+ option in the case of model-based subdomain routes.
19
+ * Added ability to override default namespace and name prefix for model-based subdomain
20
+ routes by passing :name option to the map.subdomain call.
21
+ * Updated README to describe how to test with subdomain routes.
@@ -2,15 +2,15 @@ module SubdomainRoutes
2
2
  module Routing
3
3
  module RouteSet
4
4
  include SplitHost
5
-
5
+
6
6
  def self.included(base)
7
7
  [ :extract_request_environment, :add_route, :raise_named_route_error ].each { |method| base.alias_method_chain method, :subdomains }
8
8
  end
9
-
9
+
10
10
  def extract_request_environment_with_subdomains(request)
11
11
  extract_request_environment_without_subdomains(request).merge(:subdomain => subdomain_for_host(request.host))
12
12
  end
13
-
13
+
14
14
  def add_route_with_subdomains(*args)
15
15
  options = args.extract_options!
16
16
  if subdomains = options.delete(:subdomains)
@@ -35,19 +35,19 @@ module SubdomainRoutes
35
35
  end
36
36
  end
37
37
  end
38
-
38
+
39
39
  def reserved_subdomains
40
40
  routes.map(&:reserved_subdomains).flatten.uniq
41
41
  end
42
42
  end
43
-
43
+
44
44
  module Route
45
45
  def self.included(base)
46
46
  [ :recognition_conditions, :generation_extraction, :segment_keys, :significant_keys, :recognition_extraction ].each { |method| base.alias_method_chain method, :subdomains }
47
47
  end
48
-
48
+
49
49
  def recognition_conditions_with_subdomains
50
- returning recognition_conditions_without_subdomains do |result|
50
+ recognition_conditions_without_subdomains.tap do |result|
51
51
  case conditions[:subdomains]
52
52
  when Array
53
53
  result << "conditions[:subdomains].include?(env[:subdomain])"
@@ -56,7 +56,7 @@ module SubdomainRoutes
56
56
  end
57
57
  end
58
58
  end
59
-
59
+
60
60
  def generation_extraction_with_subdomains
61
61
  results = [ generation_extraction_without_subdomains ]
62
62
  if conditions[:subdomains].is_a?(Symbol)
@@ -64,28 +64,28 @@ module SubdomainRoutes
64
64
  end
65
65
  results.compact * "\n"
66
66
  end
67
-
67
+
68
68
  def segment_keys_with_subdomains
69
- returning segment_keys_without_subdomains do |result|
69
+ segment_keys_without_subdomains.tap do |result|
70
70
  result.unshift(conditions[:subdomains]) if conditions[:subdomains].is_a? Symbol
71
71
  end
72
72
  end
73
-
73
+
74
74
  def significant_keys_with_subdomains
75
- returning significant_keys_without_subdomains do |result|
75
+ significant_keys_without_subdomains.tap do |result|
76
76
  if conditions[:subdomains].is_a? Symbol
77
77
  result << conditions[:subdomains]
78
78
  result.uniq!
79
79
  end
80
80
  end
81
81
  end
82
-
82
+
83
83
  def recognition_extraction_with_subdomains
84
- returning recognition_extraction_without_subdomains do |result|
84
+ recognition_extraction_without_subdomains.tap do |result|
85
85
  result.unshift "\nparams[#{conditions[:subdomains].inspect}] = subdomain\n" if conditions[:subdomains].is_a? Symbol
86
86
  end
87
87
  end
88
-
88
+
89
89
  def reserved_subdomains
90
90
  conditions[:subdomains].is_a?(Array) ? conditions[:subdomains] : []
91
91
  end
@@ -0,0 +1,87 @@
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{mataki-subdomain_routes}
8
+ s.version = "0.3.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Matthew Hollingworth", "Akihiro Matsumura"]
12
+ s.date = %q{2010-10-14}
13
+ s.description = %q{ SubdomainRoutes add subdomain conditions to the Rails routing system. Routes may be restricted to
14
+ one or many specified subdomains. An URL will be recognised only if the host subdomain matches the
15
+ subdomain specified in the route. Route generation is also enhanced, so that the subdomain of a
16
+ generated URL (or path) will be changed if the requested route has a different subdomain to that of
17
+ the current request. Model-based subdomain routes can also be defined.
18
+ }
19
+ s.email = %q{matsumura.aki@gmail.com}
20
+ s.extra_rdoc_files = [
21
+ "LICENSE",
22
+ "README.textile"
23
+ ]
24
+ s.files = [
25
+ ".document",
26
+ ".gitignore",
27
+ "LICENSE",
28
+ "README.textile",
29
+ "Rakefile",
30
+ "VERSION.yml",
31
+ "history.txt",
32
+ "lib/subdomain_routes.rb",
33
+ "lib/subdomain_routes/assertions.rb",
34
+ "lib/subdomain_routes/config.rb",
35
+ "lib/subdomain_routes/mapper.rb",
36
+ "lib/subdomain_routes/request.rb",
37
+ "lib/subdomain_routes/resources.rb",
38
+ "lib/subdomain_routes/routes.rb",
39
+ "lib/subdomain_routes/split_host.rb",
40
+ "lib/subdomain_routes/url_writer.rb",
41
+ "lib/subdomain_routes/validations.rb",
42
+ "mataki-subdomain_routes.gemspec",
43
+ "rails/init.rb",
44
+ "spec/assertions_spec.rb",
45
+ "spec/extraction_spec.rb",
46
+ "spec/mapping_spec.rb",
47
+ "spec/recognition_spec.rb",
48
+ "spec/resources_spec.rb",
49
+ "spec/routes_spec.rb",
50
+ "spec/spec_helper.rb",
51
+ "spec/test_unit_matcher.rb",
52
+ "spec/url_writing_spec.rb",
53
+ "spec/validations_spec.rb",
54
+ "subdomain_routes.gemspec"
55
+ ]
56
+ s.homepage = %q{http://github.com/mataki/subdomain_routes}
57
+ s.rdoc_options = ["--charset=UTF-8"]
58
+ s.require_paths = ["lib"]
59
+ s.rubygems_version = %q{1.3.6}
60
+ s.summary = %q{A Rails library for incorporating subdomains into route generation and recognition.}
61
+ s.test_files = [
62
+ "spec/assertions_spec.rb",
63
+ "spec/extraction_spec.rb",
64
+ "spec/mapping_spec.rb",
65
+ "spec/recognition_spec.rb",
66
+ "spec/resources_spec.rb",
67
+ "spec/routes_spec.rb",
68
+ "spec/spec_helper.rb",
69
+ "spec/test_unit_matcher.rb",
70
+ "spec/url_writing_spec.rb",
71
+ "spec/validations_spec.rb"
72
+ ]
73
+
74
+ if s.respond_to? :specification_version then
75
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
76
+ s.specification_version = 3
77
+
78
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
79
+ s.add_runtime_dependency(%q<actionpack>, [">= 2.2.1"])
80
+ else
81
+ s.add_dependency(%q<actionpack>, [">= 2.2.1"])
82
+ end
83
+ else
84
+ s.add_dependency(%q<actionpack>, [">= 2.2.1"])
85
+ end
86
+ end
87
+
@@ -0,0 +1,86 @@
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{subdomain_routes}
8
+ s.version = "0.3.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Matthew Hollingworth"]
12
+ s.date = %q{2010-09-08}
13
+ s.description = %q{ SubdomainRoutes add subdomain conditions to the Rails routing system. Routes may be restricted to
14
+ one or many specified subdomains. An URL will be recognised only if the host subdomain matches the
15
+ subdomain specified in the route. Route generation is also enhanced, so that the subdomain of a
16
+ generated URL (or path) will be changed if the requested route has a different subdomain to that of
17
+ the current request. Model-based subdomain routes can also be defined.
18
+ }
19
+ s.email = %q{mdholling@gmail.com}
20
+ s.extra_rdoc_files = [
21
+ "LICENSE",
22
+ "README.textile"
23
+ ]
24
+ s.files = [
25
+ ".document",
26
+ ".gitignore",
27
+ "LICENSE",
28
+ "README.textile",
29
+ "Rakefile",
30
+ "VERSION.yml",
31
+ "history.txt",
32
+ "lib/subdomain_routes.rb",
33
+ "lib/subdomain_routes/assertions.rb",
34
+ "lib/subdomain_routes/config.rb",
35
+ "lib/subdomain_routes/mapper.rb",
36
+ "lib/subdomain_routes/request.rb",
37
+ "lib/subdomain_routes/resources.rb",
38
+ "lib/subdomain_routes/routes.rb",
39
+ "lib/subdomain_routes/split_host.rb",
40
+ "lib/subdomain_routes/url_writer.rb",
41
+ "lib/subdomain_routes/validations.rb",
42
+ "rails/init.rb",
43
+ "spec/assertions_spec.rb",
44
+ "spec/extraction_spec.rb",
45
+ "spec/mapping_spec.rb",
46
+ "spec/recognition_spec.rb",
47
+ "spec/resources_spec.rb",
48
+ "spec/routes_spec.rb",
49
+ "spec/spec_helper.rb",
50
+ "spec/test_unit_matcher.rb",
51
+ "spec/url_writing_spec.rb",
52
+ "spec/validations_spec.rb",
53
+ "subdomain_routes.gemspec"
54
+ ]
55
+ s.homepage = %q{http://github.com/mholling/subdomain_routes}
56
+ s.rdoc_options = ["--charset=UTF-8"]
57
+ s.require_paths = ["lib"]
58
+ s.rubygems_version = %q{1.3.7}
59
+ s.summary = %q{A Rails library for incorporating subdomains into route generation and recognition.}
60
+ s.test_files = [
61
+ "spec/assertions_spec.rb",
62
+ "spec/extraction_spec.rb",
63
+ "spec/mapping_spec.rb",
64
+ "spec/recognition_spec.rb",
65
+ "spec/resources_spec.rb",
66
+ "spec/routes_spec.rb",
67
+ "spec/spec_helper.rb",
68
+ "spec/test_unit_matcher.rb",
69
+ "spec/url_writing_spec.rb",
70
+ "spec/validations_spec.rb"
71
+ ]
72
+
73
+ if s.respond_to? :specification_version then
74
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
75
+ s.specification_version = 3
76
+
77
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
78
+ s.add_runtime_dependency(%q<actionpack>, [">= 2.2.1"])
79
+ else
80
+ s.add_dependency(%q<actionpack>, [">= 2.2.1"])
81
+ end
82
+ else
83
+ s.add_dependency(%q<actionpack>, [">= 2.2.1"])
84
+ end
85
+ end
86
+
metadata CHANGED
@@ -1,29 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mataki-subdomain_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 2
9
+ version: 0.3.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - Matthew Hollingworth
13
+ - Akihiro Matsumura
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-09-05 00:00:00 -07:00
18
+ date: 2010-10-14 00:00:00 +09:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: actionpack
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 2
30
+ - 2
31
+ - 1
23
32
  version: 2.2.1
24
- version:
25
- description: SubdomainRoutes add subdomain conditions to the Rails routing system. Routes may be restricted to one or many specified subdomains. An URL will be recognised only if the host subdomain matches the subdomain specified in the route. Route generation is also enhanced, so that the subdomain of a generated URL (or path) will be changed if the requested route has a different subdomain to that of the current request. Model-based subdomain routes can also be defined.
26
- email: mdholling@gmail.com
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: " SubdomainRoutes add subdomain conditions to the Rails routing system. Routes may be restricted to\n one or many specified subdomains. An URL will be recognised only if the host subdomain matches the\n subdomain specified in the route. Route generation is also enhanced, so that the subdomain of a\n generated URL (or path) will be changed if the requested route has a different subdomain to that of\n the current request. Model-based subdomain routes can also be defined.\n"
36
+ email: matsumura.aki@gmail.com
27
37
  executables: []
28
38
 
29
39
  extensions: []
@@ -32,10 +42,13 @@ extra_rdoc_files:
32
42
  - LICENSE
33
43
  - README.textile
34
44
  files:
45
+ - .document
46
+ - .gitignore
35
47
  - LICENSE
36
48
  - README.textile
37
49
  - Rakefile
38
50
  - VERSION.yml
51
+ - history.txt
39
52
  - lib/subdomain_routes.rb
40
53
  - lib/subdomain_routes/assertions.rb
41
54
  - lib/subdomain_routes/config.rb
@@ -46,6 +59,7 @@ files:
46
59
  - lib/subdomain_routes/split_host.rb
47
60
  - lib/subdomain_routes/url_writer.rb
48
61
  - lib/subdomain_routes/validations.rb
62
+ - mataki-subdomain_routes.gemspec
49
63
  - rails/init.rb
50
64
  - spec/assertions_spec.rb
51
65
  - spec/extraction_spec.rb
@@ -57,9 +71,11 @@ files:
57
71
  - spec/test_unit_matcher.rb
58
72
  - spec/url_writing_spec.rb
59
73
  - spec/validations_spec.rb
60
- has_rdoc: false
61
- homepage: http://github.com/mholling/subdomain_routes
62
- licenses:
74
+ - subdomain_routes.gemspec
75
+ has_rdoc: true
76
+ homepage: http://github.com/mataki/subdomain_routes
77
+ licenses: []
78
+
63
79
  post_install_message:
64
80
  rdoc_options:
65
81
  - --charset=UTF-8
@@ -69,20 +85,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
85
  requirements:
70
86
  - - ">="
71
87
  - !ruby/object:Gem::Version
88
+ segments:
89
+ - 0
72
90
  version: "0"
73
- version:
74
91
  required_rubygems_version: !ruby/object:Gem::Requirement
75
92
  requirements:
76
93
  - - ">="
77
94
  - !ruby/object:Gem::Version
95
+ segments:
96
+ - 0
78
97
  version: "0"
79
- version:
80
98
  requirements: []
81
99
 
82
100
  rubyforge_project:
83
- rubygems_version: 1.3.5
101
+ rubygems_version: 1.3.6
84
102
  signing_key:
85
- specification_version: 2
103
+ specification_version: 3
86
104
  summary: A Rails library for incorporating subdomains into route generation and recognition.
87
105
  test_files:
88
106
  - spec/assertions_spec.rb