tins 1.16.0 → 1.16.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
  SHA256:
3
- metadata.gz: 6388d81e64812daaf22972a79112145a185f7be260d97f728a794abbf75a69c1
4
- data.tar.gz: 56721c708238b93e31e617b0f26883a4a520a74956cfdf274eb0ab4c839ebaf1
3
+ metadata.gz: 470ca7e237caaf15f461cd35ca606b90c7e512f554ac669ba5f2d66bca076710
4
+ data.tar.gz: 8e3b1a5275ce7235a0ebc23bd5438af6ccc9feda5d8296edcfc2d2c90eed46af
5
5
  SHA512:
6
- metadata.gz: 26c272c57c80c072965ce2799fcefec1d929c992d107e4e8042b2bfc1e810e472fe96df778698d93a14954bd63ed197bcea0898874fdb2030f973d3655f3179e
7
- data.tar.gz: 8165141c64d505b470e0b37c21dc57031920416026da0a16f65d568f19f836961ab89c663586637a60279fd1aefb8bab5d8e60cf2d9452df60177a794917a879
6
+ metadata.gz: 84559e53a80ce06a097ab39d6fa83c1921d7af9d43e9d8864aab30853446cb3399e167051982141112f712698b9c428d17c9b50e00e4d408f8fb886f6e35148a
7
+ data.tar.gz: 194493279f02c6121ae61df456d52abef3bc508ae3070c122ed245ac2e6eca5e74caec22a822e504fe19c3a95fe5e5818d5a8e784e5b17ed93bcaff2e9d872c8
data/README.md CHANGED
@@ -12,8 +12,12 @@ Non yet.
12
12
 
13
13
  ## Changes
14
14
 
15
+ * 2017-12-05 Release 1.16.1
16
+ - Improve `temp_io` method with block
17
+ * 2017-11-29 Release 1.16.0
18
+ - Prove `temp_io` method with block
15
19
  * 2017-06-29 Release 1.15.0
16
- - Add support for smart duration formats with %D directive
20
+ - Add support for smart duration formats with %D directive
17
21
  * 2017-05-16 Release 1.14.0
18
22
  - Add visit proc to determine if file should be visited.
19
23
  * 2017-05-14 Release 1.13.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.16.0
1
+ 1.16.1
@@ -5,9 +5,14 @@ module Tins
5
5
  def temp_io(content = nil)
6
6
  Tempfile.open(__method__.to_s, binmode: true) do |io|
7
7
  if content.respond_to?(:call)
8
- content = content.call
8
+ if content.respond_to?(:arity) && content.arity == 1
9
+ content.call(io)
10
+ else
11
+ io.write content.call
12
+ end
13
+ else
14
+ io.write content
9
15
  end
10
- io.write content
11
16
  io.rewind
12
17
  yield io
13
18
  end
@@ -1,6 +1,6 @@
1
1
  module Tins
2
2
  # Tins version
3
- VERSION = '1.16.0'
3
+ VERSION = '1.16.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:
@@ -18,5 +18,13 @@ module Tins
18
18
  }
19
19
  assert_equal returned, :done
20
20
  end
21
+
22
+ def test_with_proc_and_io_arg
23
+ returned = temp_io(-> io { io << 'foo' }) { |io|
24
+ assert_equal 'foo', io.read
25
+ :done
26
+ }
27
+ assert_equal returned, :done
28
+ end
21
29
  end
22
30
  end
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.16.0 ruby lib
2
+ # stub: tins 1.16.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins".freeze
6
- s.version = "1.16.0"
6
+ s.version = "1.16.1"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2017-11-29"
11
+ s.date = "2017-12-05"
12
12
  s.description = "All the stuff that isn't good/big enough for a real library.".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.extra_rdoc_files = ["README.md".freeze, "lib/dslkit.rb".freeze, "lib/dslkit/polite.rb".freeze, "lib/dslkit/rude.rb".freeze, "lib/spruz.rb".freeze, "lib/tins.rb".freeze, "lib/tins/alias.rb".freeze, "lib/tins/annotate.rb".freeze, "lib/tins/ask_and_send.rb".freeze, "lib/tins/attempt.rb".freeze, "lib/tins/bijection.rb".freeze, "lib/tins/case_predicate.rb".freeze, "lib/tins/complete.rb".freeze, "lib/tins/concern.rb".freeze, "lib/tins/count_by.rb".freeze, "lib/tins/date_dummy.rb".freeze, "lib/tins/date_time_dummy.rb".freeze, "lib/tins/deep_const_get.rb".freeze, "lib/tins/deep_dup.rb".freeze, "lib/tins/dslkit.rb".freeze, "lib/tins/duration.rb".freeze, "lib/tins/expose.rb".freeze, "lib/tins/extract_last_argument_options.rb".freeze, "lib/tins/file_binary.rb".freeze, "lib/tins/find.rb".freeze, "lib/tins/generator.rb".freeze, "lib/tins/go.rb".freeze, "lib/tins/hash_symbolize_keys_recursive.rb".freeze, "lib/tins/hash_union.rb".freeze, "lib/tins/if_predicate.rb".freeze, "lib/tins/implement.rb".freeze, "lib/tins/limited.rb".freeze, "lib/tins/lines_file.rb".freeze, "lib/tins/memoize.rb".freeze, "lib/tins/method_description.rb".freeze, "lib/tins/minimize.rb".freeze, "lib/tins/module_group.rb".freeze, "lib/tins/named_set.rb".freeze, "lib/tins/null.rb".freeze, "lib/tins/once.rb".freeze, "lib/tins/p.rb".freeze, "lib/tins/partial_application.rb".freeze, "lib/tins/proc_compose.rb".freeze, "lib/tins/proc_prelude.rb".freeze, "lib/tins/range_plus.rb".freeze, "lib/tins/require_maybe.rb".freeze, "lib/tins/responding.rb".freeze, "lib/tins/secure_write.rb".freeze, "lib/tins/sexy_singleton.rb".freeze, "lib/tins/string_byte_order_mark.rb".freeze, "lib/tins/string_camelize.rb".freeze, "lib/tins/string_underscore.rb".freeze, "lib/tins/string_version.rb".freeze, "lib/tins/subhash.rb".freeze, "lib/tins/temp_io.rb".freeze, "lib/tins/terminal.rb".freeze, "lib/tins/thread_local.rb".freeze, "lib/tins/time_dummy.rb".freeze, "lib/tins/to.rb".freeze, "lib/tins/to_proc.rb".freeze, "lib/tins/token.rb".freeze, "lib/tins/uniq_by.rb".freeze, "lib/tins/unit.rb".freeze, "lib/tins/version.rb".freeze, "lib/tins/write.rb".freeze, "lib/tins/xt.rb".freeze, "lib/tins/xt/annotate.rb".freeze, "lib/tins/xt/ask_and_send.rb".freeze, "lib/tins/xt/attempt.rb".freeze, "lib/tins/xt/blank.rb".freeze, "lib/tins/xt/case_predicate.rb".freeze, "lib/tins/xt/complete.rb".freeze, "lib/tins/xt/concern.rb".freeze, "lib/tins/xt/count_by.rb".freeze, "lib/tins/xt/date_dummy.rb".freeze, "lib/tins/xt/date_time_dummy.rb".freeze, "lib/tins/xt/deep_const_get.rb".freeze, "lib/tins/xt/deep_dup.rb".freeze, "lib/tins/xt/dslkit.rb".freeze, "lib/tins/xt/expose.rb".freeze, "lib/tins/xt/extract_last_argument_options.rb".freeze, "lib/tins/xt/file_binary.rb".freeze, "lib/tins/xt/full.rb".freeze, "lib/tins/xt/hash_symbolize_keys_recursive.rb".freeze, "lib/tins/xt/hash_union.rb".freeze, "lib/tins/xt/if_predicate.rb".freeze, "lib/tins/xt/implement.rb".freeze, "lib/tins/xt/irb.rb".freeze, "lib/tins/xt/method_description.rb".freeze, "lib/tins/xt/named.rb".freeze, "lib/tins/xt/null.rb".freeze, "lib/tins/xt/p.rb".freeze, "lib/tins/xt/partial_application.rb".freeze, "lib/tins/xt/proc_compose.rb".freeze, "lib/tins/xt/proc_prelude.rb".freeze, "lib/tins/xt/range_plus.rb".freeze, "lib/tins/xt/require_maybe.rb".freeze, "lib/tins/xt/responding.rb".freeze, "lib/tins/xt/secure_write.rb".freeze, "lib/tins/xt/sexy_singleton.rb".freeze, "lib/tins/xt/string.rb".freeze, "lib/tins/xt/string_byte_order_mark.rb".freeze, "lib/tins/xt/string_camelize.rb".freeze, "lib/tins/xt/string_underscore.rb".freeze, "lib/tins/xt/string_version.rb".freeze, "lib/tins/xt/subhash.rb".freeze, "lib/tins/xt/temp_io.rb".freeze, "lib/tins/xt/time_dummy.rb".freeze, "lib/tins/xt/time_freezer.rb".freeze, "lib/tins/xt/to.rb".freeze, "lib/tins/xt/uniq_by.rb".freeze, "lib/tins/xt/write.rb".freeze]
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.16.0
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar