rho-tau-extensions 6.2.0 → 7.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/libs/crosswalk/ext/platform/android/Rakefile +19 -1
  3. data/libs/enterprise-barcode/ext/platform/android/adds/lib/aarch64/liballbarcode.a +0 -0
  4. data/libs/enterprise-barcode/ext/platform/android/adds/lib/armeabi/liballbarcode.a +0 -0
  5. data/libs/enterprise-barcode/ext/platform/android/adds/lib/x86/liballbarcode.a +0 -0
  6. data/libs/enterprise-barcode/ext/platform/android/allbarcode.jar +0 -0
  7. data/libs/fcm-push-18/ext.yml +20 -0
  8. data/libs/fcm-push-18/ext/android/AndroidManifest.rb +10 -0
  9. data/libs/fcm-push-18/ext/android/ApplicationManifestAdds.erb +39 -0
  10. data/libs/fcm-push-18/ext/android/Rakefile +187 -0
  11. data/libs/fcm-push-18/ext/android/ext_java.files +3 -0
  12. data/libs/fcm-push-18/ext/android/ext_native.files +1 -0
  13. data/libs/fcm-push-18/ext/android/jni/src/fcmpushclient.cpp +215 -0
  14. data/libs/fcm-push-18/ext/android/jni/src/fcmpushclient.h +74 -0
  15. data/libs/fcm-push-18/ext/android/res/res/values/fireBaseValues.xml +5 -0
  16. data/libs/fcm-push-18/ext/android/src/com/rhomobile/rhodes/fcm/FCMFacade.java +164 -0
  17. data/libs/fcm-push-18/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +219 -0
  18. data/libs/fcm-push-18/ext/android/src/com/rhomobile/rhodes/fcm/FCMListener.java +88 -0
  19. data/libs/fcm-push-18/ext/build +16 -0
  20. data/libs/fcm-push-18/ext/build.bat +8 -0
  21. data/libs/fcm-push-18/ext/fcm.xml +9 -0
  22. data/libs/fcm-push-18/ext/iphone/ApplePush_Prefix.pch +7 -0
  23. data/libs/fcm-push-18/ext/iphone/Firebase.h +68 -0
  24. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics +0 -0
  25. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h +62 -0
  26. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h +115 -0
  27. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h +1 -0
  28. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h +13 -0
  29. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h +1 -0
  30. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h +1 -0
  31. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h +389 -0
  32. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h +1 -0
  33. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h +485 -0
  34. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h +15 -0
  35. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h +10 -0
  36. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap +10 -0
  37. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/FirebaseCore +0 -0
  38. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h +52 -0
  39. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FIRApp.h +130 -0
  40. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h +78 -0
  41. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h +35 -0
  42. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FIROptions.h +133 -0
  43. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h +5 -0
  44. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCore.framework/Modules/module.modulemap +7 -0
  45. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics +0 -0
  46. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap +6 -0
  47. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID +0 -0
  48. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h +276 -0
  49. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h +1 -0
  50. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap +7 -0
  51. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseMessaging.framework/FirebaseMessaging +0 -0
  52. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h +508 -0
  53. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h +1 -0
  54. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap +8 -0
  55. data/libs/fcm-push-18/ext/iphone/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB +0 -0
  56. data/libs/fcm-push-18/ext/iphone/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac +0 -0
  57. data/libs/fcm-push-18/ext/iphone/Frameworks/GoogleToolboxForMac.framework/Modules/module.modulemap +5 -0
  58. data/libs/fcm-push-18/ext/iphone/Frameworks/Protobuf.framework/Modules/module.modulemap +5 -0
  59. data/libs/fcm-push-18/ext/iphone/Frameworks/Protobuf.framework/Protobuf +0 -0
  60. data/libs/fcm-push-18/ext/iphone/Frameworks/nanopb.framework/Modules/module.modulemap +5 -0
  61. data/libs/fcm-push-18/ext/iphone/Frameworks/nanopb.framework/nanopb +0 -0
  62. data/libs/fcm-push-18/ext/iphone/Rakefile +81 -0
  63. data/libs/fcm-push-18/ext/iphone/fcm-push.xcodeproj/project.pbxproj +370 -0
  64. data/libs/fcm-push-18/ext/iphone/impl/PushNotificationsReceiver.h +28 -0
  65. data/libs/fcm-push-18/ext/iphone/impl/PushNotificationsReceiver.m +27 -0
  66. data/libs/fcm-push-18/ext/iphone/impl/PushNotificationsReceiver.mm +234 -0
  67. data/libs/fcm-push-18/ext/iphone/impl/applePushSetup.c +10 -0
  68. data/libs/fcm-push-18/ext/iphone/impl/applepushclient.h +69 -0
  69. data/libs/fcm-push-18/ext/iphone/impl/applepushclient.mm +164 -0
  70. data/libs/fcm-push-18/ext/iphone/impl/readme.txt +7 -0
  71. data/libs/fcm-push-18/ext/platform/iphone/impl/readme.txt +7 -0
  72. data/libs/nodejs/ext/platform/android/jxCore/jx.h +17 -1
  73. data/libs/nodejs/ext/platform/android/jxCore/libcares_arm.a +0 -0
  74. data/libs/nodejs/ext/platform/android/jxCore/libcares_ia32.a +0 -0
  75. data/libs/nodejs/ext/platform/android/jxCore/libcares_x64.a +0 -0
  76. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_arm.a +0 -0
  77. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_ia32.a +0 -0
  78. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_x64.a +0 -0
  79. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_arm.a +0 -0
  80. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_ia32.a +0 -0
  81. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_x64.a +0 -0
  82. data/libs/nodejs/ext/platform/android/jxCore/libjx_arm.a +0 -0
  83. data/libs/nodejs/ext/platform/android/jxCore/libjx_ia32.a +0 -0
  84. data/libs/nodejs/ext/platform/android/jxCore/libjx_x64.a +0 -0
  85. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_arm.a +0 -0
  86. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_ia32.a +0 -0
  87. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_x64.a +0 -0
  88. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_arm.a +0 -0
  89. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_ia32.a +0 -0
  90. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_x64.a +0 -0
  91. data/libs/nodejs/ext/platform/android/jxCore/libuv_arm.a +0 -0
  92. data/libs/nodejs/ext/platform/android/jxCore/libuv_ia32.a +0 -0
  93. data/libs/nodejs/ext/platform/android/jxCore/libuv_x64.a +0 -0
  94. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_arm.a +0 -0
  95. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_ia32.a +0 -0
  96. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_x64.a +0 -0
  97. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_arm.a +0 -0
  98. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_ia32.a +0 -0
  99. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_x64.a +0 -0
  100. data/libs/nodejs/ext/platform/iphone/jxCore/jx.h +17 -1
  101. data/libs/nodejs/ext/platform/iphone/jxCore/libcares.a +0 -0
  102. data/libs/nodejs/ext/platform/iphone/jxCore/libchrome_zlib.a +0 -0
  103. data/libs/nodejs/ext/platform/iphone/jxCore/libhttp_parser.a +0 -0
  104. data/libs/nodejs/ext/platform/iphone/jxCore/libjx.a +0 -0
  105. data/libs/nodejs/ext/platform/iphone/jxCore/libmozjs.a +0 -0
  106. data/libs/nodejs/ext/platform/iphone/jxCore/libopenssl.a +0 -0
  107. data/libs/nodejs/ext/platform/iphone/jxCore/libsqlite3.a +0 -0
  108. data/libs/nodejs/ext/platform/iphone/jxCore/libuv.a +0 -0
  109. data/libs/rexml-edge/rexml/attlistdecl.rb +63 -0
  110. data/libs/rexml-edge/rexml/attribute.rb +192 -0
  111. data/libs/rexml-edge/rexml/cdata.rb +68 -0
  112. data/libs/rexml-edge/rexml/child.rb +97 -0
  113. data/libs/rexml-edge/rexml/comment.rb +80 -0
  114. data/libs/rexml-edge/rexml/doctype.rb +270 -0
  115. data/libs/rexml-edge/rexml/document.rb +291 -0
  116. data/libs/rexml-edge/rexml/dtd/attlistdecl.rb +11 -0
  117. data/libs/rexml-edge/rexml/dtd/dtd.rb +47 -0
  118. data/libs/rexml-edge/rexml/dtd/elementdecl.rb +18 -0
  119. data/libs/rexml-edge/rexml/dtd/entitydecl.rb +57 -0
  120. data/libs/rexml-edge/rexml/dtd/notationdecl.rb +40 -0
  121. data/libs/rexml-edge/rexml/element.rb +1241 -0
  122. data/libs/rexml-edge/rexml/encoding.rb +51 -0
  123. data/libs/rexml-edge/rexml/entity.rb +174 -0
  124. data/libs/rexml-edge/rexml/formatters/default.rb +112 -0
  125. data/libs/rexml-edge/rexml/formatters/pretty.rb +142 -0
  126. data/libs/rexml-edge/rexml/formatters/transitive.rb +58 -0
  127. data/libs/rexml-edge/rexml/functions.rb +418 -0
  128. data/libs/rexml-edge/rexml/instruction.rb +71 -0
  129. data/libs/rexml-edge/rexml/light/node.rb +196 -0
  130. data/libs/rexml-edge/rexml/namespace.rb +48 -0
  131. data/libs/rexml-edge/rexml/node.rb +76 -0
  132. data/libs/rexml-edge/rexml/output.rb +30 -0
  133. data/libs/rexml-edge/rexml/parent.rb +166 -0
  134. data/libs/rexml-edge/rexml/parseexception.rb +52 -0
  135. data/libs/rexml-edge/rexml/parsers/baseparser.rb +533 -0
  136. data/libs/rexml-edge/rexml/parsers/lightparser.rb +59 -0
  137. data/libs/rexml-edge/rexml/parsers/pullparser.rb +197 -0
  138. data/libs/rexml-edge/rexml/parsers/sax2parser.rb +273 -0
  139. data/libs/rexml-edge/rexml/parsers/streamparser.rb +61 -0
  140. data/libs/rexml-edge/rexml/parsers/treeparser.rb +101 -0
  141. data/libs/rexml-edge/rexml/parsers/ultralightparser.rb +57 -0
  142. data/libs/rexml-edge/rexml/parsers/xpathparser.rb +657 -0
  143. data/libs/rexml-edge/rexml/quickpath.rb +266 -0
  144. data/libs/rexml-edge/rexml/rexml.rb +32 -0
  145. data/libs/rexml-edge/rexml/sax2listener.rb +98 -0
  146. data/libs/rexml-edge/rexml/security.rb +28 -0
  147. data/libs/rexml-edge/rexml/source.rb +297 -0
  148. data/libs/rexml-edge/rexml/streamlistener.rb +93 -0
  149. data/libs/rexml-edge/rexml/syncenumerator.rb +33 -0
  150. data/libs/rexml-edge/rexml/text.rb +426 -0
  151. data/libs/rexml-edge/rexml/undefinednamespaceexception.rb +9 -0
  152. data/libs/rexml-edge/rexml/validation/relaxng.rb +539 -0
  153. data/libs/rexml-edge/rexml/validation/validation.rb +144 -0
  154. data/libs/rexml-edge/rexml/validation/validationexception.rb +10 -0
  155. data/libs/rexml-edge/rexml/xmldecl.rb +116 -0
  156. data/libs/rexml-edge/rexml/xmltokens.rb +85 -0
  157. data/libs/rexml-edge/rexml/xpath.rb +81 -0
  158. data/libs/rexml-edge/rexml/xpath_parser.rb +704 -0
  159. data/version +1 -1
  160. metadata +118 -2
@@ -0,0 +1,7 @@
1
+ contains files with module API Implementation.
2
+
3
+ Developer should create it - after first generation this folder is empty and this folder do not changed with next generation processes !!!.
4
+
5
+ Developer should make at least <ModuleName>FactorySingleton.m with acees to <ModuleName>Factory interface!
6
+ All other files include base_impl can be removed from project if it wants by developer.
7
+ Default stub generated code placed in stub_impl folder - you can just copy all files from /generated/stub_impl to this folder and implement unemplemented methods.
@@ -0,0 +1,7 @@
1
+ contains files with module API Implementation.
2
+
3
+ Developer should create it - after first generation this folder is empty and this folder do not changed with next generation processes !!!.
4
+
5
+ Developer should make at least <ModuleName>FactorySingleton.m with acees to <ModuleName>Factory interface!
6
+ All other files include base_impl can be removed from project if it wants by developer.
7
+ Default stub generated code placed in stub_impl folder - you can just copy all files from /generated/stub_impl to this folder and implement unemplemented methods.
@@ -11,7 +11,23 @@ extern "C" {
11
11
 
12
12
  typedef void (*JX_CALLBACK)(JXValue *result, int argc);
13
13
 
14
- // Call method below only once per app. to initialize JXcore
14
+ // Creates a thread to run a restartable instance of the JXcore engine
15
+ // Input arg 'start' is the function to run on the new thread.
16
+ JXCORE_EXTERN(bool)
17
+ JX_CreateRIThread(void (*start)(void *arg));
18
+
19
+ // Join the thread created by JX_CreateRIThread. Make sure to call
20
+ // this method only after JX_StopEngine has been called on the
21
+ // thread to join.
22
+ JXCORE_EXTERN(bool)
23
+ JX_JoinRIThread();
24
+
25
+ // If the script has called 'process.exit(exitcode)', it returns
26
+ // the exitcode, otherwise returns '0'.
27
+ JXCORE_EXTERN(int)
28
+ JX_ProcessExitResult();
29
+
30
+ // Call method below only once per app. to initialize JXcore.
15
31
  JXCORE_EXTERN(void)
16
32
  JX_InitializeOnce(const char *home_folder);
17
33
 
@@ -11,7 +11,23 @@ extern "C" {
11
11
 
12
12
  typedef void (*JX_CALLBACK)(JXValue *result, int argc);
13
13
 
14
- // Call method below only once per app. to initialize JXcore
14
+ // Creates a thread to run a restartable instance of the JXcore engine
15
+ // Input arg 'start' is the function to run on the new thread.
16
+ JXCORE_EXTERN(bool)
17
+ JX_CreateRIThread(void (*start)(void *arg));
18
+
19
+ // Join the thread created by JX_CreateRIThread. Make sure to call
20
+ // this method only after JX_StopEngine has been called on the
21
+ // thread to join.
22
+ JXCORE_EXTERN(bool)
23
+ JX_JoinRIThread();
24
+
25
+ // If the script has called 'process.exit(exitcode)', it returns
26
+ // the exitcode, otherwise returns '0'.
27
+ JXCORE_EXTERN(int)
28
+ JX_ProcessExitResult();
29
+
30
+ // Call method below only once per app. to initialize JXcore.
15
31
  JXCORE_EXTERN(void)
16
32
  JX_InitializeOnce(const char *home_folder);
17
33
 
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: false
2
+ #vim:ts=2 sw=2 noexpandtab:
3
+ require 'rexml/child'
4
+ require 'rexml/source'
5
+
6
+ module REXML
7
+ # This class needs:
8
+ # * Documentation
9
+ # * Work! Not all types of attlists are intelligently parsed, so we just
10
+ # spew back out what we get in. This works, but it would be better if
11
+ # we formatted the output ourselves.
12
+ #
13
+ # AttlistDecls provide *just* enough support to allow namespace
14
+ # declarations. If you need some sort of generalized support, or have an
15
+ # interesting idea about how to map the hideous, terrible design of DTD
16
+ # AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
17
+ # for anything to make DTDs more palateable.
18
+ class AttlistDecl < Child
19
+ include Enumerable
20
+
21
+ # What is this? Got me.
22
+ attr_reader :element_name
23
+
24
+ # Create an AttlistDecl, pulling the information from a Source. Notice
25
+ # that this isn't very convenient; to create an AttlistDecl, you basically
26
+ # have to format it yourself, and then have the initializer parse it.
27
+ # Sorry, but for the foreseeable future, DTD support in REXML is pretty
28
+ # weak on convenience. Have I mentioned how much I hate DTDs?
29
+ def initialize(source)
30
+ super()
31
+ if (source.kind_of? Array)
32
+ @element_name, @pairs, @contents = *source
33
+ end
34
+ end
35
+
36
+ # Access the attlist attribute/value pairs.
37
+ # value = attlist_decl[ attribute_name ]
38
+ def [](key)
39
+ @pairs[key]
40
+ end
41
+
42
+ # Whether an attlist declaration includes the given attribute definition
43
+ # if attlist_decl.include? "xmlns:foobar"
44
+ def include?(key)
45
+ @pairs.keys.include? key
46
+ end
47
+
48
+ # Iterate over the key/value pairs:
49
+ # attlist_decl.each { |attribute_name, attribute_value| ... }
50
+ def each(&block)
51
+ @pairs.each(&block)
52
+ end
53
+
54
+ # Write out exactly what we got in.
55
+ def write out, indent=-1
56
+ out << @contents
57
+ end
58
+
59
+ def node_type
60
+ :attlistdecl
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,192 @@
1
+ # frozen_string_literal: false
2
+ require "rexml/namespace"
3
+ require 'rexml/text'
4
+
5
+ module REXML
6
+ # Defines an Element Attribute; IE, a attribute=value pair, as in:
7
+ # <element attribute="value"/>. Attributes can be in their own
8
+ # namespaces. General users of REXML will not interact with the
9
+ # Attribute class much.
10
+ class Attribute
11
+ include Node
12
+ include Namespace
13
+
14
+ # The element to which this attribute belongs
15
+ attr_reader :element
16
+ # The normalized value of this attribute. That is, the attribute with
17
+ # entities intact.
18
+ attr_writer :normalized
19
+ PATTERN = /\s*(#{NAME_STR})\s*=\s*(["'])(.*?)\2/um
20
+
21
+ NEEDS_A_SECOND_CHECK = /(<|&((#{Entity::NAME});|(#0*((?:\d+)|(?:x[a-fA-F0-9]+)));)?)/um
22
+
23
+ # Constructor.
24
+ # FIXME: The parser doesn't catch illegal characters in attributes
25
+ #
26
+ # first::
27
+ # Either: an Attribute, which this new attribute will become a
28
+ # clone of; or a String, which is the name of this attribute
29
+ # second::
30
+ # If +first+ is an Attribute, then this may be an Element, or nil.
31
+ # If nil, then the Element parent of this attribute is the parent
32
+ # of the +first+ Attribute. If the first argument is a String,
33
+ # then this must also be a String, and is the content of the attribute.
34
+ # If this is the content, it must be fully normalized (contain no
35
+ # illegal characters).
36
+ # parent::
37
+ # Ignored unless +first+ is a String; otherwise, may be the Element
38
+ # parent of this attribute, or nil.
39
+ #
40
+ #
41
+ # Attribute.new( attribute_to_clone )
42
+ # Attribute.new( attribute_to_clone, parent_element )
43
+ # Attribute.new( "attr", "attr_value" )
44
+ # Attribute.new( "attr", "attr_value", parent_element )
45
+ def initialize( first, second=nil, parent=nil )
46
+ @normalized = @unnormalized = @element = nil
47
+ if first.kind_of? Attribute
48
+ self.name = first.expanded_name
49
+ @unnormalized = first.value
50
+ if second.kind_of? Element
51
+ @element = second
52
+ else
53
+ @element = first.element
54
+ end
55
+ elsif first.kind_of? String
56
+ @element = parent
57
+ self.name = first
58
+ @normalized = second.to_s
59
+ else
60
+ raise "illegal argument #{first.class.name} to Attribute constructor"
61
+ end
62
+ end
63
+
64
+ # Returns the namespace of the attribute.
65
+ #
66
+ # e = Element.new( "elns:myelement" )
67
+ # e.add_attribute( "nsa:a", "aval" )
68
+ # e.add_attribute( "b", "bval" )
69
+ # e.attributes.get_attribute( "a" ).prefix # -> "nsa"
70
+ # e.attributes.get_attribute( "b" ).prefix # -> "elns"
71
+ # a = Attribute.new( "x", "y" )
72
+ # a.prefix # -> ""
73
+ def prefix
74
+ pf = super
75
+ if pf == ""
76
+ pf = @element.prefix if @element
77
+ end
78
+ pf
79
+ end
80
+
81
+ # Returns the namespace URL, if defined, or nil otherwise
82
+ #
83
+ # e = Element.new("el")
84
+ # e.add_namespace("ns", "http://url")
85
+ # e.add_attribute("ns:a", "b")
86
+ # e.add_attribute("nsx:a", "c")
87
+ # e.attribute("ns:a").namespace # => "http://url"
88
+ # e.attribute("nsx:a").namespace # => nil
89
+ def namespace arg=nil
90
+ arg = prefix if arg.nil?
91
+ @element.namespace arg
92
+ end
93
+
94
+ # Returns true if other is an Attribute and has the same name and value,
95
+ # false otherwise.
96
+ def ==( other )
97
+ other.kind_of?(Attribute) and other.name==name and other.value==value
98
+ end
99
+
100
+ # Creates (and returns) a hash from both the name and value
101
+ def hash
102
+ name.hash + value.hash
103
+ end
104
+
105
+ # Returns this attribute out as XML source, expanding the name
106
+ #
107
+ # a = Attribute.new( "x", "y" )
108
+ # a.to_string # -> "x='y'"
109
+ # b = Attribute.new( "ns:x", "y" )
110
+ # b.to_string # -> "ns:x='y'"
111
+ def to_string
112
+ if @element and @element.context and @element.context[:attribute_quote] == :quote
113
+ %Q^#@expanded_name="#{to_s().gsub(/"/, '&quot;')}"^
114
+ else
115
+ "#@expanded_name='#{to_s().gsub(/'/, '&apos;')}'"
116
+ end
117
+ end
118
+
119
+ def doctype
120
+ if @element
121
+ doc = @element.document
122
+ doc.doctype if doc
123
+ end
124
+ end
125
+
126
+ # Returns the attribute value, with entities replaced
127
+ def to_s
128
+ return @normalized if @normalized
129
+
130
+ @normalized = Text::normalize( @unnormalized, doctype )
131
+ @unnormalized = nil
132
+ @normalized
133
+ end
134
+
135
+ # Returns the UNNORMALIZED value of this attribute. That is, entities
136
+ # have been expanded to their values
137
+ def value
138
+ return @unnormalized if @unnormalized
139
+ @unnormalized = Text::unnormalize( @normalized, doctype )
140
+ @normalized = nil
141
+ @unnormalized
142
+ end
143
+
144
+ # Returns a copy of this attribute
145
+ def clone
146
+ Attribute.new self
147
+ end
148
+
149
+ # Sets the element of which this object is an attribute. Normally, this
150
+ # is not directly called.
151
+ #
152
+ # Returns this attribute
153
+ def element=( element )
154
+ @element = element
155
+
156
+ if @normalized
157
+ Text.check( @normalized, NEEDS_A_SECOND_CHECK, doctype )
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Removes this Attribute from the tree, and returns true if successful
164
+ #
165
+ # This method is usually not called directly.
166
+ def remove
167
+ @element.attributes.delete self.name unless @element.nil?
168
+ end
169
+
170
+ # Writes this attribute (EG, puts 'key="value"' to the output)
171
+ def write( output, indent=-1 )
172
+ output << to_string
173
+ end
174
+
175
+ def node_type
176
+ :attribute
177
+ end
178
+
179
+ def inspect
180
+ rv = ""
181
+ write( rv )
182
+ rv
183
+ end
184
+
185
+ def xpath
186
+ path = @element.xpath
187
+ path += "/@#{self.expanded_name}"
188
+ return path
189
+ end
190
+ end
191
+ end
192
+ #vim:ts=2 sw=2 noexpandtab:
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: false
2
+ require "rexml/text"
3
+
4
+ module REXML
5
+ class CData < Text
6
+ START = '<![CDATA['
7
+ STOP = ']]>'
8
+ ILLEGAL = /(\]\]>)/
9
+
10
+ # Constructor. CData is data between <![CDATA[ ... ]]>
11
+ #
12
+ # _Examples_
13
+ # CData.new( source )
14
+ # CData.new( "Here is some CDATA" )
15
+ # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
16
+ def initialize( first, whitespace=true, parent=nil )
17
+ super( first, whitespace, parent, false, true, ILLEGAL )
18
+ end
19
+
20
+ # Make a copy of this object
21
+ #
22
+ # _Examples_
23
+ # c = CData.new( "Some text" )
24
+ # d = c.clone
25
+ # d.to_s # -> "Some text"
26
+ def clone
27
+ CData.new self
28
+ end
29
+
30
+ # Returns the content of this CData object
31
+ #
32
+ # _Examples_
33
+ # c = CData.new( "Some text" )
34
+ # c.to_s # -> "Some text"
35
+ def to_s
36
+ @string
37
+ end
38
+
39
+ def value
40
+ @string
41
+ end
42
+
43
+ # == DEPRECATED
44
+ # See the rexml/formatters package
45
+ #
46
+ # Generates XML output of this object
47
+ #
48
+ # output::
49
+ # Where to write the string. Defaults to $stdout
50
+ # indent::
51
+ # The amount to indent this node by
52
+ # transitive::
53
+ # Ignored
54
+ # ie_hack::
55
+ # Ignored
56
+ #
57
+ # _Examples_
58
+ # c = CData.new( " Some text " )
59
+ # c.write( $stdout ) #-> <![CDATA[ Some text ]]>
60
+ def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
61
+ Kernel.warn( "#{self.class.name}.write is deprecated" )
62
+ indent( output, indent )
63
+ output << START
64
+ output << @string
65
+ output << STOP
66
+ end
67
+ end
68
+ end