rtext 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/CHANGELOG +20 -0
  2. data/{README → README.rdoc} +5 -1
  3. data/RText_Protocol +444 -0
  4. data/Rakefile +10 -10
  5. data/lib/rtext/completer.rb +32 -26
  6. data/lib/rtext/context_builder.rb +113 -59
  7. data/lib/rtext/default_loader.rb +73 -8
  8. data/lib/rtext/default_service_provider.rb +30 -14
  9. data/lib/rtext/frontend/config.rb +58 -0
  10. data/lib/rtext/frontend/connector.rb +233 -0
  11. data/lib/rtext/frontend/connector_manager.rb +81 -0
  12. data/lib/rtext/frontend/context.rb +56 -0
  13. data/lib/rtext/generic.rb +13 -0
  14. data/lib/rtext/instantiator.rb +30 -7
  15. data/lib/rtext/language.rb +54 -27
  16. data/lib/rtext/link_detector.rb +57 -0
  17. data/lib/rtext/message_helper.rb +77 -0
  18. data/lib/rtext/parser.rb +19 -68
  19. data/lib/rtext/serializer.rb +18 -3
  20. data/lib/rtext/service.rb +182 -118
  21. data/lib/rtext/tokenizer.rb +102 -0
  22. data/test/completer_test.rb +327 -70
  23. data/test/context_builder_test.rb +671 -91
  24. data/test/instantiator_test.rb +153 -0
  25. data/test/integration/backend.out +10 -0
  26. data/test/integration/crash_on_request_editor.rb +12 -0
  27. data/test/integration/ecore_editor.rb +50 -0
  28. data/test/integration/frontend.log +25138 -0
  29. data/test/integration/model/invalid_encoding.invenc +2 -0
  30. data/test/integration/model/test.crash_on_request +18 -0
  31. data/test/integration/model/test.crashing_backend +18 -0
  32. data/test/integration/model/test.dont_open_socket +0 -0
  33. data/test/integration/model/test.invalid_cmd_line +0 -0
  34. data/test/integration/model/test.not_in_rtext +0 -0
  35. data/test/integration/model/test_large_with_errors.ect3 +43523 -0
  36. data/test/integration/model/test_metamodel.ect +18 -0
  37. data/test/integration/model/test_metamodel2.ect +5 -0
  38. data/test/integration/model/test_metamodel_error.ect2 +3 -0
  39. data/test/integration/model/test_metamodel_ok.ect2 +18 -0
  40. data/test/integration/test.rb +684 -0
  41. data/test/link_detector_test.rb +276 -0
  42. data/test/message_helper_test.rb +118 -0
  43. data/test/rtext_test.rb +4 -1
  44. data/test/serializer_test.rb +96 -1
  45. data/test/tokenizer_test.rb +125 -0
  46. metadata +36 -10
  47. data/RText_Plugin_Implementation_Guide +0 -268
  48. data/lib/rtext_plugin/connection_manager.rb +0 -59
@@ -1,59 +0,0 @@
1
- module RTextPlugin
2
-
3
- class ConnectorManager
4
- def start
5
- end
6
-
7
- def stop
8
- end
9
-
10
- def trigger
11
- end
12
-
13
- private
14
-
15
- def find_rtext_config_file(file)
16
- end
17
-
18
- def extract_file_pattern(file)
19
- ext = File.extname
20
- if ext.size > 0
21
- "*.#{ext}"
22
- else
23
- File.basename(file)
24
- end
25
- end
26
-
27
- ServiceSpec = Struct.new(:config_file, :pattern, :command)
28
-
29
- def parse_rtext_config_file(file)
30
- expect = :pattern
31
- line = 1
32
- pattern = nil
33
- specs = []
34
- File.open(file) do |f|
35
- f.readlines.each do |l|
36
- case expect
37
- when :pattern
38
- if l =~ /(.*):\s*$/
39
- pattern = $1.split(",").collect{|s| s.strip}
40
- expect = :command
41
- else
42
- raise "expected file pattern in line #{line}"
43
- end
44
- when :command
45
- if l =~ /[^:]\s*$/
46
- specs << ServiceSpec.new(file, pattern, l)
47
- else
48
- raise "expected command in line #{line}"
49
- end
50
- end
51
- line += 1
52
- end
53
- end
54
- specs
55
- end
56
-
57
- end
58
-
59
- end