extpp 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +1 -28
  5. data/doc/text/news.md +43 -0
  6. data/include/ruby/cast.hpp +4 -4
  7. data/include/ruby/class.hpp +190 -13
  8. data/{ext/extpp → include/ruby}/function.hpp +20 -7
  9. data/include/ruby/object.hpp +44 -5
  10. data/include/ruby/protect.hpp +12 -5
  11. data/lib/extpp/compiler.rb +17 -10
  12. data/lib/extpp/setup.rb +0 -0
  13. data/lib/extpp/version.rb +1 -1
  14. data/lib/extpp.rb +0 -12
  15. data/sample/hello/Rakefile +6 -1
  16. metadata +7 -74
  17. data/ext/extpp/class.cpp +0 -277
  18. data/ext/extpp/extconf.rb +0 -110
  19. data/ext/extpp/function.cpp +0 -28
  20. data/ext/extpp/object.cpp +0 -48
  21. data/ext/extpp/protect.cpp +0 -12
  22. data/lib/extpp/platform.rb +0 -14
  23. data/test/fixtures/cast/Makefile +0 -269
  24. data/test/fixtures/cast/cast.cpp +0 -39
  25. data/test/fixtures/cast/cast.o +0 -0
  26. data/test/fixtures/cast/cast.so +0 -0
  27. data/test/fixtures/cast/extconf.rb +0 -4
  28. data/test/fixtures/cast/mkmf.log +0 -140
  29. data/test/fixtures/class/Makefile +0 -269
  30. data/test/fixtures/class/class.cpp +0 -46
  31. data/test/fixtures/class/class.o +0 -0
  32. data/test/fixtures/class/class.so +0 -0
  33. data/test/fixtures/class/extconf.rb +0 -4
  34. data/test/fixtures/class/mkmf.log +0 -140
  35. data/test/fixtures/object/Makefile +0 -269
  36. data/test/fixtures/object/extconf.rb +0 -4
  37. data/test/fixtures/object/mkmf.log +0 -140
  38. data/test/fixtures/object/object.cpp +0 -102
  39. data/test/fixtures/object/object.o +0 -0
  40. data/test/fixtures/object/object.so +0 -0
  41. data/test/fixtures/protect/Makefile +0 -269
  42. data/test/fixtures/protect/extconf.rb +0 -4
  43. data/test/fixtures/protect/mkmf.log +0 -140
  44. data/test/fixtures/protect/protect.cpp +0 -70
  45. data/test/fixtures/protect/protect.o +0 -0
  46. data/test/fixtures/protect/protect.so +0 -0
  47. data/test/helper.rb +0 -9
  48. data/test/run-test.rb +0 -23
  49. data/test/test-cast.rb +0 -46
  50. data/test/test-class.rb +0 -47
  51. data/test/test-object.rb +0 -68
  52. 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