oga 2.0.0-java → 2.1-java

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f50448db9660d09ac69db525bf1077a43cd9d88d
4
- data.tar.gz: 3f7c2ddbba06c6f7f074b74cd7ecb4772a04a45f
3
+ metadata.gz: e981f6e682ae79eb44c74e805c785d85f32c7cbc
4
+ data.tar.gz: 1e3188a4106bc96ec7968e393bc44feb7b3502c7
5
5
  SHA512:
6
- metadata.gz: 03b62f7c24779191b677711a5b44d8e8d5a5a0c34a74d2c69614750713393f93abf64e659c94d0d42e4bf72856d91256ba7372947c2d09da7c107ad5f8f2b85c
7
- data.tar.gz: ed27ca46e9e9be8a4b264fa62d49597fd04bce912a15060bdb85b7578adbe0633f089e6be53691fc9d0a3266c9ea71f7aa84e2d87d39acce5a8086e43052067b
6
+ metadata.gz: 78bb3d61fff33c9184521adb690f7c40f8bcbc465077fe2cfc84f36ca5aa70e19ef4a849fa45e18a4b56182da041f9c06620cdf203a898f2b988e72146c70682
7
+ data.tar.gz: 6c156b860e293fef6819b40af1fa693bb6d9bd3827898fbadc183e9bc216d17c6c2e206dbb978c1c439ff3b8aeb171c0af7b22b822dd162533e02becb5c2e092
data/README.md CHANGED
@@ -18,9 +18,17 @@ From [Wikipedia][oga-wikipedia]:
18
18
 
19
19
  The name is a pun on [Nokogiri][nokogiri].
20
20
 
21
- Oga uses [Semantic Versioning 2.0][semver] as its versioning scheme. All
22
- classes, modules and methods are part of the public API _unless_ they are
23
- declared as private using Ruby's `private` keyword or YARD's `@api private` tag.
21
+ ## Versioning Policy
22
+
23
+ Oga uses the version format `MAJOR.MINOR` (e.g. `2.1`). An increase of the MAJOR
24
+ version indicates backwards incompatible changes were introduced. The MINOR
25
+ version is _only_ increased when changes are backwards compatible, regardless of
26
+ whether those changes are bugfixes or new features. Up until version 1.0 the
27
+ code should be considered unstable meaning it can change (and break) at any
28
+ given moment.
29
+
30
+ APIs explicitly tagged as private (e.g. using Ruby's `private` keyword or YARD's
31
+ `@api private` tag) are not covered by these rules.
24
32
 
25
33
  ## Examples
26
34
 
@@ -318,4 +326,3 @@ found the file "LICENSE" or at <https://www.mozilla.org/MPL/2.0/>.
318
326
  [oga-wikipedia]: https://en.wikipedia.org/wiki/Japanese_saw#Other_Japanese_saws
319
327
  [ox]: https://github.com/ohler55/ox
320
328
  [doc-website]: http://code.yorickpeterse.com/oga/latest/
321
- [semver]: http://semver.org/spec/v2.0.0.html
data/lib/liboga.jar CHANGED
Binary file
data/lib/oga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1'
3
3
  end # Oga
@@ -74,14 +74,14 @@ module Oga
74
74
  input = input.gsub(REGULAR_ENTITY, mapping)
75
75
 
76
76
  if input.include?(AMPERSAND)
77
- input = input.gsub(NUMERIC_CODE_POINT_ENTITY) do
78
- [Integer($1, 10)].pack('U*')
77
+ input = input.gsub(NUMERIC_CODE_POINT_ENTITY) do |found|
78
+ pack_string($1, 10) || found
79
79
  end
80
80
  end
81
81
 
82
82
  if input.include?(AMPERSAND)
83
- input = input.gsub(HEX_CODE_POINT_ENTITY) do
84
- [Integer($1, 16)].pack('U*')
83
+ input = input.gsub(HEX_CODE_POINT_ENTITY) do |found|
84
+ pack_string($1, 16) || found
85
85
  end
86
86
  end
87
87
 
@@ -104,6 +104,17 @@ module Oga
104
104
  def self.encode_attribute(input)
105
105
  input.gsub(ENCODE_ATTRIBUTE_REGEXP, ENCODE_ATTRIBUTE_MAPPING)
106
106
  end
107
+
108
+ private
109
+
110
+ # @param [String] input
111
+ # @param [Fixnum] base
112
+ # @return [String]
113
+ def self.pack_string(input, base)
114
+ packed = [Integer(input, base)].pack('U*')
115
+
116
+ packed.valid_encoding? ? packed : nil
117
+ end
107
118
  end # Entities
108
119
  end # XML
109
120
  end # Oga
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: '2.1'
5
5
  platform: java
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement