versioncake 2.3.0 → 2.3.1

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTY4ZDYxNWY2ZDdjMjEwMjQyZDYwZDQ1ZTM2MmYyMzZkZTQzYjE1NA==
4
+ NTVmM2QwNTQ5NDBkZWM0YjY0MmEwYzk0YmU1YzA1NmJhODBjZmY3Mg==
5
5
  data.tar.gz: !binary |-
6
- MjcxYTE4N2NjMmQxMjU3NTIwNDA2ZDQzNTcyMWQ2YzU0ZTA5ODBhZg==
6
+ NGFjODRjMTE5YmJhZjNlZjQxODM3Zjk3ZjUxNDJkMTExMzk5NjI5Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjA2ZDU2MDEzMjk3NzBhODNmZDhlNTY1ZDI1Y2I5OWQ2OWE4OTM1ODBhNjg0
10
- ZDUzYTI5MmNhYTNiODg1M2IxNTY3MzFmNDNjNjFhZWQyZTM1MjI5NzUyZGUx
11
- NGNmZWExN2QzOTgzMGM2MzZkMzA5NDBiN2M0ZTI2MjUzOTkyYTU=
9
+ ZDAyMTZmMTU1OWIxMDMyYTc2MWFhNWY5MDk4Y2FkNzNkMGU2OWJmNTg0ZjVh
10
+ YjlmNWIwNWQ5NDY3NDY5MmZhODA2YzAyMmY5ZjIxNTczNTNiMmJkYmY2OTUy
11
+ YmExNDVmNjgzNmI2YzViMzYzMzFlMTY1ODgyMDMwOTZhOWEzYzg=
12
12
  data.tar.gz: !binary |-
13
- NDljNjI2NDk3ZjY2YTI3NGZlMTFiY2IxNmYxNTU0YjdkMTVlOTFhZjY5ZmM1
14
- N2M5ODM4MmM3YjAzMDM3OGY0YWNmMDk4YzdiNTk2MDExZmEwMDk1MDgxMjgy
15
- NzI2OTFiYzA3YTc0NTZmZjVhNTExN2NmN2U4YmYwZWJjYzA4ZDM=
13
+ MWY5YjMyMDI3ZGE4OGExMjVlNjIyOTEwNmNmZTRhZTEyNDY3MTM3ZDQzMTM0
14
+ MWFjYWY3N2YzOTczNDZiYzFhZTYwYzA5ODZhZWQ3OTUyMWY2ODJlZTBmMjM0
15
+ OTlkOGFlNTg4YzU3YjI0OTUxOGY3NWRkODFhMjAyZTJlMmViM2Q=
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Unreleased Changes
2
2
 
3
- [Full Changelog](https://github.com/bwillis/versioncake/compare/v2.3...master)
3
+ [Full Changelog](https://github.com/bwillis/versioncake/compare/v2.3.1...master)
4
4
 
5
5
  Bug Fixes:
6
6
 
@@ -14,7 +14,7 @@ Deprecations:
14
14
 
15
15
  * None
16
16
 
17
- ## 2.3.0 (Mar 6, 2014)
17
+ ## 2.3.1 (Mar 6, 2014)
18
18
 
19
19
  [Full Changelog](https://github.com/bwillis/versioncake/compare/v2.2...v2.3)
20
20
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- versioncake (2.3.0)
4
+ versioncake (2.3.1)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- versioncake (2.3.0)
4
+ versioncake (2.3.1)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- versioncake (2.3.0)
4
+ versioncake (2.3.1)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- versioncake (2.3.0)
4
+ versioncake (2.3.1)
5
5
  actionpack (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  railties (>= 3.2)
@@ -5,7 +5,11 @@ module VersionCake
5
5
  end
6
6
 
7
7
  def execute(request)
8
- @callback.call(request)
8
+ if @callback.respond_to? :execute
9
+ @callback.execute(request)
10
+ else
11
+ @callback.call(request)
12
+ end
9
13
  end
10
14
  end
11
15
  end
@@ -43,7 +43,7 @@ module VersionCake
43
43
  elsif strategy.method(:execute).arity != 1
44
44
  raise Exception, "Custom extraction strategy requires an execute method with a single parameter"
45
45
  else
46
- strategy
46
+ VersionCake::CustomStrategy.new(strategy)
47
47
  end
48
48
  else
49
49
  raise Exception, "Invalid extration strategy"
@@ -1,3 +1,3 @@
1
1
  module VersionCake
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
@@ -38,13 +38,22 @@ class ExtractionStrategyTest < ActiveSupport::TestCase
38
38
  assert_equal VersionCake::CustomStrategy, strategy.class
39
39
  end
40
40
 
41
- test "it allows a custom class" do
41
+ test "it wraps a custom object" do
42
42
  class FakeStrategy
43
- def execute(request); end
43
+ def execute(request);end
44
44
  end
45
- instance = FakeStrategy.new
46
- strategy = VersionCake::ExtractionStrategy.lookup(instance)
47
- assert_equal instance, strategy
45
+ strategy = VersionCake::ExtractionStrategy.lookup(FakeStrategy.new)
46
+ assert_equal VersionCake::CustomStrategy, strategy.class
47
+ end
48
+
49
+ test "it calls a custom objects execute method" do
50
+ class FakeStrategy
51
+ def execute(request)
52
+ 9999
53
+ end
54
+ end
55
+ strategy = VersionCake::ExtractionStrategy.lookup(FakeStrategy.new)
56
+ assert_equal 9999, strategy.execute(nil)
48
57
  end
49
58
 
50
59
  test "it fails to create a custom strategy for a proc with no parameters" do
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: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Jones