tins 1.5.1 → 1.5.2

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: c5e778d9f820a41c86b37a0f9e07509560ca7f74
4
- data.tar.gz: 52237466eb9039e27bfe57079cc15ce436f29e35
3
+ metadata.gz: 675d8fe4f6eb2760a8c612aa8e866b0a56a03592
4
+ data.tar.gz: 6d2365de9f550d6a4d4a5e0c5448b072f872c7fb
5
5
  SHA512:
6
- metadata.gz: aef0d1ead6cde51f98fcc2c95bf7e1956f8f9e45c98f03a557cf5369a3e3d40edaadc6d5572658309fbf70da2677c65ffc9d8dcfe83c07cc3f41d7340f787425
7
- data.tar.gz: b9be1680e82700d3faf2e91a819e9ca7ce1d8369dd5521acc39b051939274cdce2403e689bd11daab4adfc78305074f730491d034c48d745ee9186a309c4f4d9
6
+ metadata.gz: 9596699ef22176c269d02b31ba2adef456e11cc4cd27a04e9c9fd7007019d835b34222ebc5eba3f89a39f0e2ea2bb43fbea6a6c805fdf04d5889a7e431d31709
7
+ data.tar.gz: 2eb308a13aa44d00e3458c2f180017320f977187a3934e6e7abd20038a581bbc9e4a479a8fbddbff197a9e7375d2b56b2b5f822b095b15d06ba293c63efb4153
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.1
1
+ 1.5.2
@@ -18,7 +18,7 @@ module Tins
18
18
  if respond_to?(:parameters)
19
19
  generated_name = 'x0'
20
20
  result << parameters.map { |p_type, p_name|
21
- p_name ||= generated_name.succ!
21
+ p_name ||= generated_name.succ!.dup
22
22
  case p_type
23
23
  when :block
24
24
  "&#{p_name}"
data/lib/tins/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Tins
2
2
  # Tins version
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.2'
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:
@@ -1,73 +1,75 @@
1
1
  require 'test_helper'
2
2
  require 'tins/xt'
3
3
 
4
- if RUBY_VERSION >= "1.9"
5
- module Tins
6
- class MethodDescriptionTest < Test::Unit::TestCase
7
- class A
8
- def foo
9
- end
10
-
11
- def self.foo
12
- end
4
+ module Tins
5
+ class MethodDescriptionTest < Test::Unit::TestCase
6
+ class A
7
+ def foo
13
8
  end
14
9
 
15
- def test_static_nonstatic
16
- assert_equal 'Tins::MethodDescriptionTest::A#foo()', A.instance_method(:foo).to_s
17
- assert_equal '#<UnboundMethod: Tins::MethodDescriptionTest::A#foo()>', A.instance_method(:foo).inspect
18
- assert_equal 'Tins::MethodDescriptionTest::A.foo()', A.method(:foo).to_s
19
- assert_equal '#<Method: Tins::MethodDescriptionTest::A.foo()>', A.method(:foo).inspect
10
+ def self.foo
20
11
  end
12
+ end
21
13
 
22
- class B
23
- def foo(x, y = 1, *r, &b)
24
- end
25
- end
14
+ def test_static_nonstatic
15
+ assert_equal 'Tins::MethodDescriptionTest::A#foo()', A.instance_method(:foo).to_s
16
+ assert_equal '#<UnboundMethod: Tins::MethodDescriptionTest::A#foo()>', A.instance_method(:foo).inspect
17
+ assert_equal 'Tins::MethodDescriptionTest::A.foo()', A.method(:foo).to_s
18
+ assert_equal '#<Method: Tins::MethodDescriptionTest::A.foo()>', A.method(:foo).inspect
19
+ end
26
20
 
27
- def test_standard_parameters_namespace
28
- assert_equal 'Tins::MethodDescriptionTest::B#foo(x,y=?,*r,&b)',
29
- B.instance_method(:foo).to_s
21
+ class B
22
+ def foo(x, y = 1, *r, &b)
30
23
  end
24
+ end
31
25
 
32
- def test_standard_parameters_name
33
- assert_equal 'foo(x,y=?,*r,&b)',
34
- B.instance_method(:foo).description(style: :name)
35
- end
26
+ def test_standard_parameters_namespace
27
+ assert_equal 'Tins::MethodDescriptionTest::B#foo(x,y=?,*r,&b)',
28
+ B.instance_method(:foo).to_s
29
+ end
36
30
 
37
- def test_standard_parameters_parameters
38
- assert_equal 'x,y=?,*r,&b',
39
- B.instance_method(:foo).description(style: :parameters)
40
- end
31
+ def test_standard_parameters_name
32
+ assert_equal 'foo(x,y=?,*r,&b)',
33
+ B.instance_method(:foo).description(style: :name)
34
+ end
41
35
 
42
- if RUBY_VERSION >= "2.0"
43
- eval %{
44
- class C
45
- def foo(x, k: true, &b)
46
- end
36
+ def test_standard_parameters_parameters
37
+ assert_equal 'x,y=?,*r,&b',
38
+ B.instance_method(:foo).description(style: :parameters)
39
+ end
47
40
 
48
- def bar(x, **k, &b)
49
- end
50
- end
41
+ def test_a_cstyle_method_from_hash
42
+ assert_equal "Hash#store(x1,x2)", ({}.method(:store).description)
43
+ end
51
44
 
52
- def test_keyword_parameters
53
- assert_equal 'Tins::MethodDescriptionTest::C#foo(x,k:?,&b)', C.instance_method(:foo).to_s
54
- assert_equal 'Tins::MethodDescriptionTest::C#bar(x,**k,&b)', C.instance_method(:bar).to_s
45
+ if RUBY_VERSION >= "2.0"
46
+ eval %{
47
+ class C
48
+ def foo(x, k: true, &b)
55
49
  end
56
- }
57
- end
58
50
 
59
- if RUBY_VERSION >= "2.1"
60
- eval %{
61
- class D
62
- def foo(x, k:, &b)
63
- end
51
+ def bar(x, **k, &b)
64
52
  end
53
+ end
54
+
55
+ def test_keyword_parameters
56
+ assert_equal 'Tins::MethodDescriptionTest::C#foo(x,k:?,&b)', C.instance_method(:foo).to_s
57
+ assert_equal 'Tins::MethodDescriptionTest::C#bar(x,**k,&b)', C.instance_method(:bar).to_s
58
+ end
59
+ }
60
+ end
65
61
 
66
- def test_keyword_parameters_required
67
- assert_equal 'Tins::MethodDescriptionTest::D#foo(x,k:,&b)', D.instance_method(:foo).to_s
62
+ if RUBY_VERSION >= "2.1"
63
+ eval %{
64
+ class D
65
+ def foo(x, k:, &b)
68
66
  end
69
- }
70
- end
67
+ end
68
+
69
+ def test_keyword_parameters_required
70
+ assert_equal 'Tins::MethodDescriptionTest::D#foo(x,k:,&b)', D.instance_method(:foo).to_s
71
+ end
72
+ }
71
73
  end
72
74
  end
73
75
  end
data/tests/named_test.rb CHANGED
@@ -12,21 +12,19 @@ module Tins
12
12
  assert_equal [ 3 ], a.plus1.odd
13
13
  end
14
14
 
15
- if RUBY_VERSION >= '1.9'
16
- def foo(x, y, &block)
17
- block.call x * y
18
- end
15
+ def foo(x, y, &block)
16
+ block.call x * y
17
+ end
19
18
 
20
- def test_more_complex
21
- Object.named(:foo_with_block, :foo) do |z|
22
- z ** 2
23
- end
24
- assert_equal foo(2, 3) { |z| z ** 2 }, foo_with_block(2, 3)
25
- Object.named(:foo_23, :foo, 2, 3)
26
- assert_equal foo(2, 3) { |z| z ** 2 }, foo_23 { |z| z ** 2 }
27
- Object.named(:foo_2, :foo, 2)
28
- assert_equal foo(2, 3) { |z| z ** 2 }, foo_2(3) { |z| z ** 2 }
19
+ def test_more_complex
20
+ Object.named(:foo_with_block, :foo) do |z|
21
+ z ** 2
29
22
  end
23
+ assert_equal foo(2, 3) { |z| z ** 2 }, foo_with_block(2, 3)
24
+ Object.named(:foo_23, :foo, 2, 3)
25
+ assert_equal foo(2, 3) { |z| z ** 2 }, foo_23 { |z| z ** 2 }
26
+ Object.named(:foo_2, :foo, 2)
27
+ assert_equal foo(2, 3) { |z| z ** 2 }, foo_2(3) { |z| z ** 2 }
30
28
  end
31
29
  end
32
30
  end
@@ -13,11 +13,7 @@ module Tins
13
13
  def test_proc_compose_more_complex
14
14
  f = lambda { |x, y| 2 * x + y * 3 }
15
15
  g = lambda { |x| x + 1 }
16
- if RUBY_VERSION >= "1.9"
17
- assert_raise(ArgumentError) { (f * g).call(2, 3) }
18
- else
19
- assert_raise(TypeError) { (f * g).call(2, 3) }
20
- end
16
+ assert_raise(ArgumentError) { (f * g).call(2, 3) }
21
17
  d = lambda { |x| [ x, x ] }
22
18
  assert_equal 15, (f * d * g).call(2)
23
19
  end
data/tins.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.5.1 ruby lib
2
+ # stub: tins 1.5.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins"
6
- s.version = "1.5.1"
6
+ s.version = "1.5.2"
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"]
10
10
  s.authors = ["Florian Frank"]
11
- s.date = "2015-04-24"
11
+ s.date = "2015-05-27"
12
12
  s.description = "All the stuff that isn't good/big enough for a real library."
13
13
  s.email = "flori@ping.de"
14
14
  s.extra_rdoc_files = ["README.md", "lib/dslkit.rb", "lib/dslkit/polite.rb", "lib/dslkit/rude.rb", "lib/spruz.rb", "lib/tins.rb", "lib/tins/alias.rb", "lib/tins/annotate.rb", "lib/tins/ask_and_send.rb", "lib/tins/attempt.rb", "lib/tins/bijection.rb", "lib/tins/case_predicate.rb", "lib/tins/concern.rb", "lib/tins/count_by.rb", "lib/tins/date_dummy.rb", "lib/tins/date_time_dummy.rb", "lib/tins/deep_const_get.rb", "lib/tins/deep_dup.rb", "lib/tins/dslkit.rb", "lib/tins/extract_last_argument_options.rb", "lib/tins/file_binary.rb", "lib/tins/find.rb", "lib/tins/generator.rb", "lib/tins/go.rb", "lib/tins/hash_symbolize_keys_recursive.rb", "lib/tins/hash_union.rb", "lib/tins/if_predicate.rb", "lib/tins/implement.rb", "lib/tins/limited.rb", "lib/tins/lines_file.rb", "lib/tins/memoize.rb", "lib/tins/method_description.rb", "lib/tins/minimize.rb", "lib/tins/module_group.rb", "lib/tins/named_set.rb", "lib/tins/null.rb", "lib/tins/once.rb", "lib/tins/p.rb", "lib/tins/partial_application.rb", "lib/tins/proc_compose.rb", "lib/tins/proc_prelude.rb", "lib/tins/range_plus.rb", "lib/tins/require_maybe.rb", "lib/tins/responding.rb", "lib/tins/rotate.rb", "lib/tins/secure_write.rb", "lib/tins/sexy_singleton.rb", "lib/tins/shuffle.rb", "lib/tins/string_byte_order_mark.rb", "lib/tins/string_camelize.rb", "lib/tins/string_underscore.rb", "lib/tins/string_version.rb", "lib/tins/subhash.rb", "lib/tins/terminal.rb", "lib/tins/thread_local.rb", "lib/tins/time_dummy.rb", "lib/tins/to.rb", "lib/tins/to_proc.rb", "lib/tins/token.rb", "lib/tins/uniq_by.rb", "lib/tins/version.rb", "lib/tins/write.rb", "lib/tins/xt.rb", "lib/tins/xt/annotate.rb", "lib/tins/xt/ask_and_send.rb", "lib/tins/xt/attempt.rb", "lib/tins/xt/blank.rb", "lib/tins/xt/case_predicate.rb", "lib/tins/xt/concern.rb", "lib/tins/xt/count_by.rb", "lib/tins/xt/date_dummy.rb", "lib/tins/xt/date_time_dummy.rb", "lib/tins/xt/deep_const_get.rb", "lib/tins/xt/deep_dup.rb", "lib/tins/xt/dslkit.rb", "lib/tins/xt/extract_last_argument_options.rb", "lib/tins/xt/file_binary.rb", "lib/tins/xt/full.rb", "lib/tins/xt/hash_symbolize_keys_recursive.rb", "lib/tins/xt/hash_union.rb", "lib/tins/xt/if_predicate.rb", "lib/tins/xt/implement.rb", "lib/tins/xt/irb.rb", "lib/tins/xt/method_description.rb", "lib/tins/xt/named.rb", "lib/tins/xt/null.rb", "lib/tins/xt/p.rb", "lib/tins/xt/partial_application.rb", "lib/tins/xt/proc_compose.rb", "lib/tins/xt/proc_prelude.rb", "lib/tins/xt/range_plus.rb", "lib/tins/xt/require_maybe.rb", "lib/tins/xt/responding.rb", "lib/tins/xt/rotate.rb", "lib/tins/xt/secure_write.rb", "lib/tins/xt/sexy_singleton.rb", "lib/tins/xt/shuffle.rb", "lib/tins/xt/string.rb", "lib/tins/xt/string_byte_order_mark.rb", "lib/tins/xt/string_camelize.rb", "lib/tins/xt/string_underscore.rb", "lib/tins/xt/string_version.rb", "lib/tins/xt/subhash.rb", "lib/tins/xt/symbol_to_proc.rb", "lib/tins/xt/time_dummy.rb", "lib/tins/xt/time_freezer.rb", "lib/tins/xt/to.rb", "lib/tins/xt/uniq_by.rb", "lib/tins/xt/write.rb"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar