tins 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
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/tests/test_helper.rb CHANGED
@@ -4,4 +4,8 @@ if ENV['START_SIMPLECOV'].to_i == 1
4
4
  add_filter "#{File.basename(File.dirname(__FILE__))}/"
5
5
  end
6
6
  end
7
+ if ENV['CODECLIMATE_REPO_TOKEN']
8
+ require "codeclimate-test-reporter"
9
+ CodeClimate::TestReporter.start
10
+ end
7
11
  require 'test/unit'
data/tins.gemspec CHANGED
@@ -1,24 +1,24 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.3.0 ruby lib
2
+ # stub: tins 1.3.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins"
6
- s.version = "1.3.0"
6
+ s.version = "1.3.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"]
10
10
  s.authors = ["Florian Frank"]
11
- s.date = "2014-05-13"
11
+ s.date = "2014-08-13"
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.rdoc", "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/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/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/round.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/time_freezer.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/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/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/round.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/to.rb", "lib/tins/xt/uniq_by.rb", "lib/tins/xt/write.rb"]
15
- s.files = [".gitignore", ".travis.yml", "COPYING", "Gemfile", "README.rdoc", "Rakefile", "TODO", "VERSION", "examples/add_one.png", "examples/add_one.stm", "examples/bb3.png", "examples/bb3.stm", "examples/bb3_19.stm", "examples/concatenate_compare.mtm", "examples/concatenate_compare.png", "examples/concatenate_compare_19.mtm", "examples/length_difference.mtm", "examples/length_difference.png", "examples/length_difference_19.mtm", "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/ones_difference_19.mtm", "examples/ones_difference_19.stm", "examples/prefix-equals-suffix-reversed-with-infix.png", "examples/prefix-equals-suffix-reversed-with-infix.stm", "examples/prefix-equals-suffix-reversed-with-infix_19.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/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/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/round.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/time_freezer.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/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/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/round.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/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/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/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/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/round_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/shuffle_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/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/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/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"]
15
+ s.files = [".gitignore", ".travis.yml", "COPYING", "Gemfile", "README.md", "README.rdoc", "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/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/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/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", "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/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/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/shuffle_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"]
16
16
  s.homepage = "http://flori.github.com/tins"
17
17
  s.licenses = ["MIT"]
18
- s.rdoc_options = ["--title", "Tins - Useful stuff.", "--main", "README.rdoc"]
18
+ s.rdoc_options = ["--title", "Tins - Useful stuff.", "--main", "README.md"]
19
19
  s.rubygems_version = "2.2.2"
20
20
  s.summary = "Useful stuff."
21
- 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/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/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/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/round_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/shuffle_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/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/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/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/round_test.rb", "tests/scope_test.rb", "tests/secure_write_test.rb", "tests/sexy_singleton_test.rb", "tests/shuffle_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"]
21
+ 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/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/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/shuffle_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/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/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/shuffle_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
22
 
23
23
  if s.respond_to? :specification_version then
24
24
  s.specification_version = 4
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.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: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.0.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.5'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.5'
41
41
  description: All the stuff that isn't good/big enough for a real library.
@@ -43,7 +43,7 @@ email: flori@ping.de
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files:
46
- - README.rdoc
46
+ - README.md
47
47
  - lib/dslkit.rb
48
48
  - lib/dslkit/polite.rb
49
49
  - lib/dslkit/rude.rb
@@ -54,6 +54,7 @@ extra_rdoc_files:
54
54
  - lib/tins/ask_and_send.rb
55
55
  - lib/tins/attempt.rb
56
56
  - lib/tins/bijection.rb
57
+ - lib/tins/case_predicate.rb
57
58
  - lib/tins/concern.rb
58
59
  - lib/tins/count_by.rb
59
60
  - lib/tins/date_dummy.rb
@@ -86,7 +87,6 @@ extra_rdoc_files:
86
87
  - lib/tins/require_maybe.rb
87
88
  - lib/tins/responding.rb
88
89
  - lib/tins/rotate.rb
89
- - lib/tins/round.rb
90
90
  - lib/tins/secure_write.rb
91
91
  - lib/tins/sexy_singleton.rb
92
92
  - lib/tins/shuffle.rb
@@ -98,7 +98,6 @@ extra_rdoc_files:
98
98
  - lib/tins/terminal.rb
99
99
  - lib/tins/thread_local.rb
100
100
  - lib/tins/time_dummy.rb
101
- - lib/tins/time_freezer.rb
102
101
  - lib/tins/to.rb
103
102
  - lib/tins/to_proc.rb
104
103
  - lib/tins/token.rb
@@ -110,6 +109,7 @@ extra_rdoc_files:
110
109
  - lib/tins/xt/ask_and_send.rb
111
110
  - lib/tins/xt/attempt.rb
112
111
  - lib/tins/xt/blank.rb
112
+ - lib/tins/xt/case_predicate.rb
113
113
  - lib/tins/xt/concern.rb
114
114
  - lib/tins/xt/count_by.rb
115
115
  - lib/tins/xt/date_dummy.rb
@@ -135,7 +135,6 @@ extra_rdoc_files:
135
135
  - lib/tins/xt/require_maybe.rb
136
136
  - lib/tins/xt/responding.rb
137
137
  - lib/tins/xt/rotate.rb
138
- - lib/tins/xt/round.rb
139
138
  - lib/tins/xt/secure_write.rb
140
139
  - lib/tins/xt/sexy_singleton.rb
141
140
  - lib/tins/xt/shuffle.rb
@@ -147,14 +146,16 @@ extra_rdoc_files:
147
146
  - lib/tins/xt/subhash.rb
148
147
  - lib/tins/xt/symbol_to_proc.rb
149
148
  - lib/tins/xt/time_dummy.rb
149
+ - lib/tins/xt/time_freezer.rb
150
150
  - lib/tins/xt/to.rb
151
151
  - lib/tins/xt/uniq_by.rb
152
152
  - lib/tins/xt/write.rb
153
153
  files:
154
- - ".gitignore"
155
- - ".travis.yml"
154
+ - .gitignore
155
+ - .travis.yml
156
156
  - COPYING
157
157
  - Gemfile
158
+ - README.md
158
159
  - README.rdoc
159
160
  - Rakefile
160
161
  - TODO
@@ -163,13 +164,10 @@ files:
163
164
  - examples/add_one.stm
164
165
  - examples/bb3.png
165
166
  - examples/bb3.stm
166
- - examples/bb3_19.stm
167
167
  - examples/concatenate_compare.mtm
168
168
  - examples/concatenate_compare.png
169
- - examples/concatenate_compare_19.mtm
170
169
  - examples/length_difference.mtm
171
170
  - examples/length_difference.png
172
- - examples/length_difference_19.mtm
173
171
  - examples/let.rb
174
172
  - examples/mail.rb
175
173
  - examples/minsky.rb
@@ -179,11 +177,8 @@ files:
179
177
  - examples/ones_difference-stm.png
180
178
  - examples/ones_difference.mtm
181
179
  - examples/ones_difference.stm
182
- - examples/ones_difference_19.mtm
183
- - examples/ones_difference_19.stm
184
180
  - examples/prefix-equals-suffix-reversed-with-infix.png
185
181
  - examples/prefix-equals-suffix-reversed-with-infix.stm
186
- - examples/prefix-equals-suffix-reversed-with-infix_19.stm
187
182
  - examples/recipe.rb
188
183
  - examples/recipe2.rb
189
184
  - examples/recipe_common.rb
@@ -200,6 +195,7 @@ files:
200
195
  - lib/tins/ask_and_send.rb
201
196
  - lib/tins/attempt.rb
202
197
  - lib/tins/bijection.rb
198
+ - lib/tins/case_predicate.rb
203
199
  - lib/tins/concern.rb
204
200
  - lib/tins/count_by.rb
205
201
  - lib/tins/date_dummy.rb
@@ -232,7 +228,6 @@ files:
232
228
  - lib/tins/require_maybe.rb
233
229
  - lib/tins/responding.rb
234
230
  - lib/tins/rotate.rb
235
- - lib/tins/round.rb
236
231
  - lib/tins/secure_write.rb
237
232
  - lib/tins/sexy_singleton.rb
238
233
  - lib/tins/shuffle.rb
@@ -244,7 +239,6 @@ files:
244
239
  - lib/tins/terminal.rb
245
240
  - lib/tins/thread_local.rb
246
241
  - lib/tins/time_dummy.rb
247
- - lib/tins/time_freezer.rb
248
242
  - lib/tins/to.rb
249
243
  - lib/tins/to_proc.rb
250
244
  - lib/tins/token.rb
@@ -256,6 +250,7 @@ files:
256
250
  - lib/tins/xt/ask_and_send.rb
257
251
  - lib/tins/xt/attempt.rb
258
252
  - lib/tins/xt/blank.rb
253
+ - lib/tins/xt/case_predicate.rb
259
254
  - lib/tins/xt/concern.rb
260
255
  - lib/tins/xt/count_by.rb
261
256
  - lib/tins/xt/date_dummy.rb
@@ -281,7 +276,6 @@ files:
281
276
  - lib/tins/xt/require_maybe.rb
282
277
  - lib/tins/xt/responding.rb
283
278
  - lib/tins/xt/rotate.rb
284
- - lib/tins/xt/round.rb
285
279
  - lib/tins/xt/secure_write.rb
286
280
  - lib/tins/xt/sexy_singleton.rb
287
281
  - lib/tins/xt/shuffle.rb
@@ -293,6 +287,7 @@ files:
293
287
  - lib/tins/xt/subhash.rb
294
288
  - lib/tins/xt/symbol_to_proc.rb
295
289
  - lib/tins/xt/time_dummy.rb
290
+ - lib/tins/xt/time_freezer.rb
296
291
  - lib/tins/xt/to.rb
297
292
  - lib/tins/xt/uniq_by.rb
298
293
  - lib/tins/xt/write.rb
@@ -301,6 +296,7 @@ files:
301
296
  - tests/attempt_test.rb
302
297
  - tests/bijection_test.rb
303
298
  - tests/blank_full_test.rb
299
+ - tests/case_predicate_test.rb
304
300
  - tests/concern_test.rb
305
301
  - tests/count_by_test.rb
306
302
  - tests/date_dummy_test.rb
@@ -336,7 +332,6 @@ files:
336
332
  - tests/require_maybe_test.rb
337
333
  - tests/responding_test.rb
338
334
  - tests/rotate_test.rb
339
- - tests/round_test.rb
340
335
  - tests/scope_test.rb
341
336
  - tests/secure_write_test.rb
342
337
  - tests/sexy_singleton_test.rb
@@ -359,20 +354,20 @@ licenses:
359
354
  metadata: {}
360
355
  post_install_message:
361
356
  rdoc_options:
362
- - "--title"
357
+ - --title
363
358
  - Tins - Useful stuff.
364
- - "--main"
365
- - README.rdoc
359
+ - --main
360
+ - README.md
366
361
  require_paths:
367
362
  - lib
368
363
  required_ruby_version: !ruby/object:Gem::Requirement
369
364
  requirements:
370
- - - ">="
365
+ - - '>='
371
366
  - !ruby/object:Gem::Version
372
367
  version: '0'
373
368
  required_rubygems_version: !ruby/object:Gem::Requirement
374
369
  requirements:
375
- - - ">="
370
+ - - '>='
376
371
  - !ruby/object:Gem::Version
377
372
  version: '0'
378
373
  requirements: []
@@ -387,6 +382,7 @@ test_files:
387
382
  - tests/attempt_test.rb
388
383
  - tests/bijection_test.rb
389
384
  - tests/blank_full_test.rb
385
+ - tests/case_predicate_test.rb
390
386
  - tests/concern_test.rb
391
387
  - tests/count_by_test.rb
392
388
  - tests/date_dummy_test.rb
@@ -422,7 +418,6 @@ test_files:
422
418
  - tests/require_maybe_test.rb
423
419
  - tests/responding_test.rb
424
420
  - tests/rotate_test.rb
425
- - tests/round_test.rb
426
421
  - tests/scope_test.rb
427
422
  - tests/secure_write_test.rb
428
423
  - tests/sexy_singleton_test.rb
data/examples/bb3_19.stm DELETED
@@ -1,26 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with an empty tape
3
- # $ turing.rb bb3.stm ''
4
-
5
- # Busy Beaver: 3-state, 2-symbol
6
-
7
- # state A
8
- 1. cond if: 'B', then: 2, else: 4
9
- 2. write symbol: '1', goto: 3
10
- 3. right goto: 6
11
- 4. write symbol: '1', goto: 5
12
- 5. right goto: 16
13
- # state B
14
- 6. cond if: 'B', then: 7, else: 9
15
- 7. write symbol: 'B', goto: 8
16
- 8. right goto: 11
17
- 9. write symbol: '1', goto: 10
18
- 10. right goto: 6
19
- # state C
20
- 11. cond if: 'B', then: 12, else: 14
21
- 12. write symbol: '1', goto: 13
22
- 13. left goto: 11
23
- 14. write symbol: '1', goto: 15
24
- 15. left goto: 1
25
- # halt
26
- 16. halt
@@ -1,31 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with four binary numbers on the tape:
3
- # $ turing.rb concatenate_compare.mtm 110 1 11 01
4
-
5
- 1. right 1, goto: 2
6
- 2. cond 1, if: 'B', then: 3, else: 1
7
- 3. right 2, goto: 4
8
- 4. cond 2, if: '0', then: 7, else: 5
9
- 5. cond 2, if: '1', then: 6, else: 9
10
- 6. write 1, symbol: '1', goto: 8
11
- 7. write 1, symbol: '0', goto: 8
12
- 8. right 1, goto: 3
13
- 9. right 3, goto: 10
14
- 10. cond 3, if: 'B', then: 11, else: 9
15
- 11. right 4, goto: 12
16
- 12. cond 4, if: '0', then: 14, else: 13
17
- 13. cond 4, if: '1', then: 15, else: 17
18
- 14. write 3, symbol: '0', goto: 16
19
- 15. write 3, symbol: '1', goto: 16
20
- 16. right 3, goto: 11
21
- 17. left 3, goto: 18
22
- 18. left 1, goto: 19
23
- 19. cond 3, if: '0', then: 20, else: 22
24
- 20. cond 1, if: '0', then: 17, else: 24
25
- 21. cond 1, if: '1', then: 17, else: 24
26
- 22. cond 3, if: '1', then: 21, else: 23
27
- 23. cond 1, if: 'B', then: 25, else: 24
28
- 24. write 0, symbol: '0', goto: 26
29
- 25. write 0, symbol: '1', goto: 26
30
- 26. right 0, goto: 27
31
- 27. halt
@@ -1,17 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with two [ab]* strings on the tapes:
3
- # $ turing.rb prefix-equals-suffix-reversed-with-infix.stm ab ababab
4
-
5
- 1. right 1, goto: 2
6
- 2. right 2, goto: 3
7
- 3. cond 1, if: 'B', then: 5, else: 4
8
- 4. cond 2, if: 'B', then: 9, else: 1
9
- 5. cond 2, if: 'B', then: 13, else: 6
10
- 6. write 0, symbol: 'b', goto: 7
11
- 7. right 0, goto: 8
12
- 8. right 2, goto: 5
13
- 9. write 0, symbol: 'a', goto: 10
14
- 10. right 0, goto: 11
15
- 11. right 1, goto: 12
16
- 12. cond 1, if: 'B', then: 13, else: 9
17
- 13. halt
@@ -1,12 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with two strings of ones on the tape:
3
- # $ turing.rb ones_difference.mtm 1111 11
4
-
5
- 0. right 1, goto: 1
6
- 1. right 2, goto: 2
7
- 2. cond 1, if: '1', then: 3, else: 4
8
- 3. cond 2, if: '1', then: 0, else: 5
9
- 4. cond 2, if: '1', then: 5, else: 7
10
- 5. write 0, symbol: '1', goto: 6
11
- 6. left 0, goto: 0
12
- 7. halt
@@ -1,25 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with two strings of ones on the tape:
3
- # $ turing.rb ones_difference.stm 1111 11
4
-
5
- 1. right goto: 2
6
- 2. cond if: '1', then: 1, else: 3
7
- 3. right goto: 4
8
- 4. cond if: '1', then: 5, else: 17
9
- 5. right goto: 6
10
- 6. cond if: '1', then: 5, else: 7
11
- 7. left goto: 8
12
- 8. write symbol: 'B', goto: 9
13
- 9. left goto: 10
14
- 10. cond if: '1', then: 9, else: 11
15
- 11. left goto: 12
16
- 12. cond if: '1', then: 11, else: 13
17
- 13. right goto: 14
18
- 14. cond if: '1', then: 15, else: 16
19
- 15. write symbol: 'B', goto: 1
20
- 16. write symbol: '1', goto: 18
21
- 17. left goto: 20
22
- 18. right goto: 19
23
- 19. cond if: '1', then: 18, else: 21
24
- 20. halt
25
- 21. halt
@@ -1,38 +0,0 @@
1
- # vim: ts=2 sw=2 et ft=ruby
2
- # Call with a binary number on the tape:
3
- # $ turing.rb prefix-equals-suffix-reversed-with-infix.stm 100101001
4
-
5
- 0. right goto: 1
6
- 1. cond if: '0', then: 2, else: 13
7
- 2. write symbol: 'O', goto: 3
8
- 3. right goto: 4
9
- 4. cond if: 'B', then: 21, else: 5
10
- 5. right goto: 6
11
- 6. cond if: 'B', then: 7, else: 5
12
- 7. left goto: 8
13
- 8. cond if: '0', then: 9, else: 21
14
- 9. write symbol: 'B', goto: 10
15
- 10. left goto: 11
16
- 11. cond if: '0', then: 10, else: 12
17
- 12. cond if: '1', then: 10, else: 0
18
- 13. cond if: '1', then: 14, else: 31
19
- 14. write symbol: 'I', goto: 15
20
- 15. right goto: 16
21
- 16. cond if: 'B', then: 21, else: 17
22
- 17. right goto: 18
23
- 18. cond if: 'B', then: 19, else: 17
24
- 19. left goto: 20
25
- 20. cond if: '1', then: 9, else: 21
26
- 21. write symbol: 'B', goto: 22
27
- 22. left goto: 23
28
- 23. cond if: '0', then: 21, else: 24
29
- 24. cond if: '1', then: 21, else: 25
30
- 25. write symbol: 'B', goto: 26
31
- 26. left goto: 27
32
- 27. cond if: 'O', then: 29, else: 28
33
- 28. cond if: 'I', then: 30, else: 32
34
- 29. write symbol: '0', goto: 26
35
- 30. write symbol: '1', goto: 26
36
- 31. halt
37
- 32. right goto: 33
38
- 33. cond if: 'B', then: 31, else: 32
data/lib/tins/round.rb DELETED
@@ -1,51 +0,0 @@
1
- module Tins
2
- # A bit more versatile rounding for Ruby
3
- module Round
4
- def self.included(klass)
5
- if klass.instance_method(:round)
6
- klass.class_eval do
7
- begin
8
- alias_method :__old_round__, :round
9
- remove_method :round
10
- rescue NameError
11
- end
12
- end
13
- super
14
- else
15
- raise NoMethodError, 'no round method found'
16
- end
17
- end
18
-
19
- def round(places = nil)
20
- if places == nil || places == 0
21
- return __old_round__
22
- elsif places.respond_to?(:to_int)
23
- places = places.to_int
24
- else
25
- raise TypeError, "argument places has to be like an Integer"
26
- end
27
- if places < 0
28
- max_places = -Math.log(self.abs + 1) / Math.log(10)
29
- raise ArgumentError, "places has to be >= #{max_places.ceil}" if max_places > places
30
- end
31
- t = self
32
- f = 10.0 ** places
33
- t *= f
34
- if t.infinite?
35
- result = self
36
- else
37
- if t >= 0.0
38
- t = (t + 0.5).floor
39
- elsif t < 0.0
40
- t = (t - 0.5).ceil
41
- end
42
- t /= f
43
- result = t.nan? ? self : t
44
- end
45
- max_places and result = result.to_i # if places < 0
46
- result
47
- end
48
- end
49
- end
50
-
51
- require 'tins/alias'