extpp 0.0.9 → 0.1.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +2 -2
  4. data/Rakefile +1 -28
  5. data/doc/text/news.md +12 -0
  6. data/include/ruby/class.hpp +191 -14
  7. data/{ext/extpp → include/ruby}/function.hpp +20 -7
  8. data/include/ruby/object.hpp +45 -6
  9. data/include/ruby/protect.hpp +9 -2
  10. data/include/ruby.hpp +0 -10
  11. data/lib/extpp/compiler.rb +0 -6
  12. data/lib/extpp/setup.rb +0 -4
  13. data/lib/extpp/version.rb +1 -1
  14. data/lib/extpp.rb +0 -12
  15. metadata +9 -76
  16. data/ext/extpp/class.cpp +0 -277
  17. data/ext/extpp/extconf.rb +0 -110
  18. data/ext/extpp/function.cpp +0 -28
  19. data/ext/extpp/object.cpp +0 -48
  20. data/ext/extpp/protect.cpp +0 -12
  21. data/lib/extpp/platform.rb +0 -8
  22. data/test/fixtures/cast/Makefile +0 -269
  23. data/test/fixtures/cast/cast.cpp +0 -39
  24. data/test/fixtures/cast/cast.o +0 -0
  25. data/test/fixtures/cast/cast.so +0 -0
  26. data/test/fixtures/cast/extconf.rb +0 -4
  27. data/test/fixtures/cast/mkmf.log +0 -144
  28. data/test/fixtures/class/Makefile +0 -269
  29. data/test/fixtures/class/class.cpp +0 -46
  30. data/test/fixtures/class/class.o +0 -0
  31. data/test/fixtures/class/class.so +0 -0
  32. data/test/fixtures/class/extconf.rb +0 -4
  33. data/test/fixtures/class/mkmf.log +0 -144
  34. data/test/fixtures/object/Makefile +0 -269
  35. data/test/fixtures/object/extconf.rb +0 -4
  36. data/test/fixtures/object/mkmf.log +0 -144
  37. data/test/fixtures/object/object.cpp +0 -102
  38. data/test/fixtures/object/object.o +0 -0
  39. data/test/fixtures/object/object.so +0 -0
  40. data/test/fixtures/protect/Makefile +0 -269
  41. data/test/fixtures/protect/extconf.rb +0 -4
  42. data/test/fixtures/protect/mkmf.log +0 -144
  43. data/test/fixtures/protect/protect.cpp +0 -70
  44. data/test/fixtures/protect/protect.o +0 -0
  45. data/test/fixtures/protect/protect.so +0 -0
  46. data/test/helper.rb +0 -11
  47. data/test/run-test.rb +0 -31
  48. data/test/test-cast.rb +0 -46
  49. data/test/test-class.rb +0 -47
  50. data/test/test-object.rb +0 -68
  51. data/test/test-protect.rb +0 -54
data/test/test-protect.rb DELETED
@@ -1,54 +0,0 @@
1
- class ProtectTest < Test::Unit::TestCase
2
- extend Helper::Fixture
3
-
4
- class << self
5
- def startup
6
- return unless self == ProtectTest
7
- lib_dir = File.join(__dir__, "..", "lib")
8
- Dir.chdir(fixture_path("protect")) do
9
- system(RbConfig.ruby, "-w", "-I", lib_dir, "extconf.rb")
10
- system("make")
11
- end
12
- require fixture_path("protect", "protect")
13
- end
14
- end
15
-
16
- class Listener
17
- attr_reader :events
18
- def initialize
19
- @events = []
20
- end
21
-
22
- def notify(event)
23
- @events << event
24
- end
25
- end
26
-
27
- def setup
28
- @protect_methods = ProtectMethods.new
29
- end
30
-
31
- def assert_protect(method_name)
32
- listener = Listener.new
33
- assert_raise(RuntimeError.new("message")) do
34
- @protect_methods.__send__(method_name, listener) do
35
- raise "message"
36
- end
37
- end
38
- assert_equal([
39
- "outer: constructed",
40
- "inner: constructed",
41
- "inner: destructed",
42
- "outer: caught",
43
- ],
44
- listener.events)
45
- end
46
-
47
- def test_raw
48
- assert_protect(:protect_raw)
49
- end
50
-
51
- def test_closure
52
- assert_protect(:protect_closure)
53
- end
54
- end