tins 1.4.0 → 1.4.1

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: 2e3b027c965c996c066e7d5760508dcdddf5d20c
4
- data.tar.gz: 7b2903975a6c613023e958341be81de168a2f5e9
3
+ metadata.gz: d7179c6d716a137637e5911d4acc12b00535fdc2
4
+ data.tar.gz: 34a2983eaf2d5290a38f789ae66274d79c550a11
5
5
  SHA512:
6
- metadata.gz: 5671e96b53ad0f48e172b06fb7252cf1ce530f12faf825ccc621f74b80767044c01964577bbfcbda81b3ea2fa71741742722b8e934c557f8ed140b369b6e33ac
7
- data.tar.gz: e349dbda8af6d8ecb13780893c93da5f577f3f7749701cda3c4c989d2b853c922e8e27762c18ab7fc10d86567152f339eba22e120ad21881c248e16d503c470f
6
+ metadata.gz: 13ae38a401a666814bb1077e6ddd904dccd9469c0211a3be135a39c92c39b85005d9db0fdf0ee2fec00e10c3bb183074a6b6eee50694de338726b754a3580e7c
7
+ data.tar.gz: 1f7157f970f167a0f7b2ac0cdeee59498f0c296f0687ae3324b7638746b711e8a016dec018d386f856ede0e4212b97852b11546b096d544d8a835fa62c6747e2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
@@ -9,8 +9,11 @@ module Tins
9
9
  }
10
10
 
11
11
  def implement(method_name, msg = :default)
12
- if ::Symbol === msg
12
+ case msg
13
+ when ::Symbol
13
14
  msg = MESSAGES.fetch(msg)
15
+ when ::Hash
16
+ return implement method_name, msg.fetch(:in)
14
17
  end
15
18
  begin
16
19
  msg = msg % { method_name: method_name, module: self }
data/lib/tins/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Tins
2
2
  # Tins version
3
- VERSION = '1.4.0'
3
+ VERSION = '1.4.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -8,13 +8,16 @@ module Tins
8
8
  class A
9
9
  implement :foo
10
10
 
11
- implement :bar, :subclass
11
+ implement :bar, in: :subclass
12
12
 
13
- implement :baz, :submodule
13
+ implement :baz, in: :submodule
14
14
 
15
15
  implement :qux, 'blub %{method_name} blob %{module}'
16
16
 
17
17
  implement :quux, 'blab'
18
+
19
+ implement def foobar(x1, x2)
20
+ end, in: :subclass
18
21
  end
19
22
 
20
23
  def test_implement_default
@@ -51,6 +54,14 @@ module Tins
51
54
  assert_equal('blab', error_message { A.new.quux })
52
55
  end
53
56
 
57
+ def test_implement_def_subclass
58
+ assert_equal(
59
+ 'method foobar has to be implemented in subclasses of '\
60
+ 'Tins::ImplementTest::A',
61
+ error_message { A.new.foobar }
62
+ )
63
+ end
64
+
54
65
  private
55
66
 
56
67
  def error_message
data/tins.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.4.0 ruby lib
2
+ # stub: tins 1.4.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins"
6
- s.version = "1.4.0"
6
+ s.version = "1.4.1"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank