rack-rewrite-dynamic 0.0.5 → 0.0.6

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.
@@ -31,6 +31,12 @@ module Rack
31
31
  end
32
32
  def slug_klass
33
33
  @slug_klass ||= @opts[:slug_name].constantize
34
+ # FIXME: remove rails coupling
35
+ if Rails.env.development?
36
+ @opts[:slug_name].constantize
37
+ else
38
+ @slug_klass
39
+ end
34
40
  end
35
41
  def route_generator_klass
36
42
  @route_generator_klass ||= @opts[:route_generator_name].constantize
@@ -28,9 +28,9 @@ module Rack
28
28
  scope_slug = nil
29
29
  slugs = url_parts.each_with_index.map do |url_part, index|
30
30
  if url_part[1] == 'slug'
31
- scope_slug = slug_type?(match[index+1], url_part[0])
31
+ scope_slug = slug_type?(match[index+1].split('?')[0], url_part[0])
32
32
  elsif url_part[1] == 'scoped_slug'
33
- scope_slug = scoped_slug_type?(match[index+1], url_part[0], scope_slug)
33
+ scope_slug = scoped_slug_type?(match[index+1].split('?')[0], url_part[0], scope_slug)
34
34
  else
35
35
  'static'
36
36
  end
@@ -1,7 +1,7 @@
1
1
  module Rack
2
2
  class Rewrite
3
3
  module Dynamic
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-rewrite-dynamic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack-rewrite
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 1.8.23
122
+ rubygems_version: 1.8.24
123
123
  signing_key:
124
124
  specification_version: 3
125
125
  summary: SEO urls based on slugs