extpp 0.0.9 → 0.1.0

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/LICENSE.txt +1 -1
  3. data/README.md +2 -2
  4. data/Rakefile +1 -28
  5. data/doc/text/news.md +6 -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/setup.rb +0 -4
  12. data/lib/extpp/version.rb +1 -1
  13. data/lib/extpp.rb +0 -12
  14. metadata +6 -73
  15. data/ext/extpp/class.cpp +0 -277
  16. data/ext/extpp/extconf.rb +0 -110
  17. data/ext/extpp/function.cpp +0 -28
  18. data/ext/extpp/object.cpp +0 -48
  19. data/ext/extpp/protect.cpp +0 -12
  20. data/lib/extpp/platform.rb +0 -8
  21. data/test/fixtures/cast/Makefile +0 -269
  22. data/test/fixtures/cast/cast.cpp +0 -39
  23. data/test/fixtures/cast/cast.o +0 -0
  24. data/test/fixtures/cast/cast.so +0 -0
  25. data/test/fixtures/cast/extconf.rb +0 -4
  26. data/test/fixtures/cast/mkmf.log +0 -144
  27. data/test/fixtures/class/Makefile +0 -269
  28. data/test/fixtures/class/class.cpp +0 -46
  29. data/test/fixtures/class/class.o +0 -0
  30. data/test/fixtures/class/class.so +0 -0
  31. data/test/fixtures/class/extconf.rb +0 -4
  32. data/test/fixtures/class/mkmf.log +0 -144
  33. data/test/fixtures/object/Makefile +0 -269
  34. data/test/fixtures/object/extconf.rb +0 -4
  35. data/test/fixtures/object/mkmf.log +0 -144
  36. data/test/fixtures/object/object.cpp +0 -102
  37. data/test/fixtures/object/object.o +0 -0
  38. data/test/fixtures/object/object.so +0 -0
  39. data/test/fixtures/protect/Makefile +0 -269
  40. data/test/fixtures/protect/extconf.rb +0 -4
  41. data/test/fixtures/protect/mkmf.log +0 -144
  42. data/test/fixtures/protect/protect.cpp +0 -70
  43. data/test/fixtures/protect/protect.o +0 -0
  44. data/test/fixtures/protect/protect.so +0 -0
  45. data/test/helper.rb +0 -11
  46. data/test/run-test.rb +0 -31
  47. data/test/test-cast.rb +0 -46
  48. data/test/test-class.rb +0 -47
  49. data/test/test-object.rb +0 -68
  50. 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