tins 1.3.0 → 1.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -1
  3. data/Gemfile +2 -0
  4. data/README.md +25 -0
  5. data/Rakefile +1 -1
  6. data/VERSION +1 -1
  7. data/examples/bb3.stm +15 -15
  8. data/examples/concatenate_compare.mtm +26 -26
  9. data/examples/length_difference.mtm +12 -12
  10. data/examples/let.rb +2 -2
  11. data/examples/ones_difference.mtm +7 -7
  12. data/examples/ones_difference.stm +19 -19
  13. data/examples/prefix-equals-suffix-reversed-with-infix.stm +33 -33
  14. data/examples/recipe_common.rb +0 -32
  15. data/lib/tins.rb +1 -2
  16. data/lib/tins/annotate.rb +1 -1
  17. data/lib/tins/ask_and_send.rb +16 -0
  18. data/lib/tins/case_predicate.rb +7 -0
  19. data/lib/tins/dslkit.rb +7 -54
  20. data/lib/tins/file_binary.rb +1 -3
  21. data/lib/tins/method_description.rb +4 -2
  22. data/lib/tins/null.rb +1 -1
  23. data/lib/tins/string_version.rb +1 -3
  24. data/lib/tins/terminal.rb +18 -10
  25. data/lib/tins/thread_local.rb +2 -3
  26. data/lib/tins/token.rb +4 -1
  27. data/lib/tins/version.rb +1 -1
  28. data/lib/tins/xt.rb +2 -1
  29. data/lib/tins/xt/case_predicate.rb +8 -0
  30. data/lib/tins/xt/dslkit.rb +0 -1
  31. data/lib/tins/xt/named.rb +14 -26
  32. data/lib/tins/{time_freezer.rb → xt/time_freezer.rb} +0 -0
  33. data/tests/ask_and_send_test.rb +14 -0
  34. data/tests/attempt_test.rb +0 -6
  35. data/tests/case_predicate_test.rb +29 -0
  36. data/tests/dslkit_test.rb +0 -2
  37. data/tests/if_predicate_test.rb +1 -1
  38. data/tests/method_description_test.rb +15 -2
  39. data/tests/test_helper.rb +4 -0
  40. data/tins.gemspec +7 -7
  41. metadata +23 -28
  42. data/examples/bb3_19.stm +0 -26
  43. data/examples/concatenate_compare_19.mtm +0 -31
  44. data/examples/length_difference_19.mtm +0 -17
  45. data/examples/ones_difference_19.mtm +0 -12
  46. data/examples/ones_difference_19.stm +0 -25
  47. data/examples/prefix-equals-suffix-reversed-with-infix_19.stm +0 -38
  48. data/lib/tins/round.rb +0 -51
  49. data/lib/tins/xt/round.rb +0 -13
  50. data/tests/round_test.rb +0 -32
data/lib/tins/xt/round.rb DELETED
@@ -1,13 +0,0 @@
1
- require 'tins/round'
2
-
3
- module Tins
4
- module Round
5
- class ::Float
6
- include Round
7
- end
8
-
9
- class ::Integer
10
- include Round
11
- end
12
- end
13
- end
data/tests/round_test.rb DELETED
@@ -1,32 +0,0 @@
1
- require 'test_helper'
2
- require 'tins/xt'
3
-
4
- module Tins
5
- class RoundTest < Test::Unit::TestCase
6
-
7
- def test_standard
8
- assert_equal(1, 1.round)
9
- assert_equal(-1, -1.round)
10
- assert_equal(2, 1.5.round)
11
- assert_kind_of Integer, 1.5.round
12
- assert_equal(-1, -1.4.round)
13
- assert_equal(-2, -1.5.round)
14
- end
15
-
16
- def test_inclusion
17
- assert_equal(10, 12.round(-1))
18
- assert_kind_of Integer, 12.round(-1)
19
- assert_equal(-10, -12.round(-1))
20
- assert_raises(ArgumentError) { 12.round(-2) }
21
- assert_raises(ArgumentError) { -12.round(-2) }
22
- assert_in_delta(1.6, 1.55.round(1), 1E-1)
23
- assert_kind_of Float, 1.55.round(1)
24
- assert_equal(2, 1.55.round(0))
25
- assert_in_delta(-1.5, -1.45.round(1), 1E-1)
26
- assert_equal(-1, -1.45.round(0))
27
- assert_in_delta(-1.6, -1.55.round(1), 1E-1)
28
- assert_equal(-2, -1.55.round(0))
29
- assert_in_delta(-1.55, -1.55.round(999), 1E-2)
30
- end
31
- end
32
- end