versioncake 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab0ef110750d5d6c29da0ac41b7f16c1419ebb80
4
- data.tar.gz: 73d8a03d11d238326a7da5846cf43e3a3986a477
3
+ metadata.gz: d61aa19d50e26e583ce2eea0fca2d2e12cc0337c
4
+ data.tar.gz: 024e457348b85cb229be55db1319944da4ce2a9f
5
5
  SHA512:
6
- metadata.gz: 247f480c40da96d017f03226043292ec8846fa46a4e900934eb434d7df2c162139bae51a79e9cb2646cff4af9b4ee0693463549a46709855d46b763d592445bf
7
- data.tar.gz: 869e0fc8d10302248570520a888e3fc7d5d082a4ddfbf4cf57cf0a5f9d7a02d508874097328a2cde360afa449a5ca3a3249db47a00d7f8194ae0170e57ed5f74
6
+ metadata.gz: edc4648ae169a2c6c61ff8def796b3bf5c5abaf568beb1d80d187f96d2a3ba870ed56ad2ec9c5405cb5865c46bdd97651916b08c57a5f4ede932019d0817ad57
7
+ data.tar.gz: a8610d6612b85369d1338e27614369d55494d63277ea218b3500457458bc6dcd023c8ffdc27f386356a7446ba6e0d8d5f31f637dc93a71cbbbae3d2fa659b2cb
data/.travis.yml CHANGED
@@ -6,9 +6,12 @@ rvm:
6
6
 
7
7
  gemfile:
8
8
  - gemfiles/rails3.2.gemfile
9
- - gemfiles/rails4.0.rc1.gemfile
9
+ - gemfiles/rails4.0.gemfile
10
10
 
11
11
  matrix:
12
12
  exclude:
13
13
  - rvm: 1.9.2
14
- gemfile: gemfiles/rails4.0.rc1.gemfile
14
+ gemfile: gemfiles/rails4.0.gemfile
15
+
16
+ allow_failures:
17
+ - rvm: ruby-head
data/Appraisals CHANGED
@@ -4,8 +4,8 @@ appraise "rails3.2" do
4
4
  gem('railties', '~> 3.2.0')
5
5
  end
6
6
 
7
- appraise "rails4.0.rc1" do
8
- gem('actionpack', '4.0.0.rc1')
9
- gem('activesupport', '4.0.0.rc1')
10
- gem('railties', '4.0.0.rc1')
7
+ appraise "rails4.0" do
8
+ gem('actionpack', '~> 4.0.0')
9
+ gem('activesupport', '~> 4.0.0')
10
+ gem('railties', '~> 4.0.0')
11
11
  end
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ## Unreleased Changes
2
2
 
3
- [Full Changelog](https://github.com/bwillis/versioncake/compare/v1.2...master)
3
+ [Full Changelog](https://github.com/bwillis/versioncake/compare/v1.3...master)
4
+
5
+ ## 1.3.0 (Sept 26, 2013)
6
+
7
+ [Full Changelog](https://github.com/bwillis/versioncake/compare/v1.2...v1.3)
8
+
9
+ Bug Fixes:
10
+
11
+ * Default supported versions were not being set correctly (issue #13), thanks [Jérémie Meyer de Ville](https://github.com/jeremiemv)
4
12
 
5
13
  ## 1.2.0 (May 26, 2013)
6
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- versioncake (1.2.0)
4
+ versioncake (1.3.0)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -10,26 +10,23 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (3.2.13)
14
- activemodel (= 3.2.13)
15
- activesupport (= 3.2.13)
16
- builder (~> 3.0.0)
13
+ actionpack (4.0.0)
14
+ activesupport (= 4.0.0)
15
+ builder (~> 3.1.0)
17
16
  erubis (~> 2.7.0)
18
- journey (~> 1.0.4)
19
- rack (~> 1.4.5)
20
- rack-cache (~> 1.2)
21
- rack-test (~> 0.6.1)
22
- sprockets (~> 2.2.1)
23
- activemodel (3.2.13)
24
- activesupport (= 3.2.13)
25
- builder (~> 3.0.0)
26
- activesupport (3.2.13)
27
- i18n (= 0.6.1)
28
- multi_json (~> 1.0)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ activesupport (4.0.0)
20
+ i18n (~> 0.6, >= 0.6.4)
21
+ minitest (~> 4.2)
22
+ multi_json (~> 1.3)
23
+ thread_safe (~> 0.1)
24
+ tzinfo (~> 0.3.37)
29
25
  appraisal (0.5.2)
30
26
  bundler
31
27
  rake
32
- builder (3.0.4)
28
+ atomic (1.1.10)
29
+ builder (3.1.4)
33
30
  colorize (0.5.8)
34
31
  coveralls (0.6.7)
35
32
  colorize
@@ -38,46 +35,32 @@ GEM
38
35
  simplecov (>= 0.7)
39
36
  thor
40
37
  erubis (2.7.0)
41
- hike (1.2.2)
42
- i18n (0.6.1)
43
- journey (1.0.4)
44
- json (1.8.0)
38
+ i18n (0.6.4)
45
39
  metaclass (0.0.1)
46
40
  mime-types (1.23)
41
+ minitest (4.7.5)
47
42
  mocha (0.14.0)
48
43
  metaclass (~> 0.0.1)
49
44
  multi_json (1.7.3)
50
- rack (1.4.5)
51
- rack-cache (1.2)
52
- rack (>= 0.4)
53
- rack-ssl (1.3.3)
54
- rack
45
+ rack (1.5.2)
55
46
  rack-test (0.6.2)
56
47
  rack (>= 1.0)
57
- railties (3.2.13)
58
- actionpack (= 3.2.13)
59
- activesupport (= 3.2.13)
60
- rack-ssl (~> 1.3.2)
48
+ railties (4.0.0)
49
+ actionpack (= 4.0.0)
50
+ activesupport (= 4.0.0)
61
51
  rake (>= 0.8.7)
62
- rdoc (~> 3.4)
63
- thor (>= 0.14.6, < 2.0)
52
+ thor (>= 0.18.1, < 2.0)
64
53
  rake (10.0.4)
65
- rdoc (3.12.2)
66
- json (~> 1.4)
67
54
  rest-client (1.6.7)
68
55
  mime-types (>= 1.16)
69
56
  simplecov (0.7.1)
70
57
  multi_json (~> 1.0)
71
58
  simplecov-html (~> 0.7.1)
72
59
  simplecov-html (0.7.1)
73
- sprockets (2.2.2)
74
- hike (~> 1.2)
75
- multi_json (~> 1.0)
76
- rack (~> 1.0)
77
- tilt (~> 1.1, != 1.3.0)
78
60
  test-unit (2.5.5)
79
61
  thor (0.18.1)
80
- tilt (1.4.1)
62
+ thread_safe (0.1.0)
63
+ atomic
81
64
  tzinfo (0.3.37)
82
65
 
83
66
  PLATFORMS
data/README.md CHANGED
@@ -295,6 +295,7 @@ Thanks to all those who have helped make Version Cake really sweet:
295
295
  * [Rohit](https://github.com/rg)
296
296
  * Sevag
297
297
  * [Billy](https://github.com/bcatherall)
298
+ * [Jérémie Meyer de Ville](https://github.com/jeremiemv)
298
299
 
299
300
  # Related Material
300
301
 
@@ -311,6 +312,7 @@ Thanks to all those who have helped make Version Cake really sweet:
311
312
 
312
313
  ## Discussions
313
314
 
315
+ - [Peter Williams on versioning rest web services](http://barelyenough.org/blog/2008/05/versioning-rest-web-services/)
314
316
  - [Steve Klabnik on how to version in a resful way](http://blog.steveklabnik.com/posts/2011-07-03-nobody-understands-rest-or-http#i_want_my_api_to_be_versioned)
315
317
  - [Rails API project disucssion on versioning](https://github.com/rails-api/rails-api/issues/8)
316
318
  - [Railscast on versioning](http://railscasts.com/episodes/350-rest-api-versioning)
data/RELEASE.md ADDED
@@ -0,0 +1,27 @@
1
+ # Release
2
+
3
+ Keeping releases consistent is important so here are the steps to follow when pushing a new version.
4
+
5
+ 1. Bump [lib/versioncake/version.rb](https://github.com/bwillis/versioncake/blob/master/lib/versioncake/version.rb) to the next major.minor version
6
+ 2. Make sure all tests are passing ```bundle && rake && rake appraisal test```
7
+ 3. Smoke test in 350-rest-api-versioning/store-after-versioncake
8
+
9
+ Verify:
10
+ - latest version works
11
+ - getting old version works
12
+ - config flags
13
+ - rails versions
14
+
15
+ 4. Make sure [CHANGELOG](https://github.com/bwillis/versioncake/blob/master/CHANGELOG.md) is up to date
16
+ 5. Commit changes ```git commit -am "bumping to vX.X"```
17
+
18
+ Changes committed:
19
+ - Gemfile.lock && gemfiles/*.lock
20
+ - version.rb
21
+
22
+ 6. Push to github ```git push origin/master```
23
+ 7. Tag the version ```git tag -a vX.X -m 'Version X.X Stable' && git push --tags```
24
+
25
+ 8. Build the gem ```gem build versioncake.gemspec```
26
+ 9. Push the gem to ruby gems ```gem push versioncake-vX.X.X.gem```
27
+ 10. Remove the built gem locally ```rm versioncake-X.X.X.gem```
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- versioncake (1.2.0)
4
+ versioncake (1.3.0)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "actionpack", "~> 4.0.0"
6
+ gem "activesupport", "~> 4.0.0"
7
+ gem "railties", "~> 4.0.0"
8
+
9
+ gemspec :path=>"../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- versioncake (1.2.0)
4
+ versioncake (1.3.0)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -10,13 +10,13 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (4.0.0.rc1)
14
- activesupport (= 4.0.0.rc1)
13
+ actionpack (4.0.0)
14
+ activesupport (= 4.0.0)
15
15
  builder (~> 3.1.0)
16
16
  erubis (~> 2.7.0)
17
17
  rack (~> 1.5.2)
18
18
  rack-test (~> 0.6.2)
19
- activesupport (4.0.0.rc1)
19
+ activesupport (4.0.0)
20
20
  i18n (~> 0.6, >= 0.6.4)
21
21
  minitest (~> 4.2)
22
22
  multi_json (~> 1.3)
@@ -25,7 +25,7 @@ GEM
25
25
  appraisal (0.5.2)
26
26
  bundler
27
27
  rake
28
- atomic (1.1.9)
28
+ atomic (1.1.10)
29
29
  builder (3.1.4)
30
30
  colorize (0.5.8)
31
31
  coveralls (0.6.7)
@@ -38,19 +38,19 @@ GEM
38
38
  i18n (0.6.4)
39
39
  metaclass (0.0.1)
40
40
  mime-types (1.23)
41
- minitest (4.7.4)
41
+ minitest (4.7.5)
42
42
  mocha (0.14.0)
43
43
  metaclass (~> 0.0.1)
44
- multi_json (1.7.3)
44
+ multi_json (1.7.7)
45
45
  rack (1.5.2)
46
46
  rack-test (0.6.2)
47
47
  rack (>= 1.0)
48
- railties (4.0.0.rc1)
49
- actionpack (= 4.0.0.rc1)
50
- activesupport (= 4.0.0.rc1)
48
+ railties (4.0.0)
49
+ actionpack (= 4.0.0)
50
+ activesupport (= 4.0.0)
51
51
  rake (>= 0.8.7)
52
52
  thor (>= 0.18.1, < 2.0)
53
- rake (10.0.4)
53
+ rake (10.1.0)
54
54
  rest-client (1.6.7)
55
55
  mime-types (>= 1.16)
56
56
  simplecov (0.7.1)
@@ -67,12 +67,12 @@ PLATFORMS
67
67
  ruby
68
68
 
69
69
  DEPENDENCIES
70
- actionpack (= 4.0.0.rc1)
71
- activesupport (= 4.0.0.rc1)
70
+ actionpack (~> 4.0.0)
71
+ activesupport (~> 4.0.0)
72
72
  appraisal
73
73
  coveralls
74
74
  mocha
75
- railties (= 4.0.0.rc1)
75
+ railties (~> 4.0.0)
76
76
  rake
77
77
  test-unit
78
78
  versioncake!
@@ -1,15 +1,15 @@
1
1
  require 'active_support/core_ext/module/attribute_accessors.rb'
2
+ require 'active_support/core_ext/array/wrap.rb'
2
3
 
3
4
  module VersionCake
4
5
  module Configuration
5
6
 
6
7
  SUPPORTED_VERSIONS_DEFAULT = (1..10)
7
8
 
8
- mattr_accessor :supported_version_numbers
9
- self.supported_version_numbers = SUPPORTED_VERSIONS_DEFAULT
9
+ mattr_reader :supported_version_numbers
10
10
 
11
11
  mattr_accessor :extraction_strategies
12
- self.extraction_strategies = [VersionCake::QueryParameterStrategy.new]
12
+ self.extraction_strategies = []
13
13
 
14
14
  mattr_accessor :default_version
15
15
  self.default_version = nil
@@ -42,5 +42,7 @@ module VersionCake
42
42
  supported_version_numbers.first
43
43
  end
44
44
 
45
+ self.extraction_strategy = :query_parameter
46
+ self.supported_version_numbers = SUPPORTED_VERSIONS_DEFAULT
45
47
  end
46
48
  end
@@ -4,13 +4,31 @@ module VersionCake
4
4
  module ControllerAdditions
5
5
  extend ActiveSupport::Concern
6
6
 
7
- attr_accessor :requested_version, :is_latest_version, :derived_version
7
+ # The explicit version requested by a client, this may not
8
+ # be the rendered version and may also be nil.
9
+ attr_accessor :requested_version
8
10
 
11
+ # A boolean check to determine if the latest version is requested.
12
+ attr_accessor :is_latest_version
13
+
14
+ # The requested version by a client or if it's nil the latest or default
15
+ # version configured.
16
+ attr_accessor :derived_version
17
+
18
+ # set_version is the prepend filter that will determine the version of the
19
+ # requests.
9
20
  included do
10
21
  prepend_before_filter :set_version
11
22
  end
12
23
 
13
24
  protected
25
+
26
+ # Sets the version of the request as well as several accessor variables.
27
+ #
28
+ # @param override_version a version number to use instead of the one extracted
29
+ # from the request
30
+ #
31
+ # @return No explicit return, but several attributes are exposed
14
32
  def set_version(override_version=nil)
15
33
  versioned_request = VersionCake::VersionedRequest.new(request, override_version)
16
34
  @requested_version = versioned_request.extracted_version
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/class/attribute_accessors.rb'
2
+ require 'active_support/core_ext/string/inflections.rb'
2
3
 
3
4
  module VersionCake
4
5
  class ExtractionStrategy
@@ -1,3 +1,3 @@
1
1
  module VersionCake
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versioncake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Jones
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2013-09-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -153,11 +153,12 @@ files:
153
153
  - Gemfile
154
154
  - Gemfile.lock
155
155
  - README.md
156
+ - RELEASE.md
156
157
  - Rakefile
157
158
  - gemfiles/rails3.2.gemfile
158
159
  - gemfiles/rails3.2.gemfile.lock
159
- - gemfiles/rails4.0.rc1.gemfile
160
- - gemfiles/rails4.0.rc1.gemfile.lock
160
+ - gemfiles/rails4.0.gemfile
161
+ - gemfiles/rails4.0.gemfile.lock
161
162
  - images/versioncake-logo450x100.png
162
163
  - lib/versioncake.rb
163
164
  - lib/versioncake/configuration.rb
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "actionpack", "4.0.0.rc1"
6
- gem "activesupport", "4.0.0.rc1"
7
- gem "railties", "4.0.0.rc1"
8
-
9
- gemspec :path=>"../"