markdiff 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2346464a728f27b53d6e41867c54f6fc98be7b3
4
- data.tar.gz: 39a6911a132f9fdf92d55fe0de403148670c14af
3
+ metadata.gz: ce88d6225031a80172e2478e25ac5bbb0e4767ac
4
+ data.tar.gz: dc7cc2269616091e0176d613b5cb81dd08e33fe1
5
5
  SHA512:
6
- metadata.gz: d2ee80ab7bedc30ff0eff09a4cff8115fb7200e1433bc5cfb0330a64dafb28a10c351175a3268ee7c7d1115ef19b5df468a51c6837ba135d385ef870e5c27ee7
7
- data.tar.gz: 5ee096c2d67f82ea0434f9c925a821cdf2458bae9942f5c0c34d141a8460f5bb1292afbf7c5fee89246d9926382627140b50175bf01fa73f5a94fede09be563a
6
+ metadata.gz: bfd8ad92cbb696650cb72539f8e63a1bbe31d4b5198097ad12f0ab2e93ab28bb1836fb154c81096c1f2fd116c0f416b40b27ac09b304cf247650e41282897292
7
+ data.tar.gz: 9bf8a6ce503b9729bf8e52374ad71edc4f9f92e22f5fabaf1770c1202f271d1eba022403276a2a11d4ede7410cc67f8bf78e1f36272aee675acdbb2798195c50
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.6.1
2
+ - Fix patch order bug by making sort stable
3
+
1
4
  ## 0.6.0
2
5
  - Add .del class to all del elements
3
6
 
@@ -14,7 +14,8 @@ module Markdiff
14
14
  # @param [Nokogiri::XML::Node] node
15
15
  # @return [Nokogiri::XML::Node] Converted node
16
16
  def apply_patch(operations, node)
17
- operations.sort_by {|operation| -operation.priority }.each do |operation|
17
+ i = 0
18
+ operations.sort_by {|operation| i += 1; [-operation.priority, i] }.each do |operation|
18
19
  case operation
19
20
  when ::Markdiff::Operations::AddChildOperation
20
21
  operation.target_node.add_child(operation.inserted_node)
@@ -1,3 +1,3 @@
1
1
  module Markdiff
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler