tins 1.10.2 → 1.11.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: b260a419885548c7e2583220e1045aa7fb00ff3e
4
- data.tar.gz: f6dcfaee7431b8f4ee7c4bd15ad8c30b16bd46a4
3
+ metadata.gz: e6415329fd693754648bcb8286b4e374e0f6f97e
4
+ data.tar.gz: b94c700c21e4b0c75b8e80f2a281737b197509ce
5
5
  SHA512:
6
- metadata.gz: b2ec61d5fd1dc89a562746102178d8e5657838807daffb02467d7026debb0a7066e0157d11721a4035de160ec477d88d81733299ae94d2a5f19c04ec50d77483
7
- data.tar.gz: 1fb9b26560a43aa362c136eb0389f1634dd7611a6807115bc49a267d8970561ac0d1fdbb01e054af219d13b4badd1f00fe66e5d843846952555fee4da5ecefd1
6
+ metadata.gz: 448317d7bffd06d6ce7e86eb3ffc8db5e4c7780e51ff3b20169bfc487e08d07a878aac4f3d290d9169cdfed8afae7b35d5dbc3dd9e52428996518727e1620c84
7
+ data.tar.gz: 057feb9fc08db54c5ef9bf3063ae4f1cdf8ff0a74d4d3aeac7ce100adc97590d7054a219386db11e01b3b362e09f219ea068f0b1971f718bc26e8b3c7ed8107b
@@ -5,12 +5,13 @@ rvm:
5
5
  - 2.3.0
6
6
  - ruby-head
7
7
  - rbx-head
8
- - jruby-head
9
8
  matrix:
9
+ include:
10
+ - rvm: jruby
11
+ env: JRUBY_OPTS="--2.0"
10
12
  allow_failures:
11
13
  - rvm: ruby-head
12
14
  - rvm: rbx-head
13
- - rvm: jruby-head
14
15
  env:
15
16
  - CODECLIMATE_REPO_TOKEN=62d082406430ccf662c2e401976b613c0091e26fcfb546f92b1f2b391951cf50
16
17
  sudo: false
data/README.md CHANGED
@@ -12,6 +12,8 @@ Non yet.
12
12
 
13
13
  ## Changes
14
14
 
15
+ * 2016-07-12 Release 1.11.0
16
+ - Provide Tins::Unit.format and Tins::Unit.parse methods.
15
17
  * 2016-05-25 Release 1.10.2
16
18
  - Avoid some warnings.
17
19
  * 2016-04-15 Release 1.10.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.10.2
1
+ 1.11.0
@@ -53,5 +53,6 @@ module Tins
53
53
  end
54
54
  require 'tins/complete'
55
55
  require 'tins/duration'
56
+ require 'tins/unit'
56
57
  end
57
58
  require 'tins/alias'
@@ -0,0 +1,164 @@
1
+ require 'strscan'
2
+ require 'bigdecimal'
3
+
4
+ module Tins::Unit
5
+ Prefix = Struct.new(:name, :step, :multiplier, :fraction)
6
+
7
+ PREFIX_LC = [
8
+ '', 'k', 'm', 'g', 't', 'p', 'e', 'z', 'y',
9
+ ].each_with_index.map { |n, i| Prefix.new(n.freeze, 1000, 1000 ** i, false) }.freeze
10
+
11
+ PREFIX_UC = [
12
+ '', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y',
13
+ ].each_with_index.map { |n, i| Prefix.new(n.freeze, 1024, 1024 ** i, false) }.freeze
14
+
15
+ PREFIX_F = [
16
+ '', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y',
17
+ ].each_with_index.map { |n, i| Prefix.new(n.freeze, 1000, 1000 ** -i, true) }.freeze
18
+
19
+ module_function
20
+
21
+ def prefixes(identifier)
22
+ case identifier
23
+ when :uppercase, :uc, 1024
24
+ PREFIX_UC
25
+ when :lowercase, :lc, 1000
26
+ PREFIX_LC
27
+ when :fraction, :f, 0.001
28
+ PREFIX_F
29
+ when Array
30
+ identifier
31
+ end
32
+ end
33
+
34
+ def format(value, format: '%f %U', prefix: 1024, unit: ?b)
35
+ prefixes = prefixes(prefix)
36
+ first_prefix = prefixes.first or
37
+ raise ArgumentError, 'a non-empty of prefixes is required'
38
+ prefix = prefixes[
39
+ (first_prefix.fraction ? -1 : 1) * Math.log(value) / Math.log(first_prefix.step)
40
+ ]
41
+ result = format.sub('%U', "#{prefix.name}#{unit}")
42
+ result %= (value / prefix.multiplier.to_f)
43
+ end
44
+
45
+ class UnitParser < StringScanner
46
+ NUMBER = /([+-]?
47
+ (?:0|[1-9]\d*)
48
+ (?:
49
+ \.\d+(?i:e[+-]?\d+) |
50
+ \.\d+ |
51
+ (?i:e[+-]?\d+)
52
+ )?
53
+ )/x
54
+
55
+ def initialize(source, unit, prefixes = nil)
56
+ super source
57
+ if prefixes
58
+ @unit_re = unit_re(Tins::Unit.prefixes(prefixes), unit)
59
+ else
60
+ @unit_lc_re = unit_re(Tins::Unit.prefixes(:lc), unit)
61
+ @unit_uc_re = unit_re(Tins::Unit.prefixes(:uc), unit)
62
+ end
63
+ @number = 1.0
64
+ end
65
+
66
+ def unit_re(prefixes, unit)
67
+ re = Regexp.new(
68
+ "(#{prefixes.reverse.map { |pre| Regexp.quote(pre.name) } * ?|})(#{unit})"
69
+ )
70
+ re.singleton_class.class_eval do
71
+ define_method(:prefixes) { prefixes }
72
+ end
73
+ re
74
+ end
75
+
76
+ private :unit_re
77
+
78
+ attr_reader :number
79
+
80
+ def scan(re)
81
+ re.nil? and return
82
+ super
83
+ end
84
+
85
+ def scan_number
86
+ scan(NUMBER) or return
87
+ @number *= BigDecimal(self[1])
88
+ end
89
+
90
+ def scan_unit
91
+ case
92
+ when unit = scan(@unit_re)
93
+ prefix = @unit_re.prefixes.find { |pre| pre.name == self[1] } or return
94
+ @number *= prefix.multiplier
95
+ when unit = scan(@unit_lc_re)
96
+ prefix = @unit_lc_re.prefixes.find { |pre| pre.name == self[1] } or return
97
+ @number *= prefix.multiplier
98
+ when unit = scan(@unit_uc_re)
99
+ prefix = @unit_uc_re.prefixes.find { |pre| pre.name == self[1] } or return
100
+ @number *= prefix.multiplier
101
+ else
102
+ return
103
+ end
104
+ end
105
+
106
+ def scan_char(char)
107
+ scan(/#{char}/) or return
108
+ end
109
+
110
+ def parse
111
+ raise NotImplementedError
112
+ end
113
+ end
114
+
115
+ class FormatParser < StringScanner
116
+ def initialize(format, unit_parser)
117
+ super format
118
+ @unit_parser = unit_parser
119
+ end
120
+
121
+ def reset
122
+ super
123
+ @unit_parser.reset
124
+ end
125
+
126
+ def location
127
+ @unit_parser.peek(10).inspect
128
+ end
129
+
130
+ private :location
131
+
132
+ def parse
133
+ reset
134
+ until eos? || @unit_parser.eos?
135
+ case
136
+ when scan(/%f/)
137
+ @unit_parser.scan_number or
138
+ raise ArgumentError, "\"%f\" expected at #{location}"
139
+ when scan(/%U/)
140
+ @unit_parser.scan_unit or
141
+ raise ArgumentError, "\"%U\" expected at #{location}"
142
+ when scan(/%%/)
143
+ @unit_parser.scan_char(?%) or
144
+ raise ArgumentError, "#{?%.inspect} expected at #{location}"
145
+ else
146
+ char = scan(/./)
147
+ @unit_parser.scan_char(char) or
148
+ raise ArgumentError, "#{char.inspect} expected at #{location}"
149
+ end
150
+ end
151
+ unless eos? && @unit_parser.eos?
152
+ raise ArgumentError,
153
+ "format #{string.inspect} and string "\
154
+ "#{@unit_parser.string.inspect} do not match"
155
+ end
156
+ @unit_parser.number
157
+ end
158
+ end
159
+
160
+ def parse(string, format: '%f %U', unit: ?b, prefix: nil)
161
+ prefixes = prefixes(prefix)
162
+ FormatParser.new(format, UnitParser.new(string, unit, prefixes)).parse
163
+ end
164
+ end
@@ -1,6 +1,6 @@
1
1
  module Tins
2
2
  # Tins version
3
- VERSION = '1.10.2'
3
+ VERSION = '1.11.0'
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,4 +8,8 @@ if ENV['CODECLIMATE_REPO_TOKEN']
8
8
  require "codeclimate-test-reporter"
9
9
  CodeClimate::TestReporter.start
10
10
  end
11
+ begin
12
+ require 'byebug'
13
+ rescue LoadError
14
+ end
11
15
  require 'test/unit'
@@ -0,0 +1,52 @@
1
+ require 'test_helper'
2
+ require 'tins'
3
+
4
+ module Tins
5
+ class UnitTest < Test::Unit::TestCase
6
+ include Tins::Unit
7
+
8
+ def test_prefixes
9
+ assert_equal %i[ foo ], prefixes(%i[ foo ])
10
+ assert_equal Tins::Unit::PREFIX_LC, prefixes(1000)
11
+ assert_equal Tins::Unit::PREFIX_LC, prefixes(:lc)
12
+ assert_equal Tins::Unit::PREFIX_LC, prefixes(:lowercase)
13
+ assert_equal Tins::Unit::PREFIX_UC, prefixes(1024)
14
+ assert_equal Tins::Unit::PREFIX_UC, prefixes(:uc)
15
+ assert_equal Tins::Unit::PREFIX_UC, prefixes(:uppercase)
16
+ assert_equal Tins::Unit::PREFIX_F, prefixes(0.001)
17
+ assert_equal Tins::Unit::PREFIX_F, prefixes(:f)
18
+ assert_equal Tins::Unit::PREFIX_F, prefixes(:fraction)
19
+ assert_equal nil, prefixes(:nix)
20
+ end
21
+
22
+ def test_format_multipliers
23
+ assert_equal '23 Kb',
24
+ format(23 * 1024, format: '%d %U')
25
+ assert_equal '23.1 Kb',
26
+ format(23 * 1024 + 111, format: '%.1f %U')
27
+ assert_equal 'Kbps: 23',
28
+ format(23 * 1024, format: '%U: %d', unit: 'bps')
29
+ assert_equal 'kbps: 23.12',
30
+ format(23 * 1000 + 120, prefix: 1000, format: '%U: %.2f', unit: 'bps')
31
+ end
32
+
33
+ def test_format_fractions
34
+ assert_equal '0.123 mS',
35
+ format(0.000_123, format: '%.3f %U', prefix: 0.001, unit: ?S)
36
+ assert_equal '0.123 µF',
37
+ format(0.000_000_123, format: '%.3f %U', prefix: :f, unit: ?F)
38
+ end
39
+
40
+ def test_parse
41
+ assert_in_delta 17_301_504, parse('16.5 Mb').to_i, 1e-5
42
+ assert_in_delta 16_500_000, parse('16.5 mbps', unit: 'bps').to_i, 1e-5
43
+ assert_in_delta 0.1234e-5, parse('1.234 µS', unit: ?S, prefix: :f).to_s, 1e-5
44
+ assert_raise(ArgumentError) { parse('16.5 nix', unit: ?b) }
45
+ assert_raise(ArgumentError) { parse('nix Mb') }
46
+ assert_in_delta 17_301_504, parse('16.5 % Mb', format: '%f %% %U').to_i, 1e-5
47
+ assert_raise(ArgumentError) { parse('16.5 Mb', format: '%f %% %U') }
48
+ assert_raise(ArgumentError) { parse('16.5 Mb foo', format: '%f %U') }
49
+ assert_raise(ArgumentError) { parse('16.5 Mb', format: '%f %U foo') }
50
+ end
51
+ end
52
+ end
@@ -1,25 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.10.2 ruby lib
2
+ # stub: tins 1.11.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins"
6
- s.version = "1.10.2"
6
+ s.version = "1.11.0"
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 = "2016-05-25"
11
+ s.date = "2016-07-12"
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
- 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/complete.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/duration.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/secure_write.rb", "lib/tins/sexy_singleton.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/complete.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/secure_write.rb", "lib/tins/xt/sexy_singleton.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/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"]
15
- s.files = [".gitignore", ".travis.yml", "COPYING", "Gemfile", "README.md", "Rakefile", "TODO", "VERSION", "examples/add_one.png", "examples/add_one.stm", "examples/bb3.png", "examples/bb3.stm", "examples/concatenate_compare.mtm", "examples/concatenate_compare.png", "examples/length_difference.mtm", "examples/length_difference.png", "examples/let.rb", "examples/mail.rb", "examples/minsky.rb", "examples/multiply.reg", "examples/null_pattern.rb", "examples/ones_difference-mtm.png", "examples/ones_difference-stm.png", "examples/ones_difference.mtm", "examples/ones_difference.stm", "examples/prefix-equals-suffix-reversed-with-infix.png", "examples/prefix-equals-suffix-reversed-with-infix.stm", "examples/recipe.rb", "examples/recipe2.rb", "examples/recipe_common.rb", "examples/subtract.reg", "examples/turing-graph.rb", "examples/turing.rb", "lib/dslkit.rb", "lib/dslkit/polite.rb", "lib/dslkit/rude.rb", "lib/spruz", "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/complete.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/duration.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/secure_write.rb", "lib/tins/sexy_singleton.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/complete.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/secure_write.rb", "lib/tins/xt/sexy_singleton.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/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", "tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/test_helper.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb", "tins.gemspec"]
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/complete.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/duration.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/secure_write.rb", "lib/tins/sexy_singleton.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/unit.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/complete.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/secure_write.rb", "lib/tins/xt/sexy_singleton.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/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"]
15
+ s.files = [".gitignore", ".travis.yml", "COPYING", "Gemfile", "README.md", "Rakefile", "TODO", "VERSION", "examples/add_one.png", "examples/add_one.stm", "examples/bb3.png", "examples/bb3.stm", "examples/concatenate_compare.mtm", "examples/concatenate_compare.png", "examples/length_difference.mtm", "examples/length_difference.png", "examples/let.rb", "examples/mail.rb", "examples/minsky.rb", "examples/multiply.reg", "examples/null_pattern.rb", "examples/ones_difference-mtm.png", "examples/ones_difference-stm.png", "examples/ones_difference.mtm", "examples/ones_difference.stm", "examples/prefix-equals-suffix-reversed-with-infix.png", "examples/prefix-equals-suffix-reversed-with-infix.stm", "examples/recipe.rb", "examples/recipe2.rb", "examples/recipe_common.rb", "examples/subtract.reg", "examples/turing-graph.rb", "examples/turing.rb", "lib/dslkit.rb", "lib/dslkit/polite.rb", "lib/dslkit/rude.rb", "lib/spruz", "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/complete.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/duration.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/secure_write.rb", "lib/tins/sexy_singleton.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/unit.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/complete.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/secure_write.rb", "lib/tins/xt/sexy_singleton.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/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", "tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/test_helper.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb", "tests/unit_test.rb", "tins.gemspec"]
16
16
  s.homepage = "https://github.com/flori/tins"
17
17
  s.licenses = ["MIT"]
18
18
  s.rdoc_options = ["--title", "Tins - Useful stuff.", "--main", "README.md"]
19
19
  s.required_ruby_version = Gem::Requirement.new(">= 2.0")
20
20
  s.rubygems_version = "2.5.1"
21
21
  s.summary = "Useful stuff."
22
- s.test_files = ["tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/test_helper.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb", "tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb"]
22
+ s.test_files = ["tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/test_helper.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb", "tests/unit_test.rb", "tests/annotate_test.rb", "tests/ask_and_send_test.rb", "tests/attempt_test.rb", "tests/bijection_test.rb", "tests/blank_full_test.rb", "tests/case_predicate_test.rb", "tests/concern_test.rb", "tests/count_by_test.rb", "tests/date_dummy_test.rb", "tests/date_time_dummy_test.rb", "tests/deep_const_get_test.rb", "tests/deep_dup_test.rb", "tests/delegate_test.rb", "tests/dslkit_test.rb", "tests/duaration_test.rb", "tests/dynamic_scope_test.rb", "tests/extract_last_argument_options_test.rb", "tests/file_binary_test.rb", "tests/find_test.rb", "tests/from_module_test.rb", "tests/generator_test.rb", "tests/go_test.rb", "tests/hash_symbolize_keys_recursive_test.rb", "tests/hash_union_test.rb", "tests/if_predicate_test.rb", "tests/implement_test.rb", "tests/limited_test.rb", "tests/lines_file_test.rb", "tests/memoize_test.rb", "tests/method_description_test.rb", "tests/minimize_test.rb", "tests/module_group_test.rb", "tests/named_set_test.rb", "tests/named_test.rb", "tests/null_test.rb", "tests/p_test.rb", "tests/partial_application_test.rb", "tests/proc_compose_test.rb", "tests/proc_prelude_test.rb", "tests/range_plus_test.rb", "tests/require_maybe_test.rb", "tests/responding_test.rb", "tests/rotate_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/string_byte_order_mark_test.rb", "tests/string_camelize_test.rb", "tests/string_underscore_test.rb", "tests/string_version_test.rb", "tests/subhash_test.rb", "tests/time_dummy_test.rb", "tests/time_freezer_test.rb", "tests/to_test.rb", "tests/token_test.rb", "tests/uniq_by_test.rb", "tests/unit_test.rb"]
23
23
 
24
24
  if s.respond_to? :specification_version then
25
25
  s.specification_version = 4
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.10.2
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-25 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -103,6 +103,7 @@ extra_rdoc_files:
103
103
  - lib/tins/to_proc.rb
104
104
  - lib/tins/token.rb
105
105
  - lib/tins/uniq_by.rb
106
+ - lib/tins/unit.rb
106
107
  - lib/tins/version.rb
107
108
  - lib/tins/write.rb
108
109
  - lib/tins/xt.rb
@@ -243,6 +244,7 @@ files:
243
244
  - lib/tins/to_proc.rb
244
245
  - lib/tins/token.rb
245
246
  - lib/tins/uniq_by.rb
247
+ - lib/tins/unit.rb
246
248
  - lib/tins/version.rb
247
249
  - lib/tins/write.rb
248
250
  - lib/tins/xt.rb
@@ -347,6 +349,7 @@ files:
347
349
  - tests/to_test.rb
348
350
  - tests/token_test.rb
349
351
  - tests/uniq_by_test.rb
352
+ - tests/unit_test.rb
350
353
  - tins.gemspec
351
354
  homepage: https://github.com/flori/tins
352
355
  licenses:
@@ -434,3 +437,4 @@ test_files:
434
437
  - tests/to_test.rb
435
438
  - tests/token_test.rb
436
439
  - tests/uniq_by_test.rb
440
+ - tests/unit_test.rb