versionist 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,6 +28,7 @@ module Versionist
28
28
  end
29
29
  raise ArgumentError, "you must specify :module in configuration Hash passed to api_version" if !config.has_key?(:module)
30
30
  raise ArgumentError, ":defaults must be a Hash" if config.has_key?(:defaults) && !config[:defaults].is_a?(Hash)
31
+ rails_quirks(config, &block)
31
32
  configure_header(config, &block) if config.has_key?(:header)
32
33
  configure_path(config, &block) if config.has_key?(:path)
33
34
  configure_parameter(config, &block) if config.has_key?(:parameter)
@@ -67,5 +68,18 @@ module Versionist
67
68
  route_hash.merge!({:defaults => config[:defaults]}) if config.has_key?(:defaults)
68
69
  scope(route_hash, &block)
69
70
  end
71
+
72
+ # deals with quirks in routing among the various Rails versions
73
+ def rails_quirks(config, &block)
74
+ rails4_quirks(config) if Rails::VERSION::MAJOR == 4
75
+ end
76
+
77
+ # Rails 4 quirks
78
+ def rails4_quirks(config, &block)
79
+ # Rails 4 no longer allows constant syntax in routing.
80
+ # https://github.com/bploetz/versionist/issues/39
81
+ # call underscore on the module so it adheres to this convention
82
+ config[:module] = config[:module].underscore
83
+ end
70
84
  end
71
85
  end
@@ -1,3 +1,3 @@
1
1
  module Versionist
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versionist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
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-06-26 00:00:00.000000000 Z
12
+ date: 2013-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -110,6 +110,6 @@ rubyforge_project:
110
110
  rubygems_version: 1.8.25
111
111
  signing_key:
112
112
  specification_version: 3
113
- summary: versionist-1.1.0
113
+ summary: versionist-1.2.0
114
114
  test_files: []
115
115
  has_rdoc: