daff 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +11 -0
  3. data/lib/daff.rb +14 -6
  4. data/lib/lib/coopy/alignment.rb +1 -1
  5. data/lib/lib/coopy/cell_builder.rb +1 -1
  6. data/lib/lib/coopy/cell_info.rb +1 -1
  7. data/lib/lib/coopy/compare_flags.rb +1 -1
  8. data/lib/lib/coopy/compare_table.rb +4 -2
  9. data/lib/lib/coopy/coopy.rb +3 -3
  10. data/lib/lib/coopy/cross_match.rb +1 -1
  11. data/lib/lib/coopy/csv.rb +2 -2
  12. data/lib/lib/coopy/diff_render.rb +1 -1
  13. data/lib/lib/coopy/flat_cell_builder.rb +2 -2
  14. data/lib/lib/coopy/highlight_patch.rb +11 -6
  15. data/lib/lib/coopy/highlight_patch_unit.rb +1 -1
  16. data/lib/lib/coopy/index.rb +1 -1
  17. data/lib/lib/coopy/index_item.rb +1 -1
  18. data/lib/lib/coopy/index_pair.rb +1 -1
  19. data/lib/lib/coopy/merger.rb +1 -1
  20. data/lib/lib/coopy/mover.rb +2 -2
  21. data/lib/lib/coopy/ndjson.rb +1 -1
  22. data/lib/lib/coopy/nested_cell_builder.rb +1 -1
  23. data/lib/lib/coopy/ordering.rb +1 -1
  24. data/lib/lib/coopy/row.rb +1 -1
  25. data/lib/lib/coopy/simple_table.rb +1 -1
  26. data/lib/lib/coopy/simple_view.rb +1 -1
  27. data/lib/lib/coopy/sparse_sheet.rb +1 -1
  28. data/lib/lib/coopy/sql_column.rb +1 -1
  29. data/lib/lib/coopy/sql_compare.rb +1 -1
  30. data/lib/lib/coopy/sql_database.rb +1 -1
  31. data/lib/lib/coopy/sql_helper.rb +1 -1
  32. data/lib/lib/coopy/sql_table.rb +1 -1
  33. data/lib/lib/coopy/sql_table_name.rb +1 -1
  34. data/lib/lib/coopy/sqlite_helper.rb +1 -1
  35. data/lib/lib/coopy/table.rb +1 -1
  36. data/lib/lib/coopy/table_comparison_state.rb +1 -1
  37. data/lib/lib/coopy/table_diff.rb +2 -2
  38. data/lib/lib/coopy/table_io.rb +1 -1
  39. data/lib/lib/coopy/table_modifier.rb +1 -1
  40. data/lib/lib/coopy/terminal_diff_render.rb +1 -1
  41. data/lib/lib/coopy/unit.rb +1 -1
  42. data/lib/lib/coopy/view.rb +1 -1
  43. data/lib/lib/coopy/viterbi.rb +1 -1
  44. data/lib/lib/haxe/ds/int_map.rb +1 -1
  45. data/lib/lib/haxe/ds/string_map.rb +1 -1
  46. data/lib/lib/haxe/format/json_parser.rb +6 -6
  47. data/lib/lib/haxe/format/json_printer.rb +1 -1
  48. data/lib/lib/haxe/imap.rb +1 -1
  49. data/lib/lib/haxe/io/bytes.rb +1 -1
  50. data/lib/lib/haxe/io/eof.rb +1 -1
  51. data/lib/lib/haxe/io/error.rb +1 -1
  52. data/lib/lib/haxe/io/output.rb +1 -1
  53. data/lib/lib/hx_overrides.rb +1 -13
  54. data/lib/lib/hx_sys.rb +2 -2
  55. data/lib/lib/lambda.rb +1 -1
  56. data/lib/lib/list.rb +1 -1
  57. data/lib/lib/rb/boot.rb +1 -1
  58. data/lib/lib/rb/ruby_iterator.rb +1 -1
  59. data/lib/lib/reflect.rb +1 -1
  60. data/lib/lib/string_buf.rb +1 -1
  61. data/lib/lib/sys/io/file_handle.rb +1 -1
  62. data/lib/lib/sys/io/file_output.rb +1 -1
  63. data/lib/lib/sys/io/hx_file.rb +1 -1
  64. data/lib/lib/type.rb +26 -22
  65. data/lib/lib/value_type.rb +1 -1
  66. data/lib/lib/x_list/list_iterator.rb +1 -1
  67. metadata +75 -68
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 99676b5f3069a96639961074611e5c8c0125361a
4
+ data.tar.gz: 61f811c90251dfee2afc8f187731813aad4bece7
5
+ SHA512:
6
+ metadata.gz: 1ebb393d477f490c2a733cd5ea055c64cc41cd32ef52fea5df7f92f8eee5983eea96bf7c4e79a377d3765a86d497a0e6cba38b520ea46ade3f6b644f11ff6f08
7
+ data.tar.gz: d70b61f7f4cb52e6e6d9a22cb9f50b8ce1c3fed78031baff2ae5c4ab1f9450131ed7a74f28abd49193dce685f107694420c7ec9d8f971953cb4257c02813ae4c
data/README.md CHANGED
@@ -22,6 +22,7 @@ npm install daff -g # node/javascript
22
22
  pip install daff # python
23
23
  gem install daff # ruby
24
24
  composer require paulfitz/daff-php # php
25
+ install.packages('daff') # R wrapper by Edwin de Jonge
25
26
  ````
26
27
 
27
28
  Other translations are available here:
@@ -215,11 +216,21 @@ For each language, the `daff` library expects to be handed an interface to table
215
216
  itself. This is to avoid inefficient copies from one format to another. You'll find a `SimpleTable` class you can use if
216
217
  you find this awkward.
217
218
 
219
+ Other possibilities:
220
+
221
+ * There's a daff wrapper for R written by [Edwin de Jonge](https://github.com/edwindj), see https://github.com/edwindj/daff and http://cran.r-project.org/web/packages/daff
222
+ * There's a hand-written ruby port by [James Smith](https://github.com/Floppy), see https://github.com/theodi/coopy-ruby
223
+
218
224
  API documentation
219
225
  -----------------
220
226
 
221
227
  * You can browse the `daff` classes at http://paulfitz.github.io/daff-doc/
222
228
 
229
+ Sponsors
230
+ --------
231
+
232
+ The [Data Commons Co-op](http://datacommons.coop), "perhaps the geekiest of all cooperative organizations on the planet," has given great moral support during the initial development of `daff`. There's currently no financial support for `daff`. You could change that! [![tips](https://img.shields.io/gratipay/paulfitz.svg)](https://gratipay.com/paulfitz/)
233
+
223
234
  Reading material
224
235
  ----------------
225
236
 
data/lib/daff.rb CHANGED
@@ -7,25 +7,37 @@ if ruby_major<1 || (ruby_major==1 && (ruby_minor<9 || (ruby_minor==9 && ruby_pat
7
7
  $stderr.puts "Your current Ruby version is: #{RUBY_VERSION}. Haxe/Ruby generates code for version 1.9.3 or later."
8
8
  Kernel.exit 1
9
9
  end
10
- def haxe_me
10
+ def haxe_me(source_name)
11
+ $hx_types ||= {}
12
+ $hx_types[source_name.join('.')] = self
11
13
  _haxe_vars_ = {}
12
- instance_methods(false).grep(/=$/).each do |v|
14
+ instance_methods(false).grep(/=$/).grep(/^[^\[=]/).each do |v|
13
15
  _haxe_vars_[v.to_s[0..-2].to_sym] = ('@'+v.to_s[0..-2]).to_sym
14
16
  end
17
+ old_get = instance_method(:[]) rescue nil
15
18
  define_method(:[]) do |x|
19
+ return old_get.bind(self).(x) if x.is_a?(Fixnum)
16
20
  tag = _haxe_vars_[x]
17
21
  return instance_variable_get(tag) if tag
18
22
  method x
19
23
  end
24
+ old_set = instance_method(:[]=) rescue nil
20
25
  define_method(:[]=) do |x,y|
26
+ return old_set.bind(self).(x,y) if x.is_a?(Fixnum)
21
27
  instance_variable_set(_haxe_vars_[x],y)
22
28
  end
29
+ define_method(:haxe_name) do
30
+ source_name.join('.')
31
+ end
23
32
  class << self
24
33
  define_method(:[]) do |x|
25
34
  method x
26
35
  end
27
36
  end
28
37
  end
38
+ class Array
39
+ haxe_me(['Array'])
40
+ end
29
41
 
30
42
  require 'date'
31
43
  require_relative 'lib/hx_overrides'
@@ -83,11 +95,7 @@ require_relative 'lib/haxe/ds/string_map'
83
95
  require_relative 'lib/haxe/format/json_parser'
84
96
  require_relative 'lib/haxe/format/json_printer'
85
97
  require_relative 'lib/haxe/io/bytes'
86
- require_relative 'lib/haxe/io/bytes_buffer'
87
- require_relative 'lib/haxe/io/input'
88
- require_relative 'lib/haxe/io/bytes_input'
89
98
  require_relative 'lib/haxe/io/output'
90
- require_relative 'lib/haxe/io/bytes_output'
91
99
  require_relative 'lib/haxe/io/eof'
92
100
  require_relative 'lib/haxe/io/error'
93
101
  require_relative 'lib/rb/boot'
@@ -300,7 +300,7 @@ module Coopy
300
300
  return order
301
301
  end
302
302
 
303
- haxe_me
303
+ haxe_me ["coopy", "Alignment"]
304
304
  end
305
305
 
306
306
  end
@@ -11,7 +11,7 @@ module Coopy
11
11
  def conflict(parent,local,remote) puts "Abstract CellBuilder.conflict called" end
12
12
  def marker(label) puts "Abstract CellBuilder.marker called" end
13
13
  def links(unit) puts "Abstract CellBuilder.links called" end
14
- haxe_me
14
+ haxe_me ["coopy", "CellBuilder"]
15
15
  end
16
16
 
17
17
  end
@@ -26,7 +26,7 @@ module Coopy
26
26
  return _hx_str(@pvalue) + "||" + _hx_str(@lvalue) + "::" + _hx_str(@rvalue)
27
27
  end
28
28
 
29
- haxe_me
29
+ haxe_me ["coopy", "CellInfo"]
30
30
  end
31
31
 
32
32
  end
@@ -84,7 +84,7 @@ module Coopy
84
84
  @columns_to_ignore.push(column)
85
85
  end
86
86
 
87
- haxe_me
87
+ haxe_me ["coopy", "CompareFlags"]
88
88
  end
89
89
 
90
90
  end
@@ -177,9 +177,11 @@ module Coopy
177
177
  sorter = lambda {|a1,b1|
178
178
  return 1 if a1[1] < b1[1]
179
179
  return -1 if a1[1] > b1[1]
180
+ return 1 if a1[0] > b1[0]
181
+ return -1 if a1[0] < b1[0]
180
182
  return 0
181
183
  }
182
- columns_eval.sort!{|a,b| sorter.call(a,b)}
184
+ columns_eval.sort{|a,b| sorter.call(a,b)}
183
185
  columns = Lambda.array(Lambda.map(columns_eval,lambda {|v|
184
186
  return v[0]
185
187
  }))
@@ -521,7 +523,7 @@ module Coopy
521
523
  return @indexes
522
524
  end
523
525
 
524
- haxe_me
526
+ haxe_me ["coopy", "CompareTable"]
525
527
  end
526
528
 
527
529
  end
@@ -31,7 +31,7 @@ module Coopy
31
31
  ext = ""
32
32
  pt = name.rindex(".",nil || 0) || -1
33
33
  if pt >= 0
34
- ext = HxOverrides.substr(name,pt + 1,nil).to_lower_case
34
+ ext = name[pt + 1..-1].to_lower_case
35
35
  case(ext)
36
36
  when "json"
37
37
  @format_preference = "json"
@@ -610,7 +610,7 @@ module Coopy
610
610
  class << self
611
611
  attr_accessor :version
612
612
  end
613
- @version = "1.2.4"
613
+ @version = "1.2.6"
614
614
 
615
615
  def Coopy.compare_tables(local,remote,flags = nil)
616
616
  comp = ::Coopy::TableComparisonState.new
@@ -773,7 +773,7 @@ module Coopy
773
773
  return workbook
774
774
  end
775
775
 
776
- haxe_me
776
+ haxe_me ["coopy", "Coopy"]
777
777
  end
778
778
 
779
779
  end
@@ -11,7 +11,7 @@ module Coopy
11
11
  attr_accessor :spot_b
12
12
  attr_accessor :item_a
13
13
  attr_accessor :item_b
14
- haxe_me
14
+ haxe_me ["coopy", "CrossMatch"]
15
15
  end
16
16
 
17
17
  end
data/lib/lib/coopy/csv.rb CHANGED
@@ -188,7 +188,7 @@ module Coopy
188
188
  return nil if result == "NULL"
189
189
  if first_non_underscore > start
190
190
  del = first_non_underscore - start
191
- return HxOverrides.substr(result,1,nil) if HxOverrides.substr(result,del,nil) == "NULL"
191
+ return result[1..-1] if result[del..-1] == "NULL"
192
192
  end
193
193
  end
194
194
  return result
@@ -203,7 +203,7 @@ module Coopy
203
203
  return self.parse_cell_part(txt)
204
204
  end
205
205
 
206
- haxe_me
206
+ haxe_me ["coopy", "Csv"]
207
207
  end
208
208
 
209
209
  end
@@ -296,7 +296,7 @@ module Coopy
296
296
  return cell
297
297
  end
298
298
 
299
- haxe_me
299
+ haxe_me ["coopy", "DiffRender"]
300
300
  end
301
301
 
302
302
  end
@@ -62,11 +62,11 @@ module Coopy
62
62
  score+=1
63
63
  end
64
64
  end
65
- str = "_" + _hx_str(str) if HxOverrides.substr(str,score,nil) == _nil
65
+ str = "_" + _hx_str(str) if str[score..-1] == _nil
66
66
  return str
67
67
  end
68
68
 
69
- haxe_me
69
+ haxe_me ["coopy", "FlatCellBuilder"]
70
70
  end
71
71
 
72
72
  end
@@ -203,13 +203,13 @@ module Coopy
203
203
  if mod != nil
204
204
  if (mod[0].ord rescue nil) == 58
205
205
  move = true
206
- mod = HxOverrides.substr(mod,1,mod.length)
206
+ mod = mod[1,mod.length]
207
207
  end
208
208
  end
209
209
  @header[i] = name
210
210
  if mod != nil
211
211
  if (mod[0].ord rescue nil) == 40
212
- prev_name = HxOverrides.substr(mod,1,mod.length - 2)
212
+ prev_name = mod[1,mod.length - 2]
213
213
  @header_pre[prev_name] = i
214
214
  @header_post[name] = i
215
215
  @header_rename[prev_name] = name
@@ -312,10 +312,13 @@ module Coopy
312
312
  end
313
313
 
314
314
  def process_mods(rmods,fate,len)
315
- rmods.sort!{|a,b| self.sort_mods(a,b)}
315
+ rmods.sort{|a,b| self.sort_mods(a,b)}
316
316
  offset = 0
317
317
  last = -1
318
318
  target = 0
319
+ if rmods.length > 0
320
+ last = 0 if rmods[0].source_prev_row == -1
321
+ end
319
322
  begin
320
323
  _g = 0
321
324
  while(_g < rmods.length)
@@ -414,8 +417,10 @@ module Coopy
414
417
  _g1+=1
415
418
  u = from_unit[i]
416
419
  if u != nil
417
- meta_from_unit[u] = i
418
- i
420
+ begin
421
+ meta_from_unit[u] = i
422
+ i
423
+ end
419
424
  else
420
425
  starts.push(i)
421
426
  end
@@ -648,7 +653,7 @@ module Coopy
648
653
  end
649
654
  end
650
655
 
651
- haxe_me
656
+ haxe_me ["coopy", "HighlightPatch"]
652
657
  end
653
658
 
654
659
  end
@@ -32,7 +32,7 @@ module Coopy
32
32
  return _hx_str(@code) + " patchRow " + _hx_str(@patch_row) + " sourceRows " + _hx_str(@source_prev_row) + "," + _hx_str(@source_row) + "," + _hx_str(@source_next_row) + " destRow " + _hx_str(@dest_row)
33
33
  end
34
34
 
35
- haxe_me
35
+ haxe_me ["coopy", "HighlightPatchUnit"]
36
36
  end
37
37
 
38
38
  end
@@ -100,7 +100,7 @@ module Coopy
100
100
  return @indexed_table
101
101
  end
102
102
 
103
- haxe_me
103
+ haxe_me ["coopy", "Index"]
104
104
  end
105
105
 
106
106
  end
@@ -27,7 +27,7 @@ module Coopy
27
27
  return @lst[0]
28
28
  end
29
29
 
30
- haxe_me
30
+ haxe_me ["coopy", "IndexItem"]
31
31
  end
32
32
 
33
33
  end
@@ -85,7 +85,7 @@ module Coopy
85
85
  return @quality
86
86
  end
87
87
 
88
- haxe_me
88
+ haxe_me ["coopy", "IndexPair"]
89
89
  end
90
90
 
91
91
  end
@@ -180,7 +180,7 @@ module Coopy
180
180
  return view.to_datum("((( " + _hx_str(view.to_s(pcell)) + " ))) " + _hx_str(view.to_s(lcell)) + " /// " + _hx_str(view.to_s(rcell)))
181
181
  end
182
182
 
183
- haxe_me
183
+ haxe_me ["coopy", "Merger"]
184
184
  end
185
185
 
186
186
  end
@@ -155,7 +155,7 @@ module Coopy
155
155
  k = _it._next
156
156
  blks.push(k)
157
157
  end
158
- blks.sort! {|a,b|
158
+ blks.sort {|a,b|
159
159
  return blk_len[b] - blk_len[a]
160
160
  }
161
161
  moved = Array.new
@@ -189,7 +189,7 @@ module Coopy
189
189
  return moved
190
190
  end
191
191
 
192
- haxe_me
192
+ haxe_me ["coopy", "Mover"]
193
193
  end
194
194
 
195
195
  end
@@ -128,7 +128,7 @@ module Coopy
128
128
  self.add_header_row(0)
129
129
  end
130
130
 
131
- haxe_me
131
+ haxe_me ["coopy", "Ndjson"]
132
132
  end
133
133
 
134
134
  end
@@ -68,7 +68,7 @@ module Coopy
68
68
  return h
69
69
  end
70
70
 
71
- haxe_me
71
+ haxe_me ["coopy", "NestedCellBuilder"]
72
72
  end
73
73
 
74
74
  end
@@ -44,7 +44,7 @@ module Coopy
44
44
  @ignore_parent = true
45
45
  end
46
46
 
47
- haxe_me
47
+ haxe_me ["coopy", "Ordering"]
48
48
  end
49
49
 
50
50
  end
data/lib/lib/coopy/row.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  module Coopy
5
5
  class Row
6
6
  def getRowString(c) puts "Abstract Row.getRowString called" end
7
- haxe_me
7
+ haxe_me ["coopy", "Row"]
8
8
  end
9
9
 
10
10
  end
@@ -281,7 +281,7 @@ module Coopy
281
281
  return true
282
282
  end
283
283
 
284
- haxe_me
284
+ haxe_me ["coopy", "SimpleTable"]
285
285
  end
286
286
 
287
287
  end
@@ -52,7 +52,7 @@ module Coopy
52
52
  return h.respond_to? :keys
53
53
  end
54
54
 
55
- haxe_me
55
+ haxe_me ["coopy", "SimpleView"]
56
56
  end
57
57
 
58
58
  end
@@ -45,7 +45,7 @@ module Coopy
45
45
  cursor[x] = val
46
46
  end
47
47
 
48
- haxe_me
48
+ haxe_me ["coopy", "SparseSheet"]
49
49
  end
50
50
 
51
51
  end
@@ -29,7 +29,7 @@ module Coopy
29
29
  return result
30
30
  end
31
31
 
32
- haxe_me
32
+ haxe_me ["coopy", "SqlColumn"]
33
33
  end
34
34
 
35
35
  end
@@ -239,7 +239,7 @@ module Coopy
239
239
  return @align
240
240
  end
241
241
 
242
- haxe_me
242
+ haxe_me ["coopy", "SqlCompare"]
243
243
  end
244
244
 
245
245
  end
@@ -13,7 +13,7 @@ module Coopy
13
13
  def end() puts "Abstract SqlDatabase.end called" end
14
14
  def width() puts "Abstract SqlDatabase.width called" end
15
15
  def rowid() puts "Abstract SqlDatabase.rowid called" end
16
- haxe_me
16
+ haxe_me ["coopy", "SqlDatabase"]
17
17
  end
18
18
 
19
19
  end
@@ -6,7 +6,7 @@ module Coopy
6
6
  def getTableNames(db) puts "Abstract SqlHelper.getTableNames called" end
7
7
  def countRows(db,name) puts "Abstract SqlHelper.countRows called" end
8
8
  def getRowIDs(db,name) puts "Abstract SqlHelper.getRowIDs called" end
9
- haxe_me
9
+ haxe_me ["coopy", "SqlHelper"]
10
10
  end
11
11
 
12
12
  end
@@ -210,7 +210,7 @@ module Coopy
210
210
  return nil
211
211
  end
212
212
 
213
- haxe_me
213
+ haxe_me ["coopy", "SqlTable"]
214
214
  end
215
215
 
216
216
  end
@@ -17,7 +17,7 @@ module Coopy
17
17
  return _hx_str(@prefix) + "." + _hx_str(@name)
18
18
  end
19
19
 
20
- haxe_me
20
+ haxe_me ["coopy", "SqlTableName"]
21
21
  end
22
22
 
23
23
  end
@@ -41,7 +41,7 @@ module Coopy
41
41
  return result
42
42
  end
43
43
 
44
- haxe_me
44
+ haxe_me ["coopy", "SqliteHelper"]
45
45
  end
46
46
 
47
47
  end
@@ -16,7 +16,7 @@ module Coopy
16
16
  def get_height() puts "Abstract Table.get_height called" end
17
17
  def getData() puts "Abstract Table.getData called" end
18
18
  def clone() puts "Abstract Table.clone called" end
19
- haxe_me
19
+ haxe_me ["coopy", "Table"]
20
20
  end
21
21
 
22
22
  end
@@ -29,7 +29,7 @@ module Coopy
29
29
  @compare_flags = nil
30
30
  end
31
31
 
32
- haxe_me
32
+ haxe_me ["coopy", "TableComparisonState"]
33
33
  end
34
34
 
35
35
  end
@@ -89,7 +89,7 @@ module Coopy
89
89
  score+=1
90
90
  end
91
91
  end
92
- str = "_" + _hx_str(str) if HxOverrides.substr(str,score,nil) == _nil
92
+ str = "_" + _hx_str(str) if str[score..-1] == _nil
93
93
  return str
94
94
  end
95
95
 
@@ -808,7 +808,7 @@ module Coopy
808
808
  return true
809
809
  end
810
810
 
811
- haxe_me
811
+ haxe_me ["coopy", "TableDiff"]
812
812
  end
813
813
 
814
814
  end
@@ -49,7 +49,7 @@ module Coopy
49
49
  return nil
50
50
  end
51
51
 
52
- haxe_me
52
+ haxe_me ["coopy", "TableIO"]
53
53
  end
54
54
 
55
55
  end
@@ -34,7 +34,7 @@ module Coopy
34
34
  return @t.insert_or_delete_columns(fate,@t.get_width - 1)
35
35
  end
36
36
 
37
- haxe_me
37
+ haxe_me ["coopy", "TableModifier"]
38
38
  end
39
39
 
40
40
  end
@@ -164,7 +164,7 @@ module Coopy
164
164
  return sizes
165
165
  end
166
166
 
167
- haxe_me
167
+ haxe_me ["coopy", "TerminalDiffRender"]
168
168
  end
169
169
 
170
170
  end
@@ -67,7 +67,7 @@ module Coopy
67
67
  end
68
68
  end
69
69
 
70
- haxe_me
70
+ haxe_me ["coopy", "Unit"]
71
71
  end
72
72
 
73
73
  end
@@ -11,7 +11,7 @@ module Coopy
11
11
  def isHash(h) puts "Abstract View.isHash called" end
12
12
  def hashExists(h,str) puts "Abstract View.hashExists called" end
13
13
  def hashGet(h,str) puts "Abstract View.hashGet called" end
14
- haxe_me
14
+ haxe_me ["coopy", "View"]
15
15
  end
16
16
 
17
17
  end
@@ -171,7 +171,7 @@ module Coopy
171
171
  return @best_cost
172
172
  end
173
173
 
174
- haxe_me
174
+ haxe_me ["coopy", "Viterbi"]
175
175
  end
176
176
 
177
177
  end
@@ -12,7 +12,7 @@ module Ds
12
12
  return self[key]
13
13
  end
14
14
 
15
- haxe_me
15
+ haxe_me ["haxe", "ds", "IntMap"]
16
16
  end
17
17
 
18
18
  end
@@ -12,7 +12,7 @@ module Ds
12
12
  return self[key]
13
13
  end
14
14
 
15
- haxe_me
15
+ haxe_me ["haxe", "ds", "StringMap"]
16
16
  end
17
17
 
18
18
  end
@@ -183,7 +183,7 @@ module Format
183
183
  end
184
184
  f = nil
185
185
  begin
186
- x = HxOverrides.substr(@str,start,@pos - start)
186
+ x = @str[start,@pos - start]
187
187
  f = x.to_f
188
188
  end
189
189
  i = f.to_i
@@ -210,7 +210,7 @@ module Format
210
210
  end
211
211
  break if c == 34
212
212
  if c == 92
213
- buf_b += HxOverrides.substr(@str,start,@pos - start - 1)
213
+ buf_b += @str[start,@pos - start - 1]
214
214
  begin
215
215
  index1 = @pos
216
216
  @pos+=1
@@ -232,7 +232,7 @@ module Format
232
232
  when 117
233
233
  uc = nil
234
234
  begin
235
- x = "0x" + _hx_str(HxOverrides.substr(@str,@pos,4))
235
+ x = "0x" + _hx_str(@str[@pos,4])
236
236
  uc = x.to_i
237
237
  end
238
238
  @pos += 4
@@ -245,7 +245,7 @@ module Format
245
245
  raise hx_raise("Unclosed string")
246
246
  end
247
247
  end
248
- buf_b += HxOverrides.substr(@str,start,@pos - start - 1)
248
+ buf_b += @str[start,@pos - start - 1]
249
249
  return buf_b
250
250
  end
251
251
 
@@ -255,10 +255,10 @@ module Format
255
255
  end
256
256
 
257
257
  def invalid_number(start)
258
- raise hx_raise("Invalid number at position " + _hx_str(start) + ": " + _hx_str(HxOverrides.substr(@str,start,@pos - start)))
258
+ raise hx_raise("Invalid number at position " + _hx_str(start) + ": " + _hx_str(@str[start,@pos - start]))
259
259
  end
260
260
 
261
- haxe_me
261
+ haxe_me ["haxe", "format", "JsonParser"]
262
262
  end
263
263
 
264
264
  end
@@ -233,7 +233,7 @@ module Format
233
233
  return printer.buf.b
234
234
  end
235
235
 
236
- haxe_me
236
+ haxe_me ["haxe", "format", "JsonPrinter"]
237
237
  end
238
238
 
239
239
  end
data/lib/lib/haxe/imap.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  module Haxe
5
5
  class IMap
6
6
  def get(k) puts "Abstract IMap.get called" end
7
- haxe_me
7
+ haxe_me ["haxe", "IMap"]
8
8
  end
9
9
 
10
10
  end
@@ -27,7 +27,7 @@ module Io
27
27
  return ::Haxe::Io::Bytes.new(s.bytesize,s)
28
28
  end
29
29
 
30
- haxe_me
30
+ haxe_me ["haxe", "io", "Bytes"]
31
31
  end
32
32
 
33
33
  end
@@ -11,7 +11,7 @@ module Io
11
11
  return "Eof"
12
12
  end
13
13
 
14
- haxe_me
14
+ haxe_me ["haxe", "io", "Eof"]
15
15
  end
16
16
 
17
17
  end
@@ -15,7 +15,7 @@ module Io
15
15
  def Error.outside_bounds() Error.new("OutsideBounds",2) end
16
16
  def Error.overflow() Error.new("Overflow",1) end
17
17
  CONSTRUCTS__ = ["Blocked","Overflow","OutsideBounds","Custom"]
18
- def ==(a) a.tag === @tag && a.index === @index && a.params == @params end
18
+ def ==(a) (!a.nil?) && (a.respond_to? 'ISENUM__') && a.tag === @tag && a.index === @index && a.params == @params end
19
19
  end
20
20
 
21
21
  end
@@ -34,7 +34,7 @@ module Io
34
34
  self.write_full_bytes(b,0,b.length)
35
35
  end
36
36
 
37
- haxe_me
37
+ haxe_me ["haxe", "io", "Output"]
38
38
  end
39
39
 
40
40
  end
@@ -14,18 +14,6 @@
14
14
  return _hx_str(date.get_full_year) + "-" + _hx_str((((m < 10) ? "0" + _hx_str(m) : "" + _hx_str(m)))) + "-" + _hx_str((((d < 10) ? "0" + _hx_str(d) : "" + _hx_str(d)))) + " " + _hx_str((((h < 10) ? "0" + _hx_str(h) : "" + _hx_str(h)))) + ":" + _hx_str((((mi < 10) ? "0" + _hx_str(mi) : "" + _hx_str(mi)))) + ":" + _hx_str((((s < 10) ? "0" + _hx_str(s) : "" + _hx_str(s))))
15
15
  end
16
16
 
17
- def HxOverrides.substr(s,pos,len = nil)
18
- return "" if pos != nil && pos != 0 && len != nil && len < 0
19
- len = s.length if len == nil
20
- if pos < 0
21
- pos = s.length + pos
22
- pos = 0 if pos < 0
23
- elsif len < 0
24
- len = s.length + len - pos
25
- end
26
- return s[pos,len]
27
- end
28
-
29
- haxe_me
17
+ haxe_me ["HxOverrides"]
30
18
  end
31
19
 
data/lib/lib/hx_sys.rb CHANGED
@@ -22,7 +22,7 @@
22
22
  when 32,34
23
23
  ok = false
24
24
  when 0,13,10
25
- arg = HxOverrides.substr(arg,0,i)
25
+ arg = arg[0,i]
26
26
  end if _g2 != nil
27
27
  end
28
28
  end
@@ -61,6 +61,6 @@
61
61
  return ::Sys::Io::FileOutput.new(STDERR)
62
62
  end
63
63
 
64
- haxe_me
64
+ haxe_me ["Sys"]
65
65
  end
66
66
 
data/lib/lib/lambda.rb CHANGED
@@ -32,6 +32,6 @@
32
32
  return false
33
33
  end
34
34
 
35
- haxe_me
35
+ haxe_me ["Lambda"]
36
36
  end
37
37
 
data/lib/lib/list.rb CHANGED
@@ -31,6 +31,6 @@
31
31
  return ::X_List::ListIterator.new(@h)
32
32
  end
33
33
 
34
- haxe_me
34
+ haxe_me ["List"]
35
35
  end
36
36
 
data/lib/lib/rb/boot.rb CHANGED
@@ -14,7 +14,7 @@ module Rb
14
14
  end
15
15
  end
16
16
 
17
- haxe_me
17
+ haxe_me ["rb", "Boot"]
18
18
  end
19
19
 
20
20
  end
@@ -44,7 +44,7 @@ module Rb
44
44
  return @ref.next
45
45
  end
46
46
 
47
- haxe_me
47
+ haxe_me ["rb", "RubyIterator"]
48
48
  end
49
49
 
50
50
  end
data/lib/lib/reflect.rb CHANGED
@@ -26,6 +26,6 @@
26
26
  return f.respond_to?("call")
27
27
  end
28
28
 
29
- haxe_me
29
+ haxe_me ["Reflect"]
30
30
  end
31
31
 
@@ -14,6 +14,6 @@
14
14
  public
15
15
 
16
16
  attr_accessor :length
17
- haxe_me
17
+ haxe_me ["StringBuf"]
18
18
  end
19
19
 
@@ -11,7 +11,7 @@ module Io
11
11
  def initialize(t,index,p = nil ) @tag = t; @index = index; @params = p; end
12
12
 
13
13
  CONSTRUCTS__ = []
14
- def ==(a) a.tag === @tag && a.index === @index && a.params == @params end
14
+ def ==(a) (!a.nil?) && (a.respond_to? 'ISENUM__') && a.tag === @tag && a.index === @index && a.params == @params end
15
15
  end
16
16
 
17
17
  end
@@ -29,7 +29,7 @@ module Io
29
29
  return r
30
30
  end
31
31
 
32
- haxe_me
32
+ haxe_me ["sys", "io", "FileOutput"]
33
33
  end
34
34
 
35
35
  end
@@ -13,7 +13,7 @@ module Io
13
13
  IO.write(path,content)
14
14
  end
15
15
 
16
- haxe_me
16
+ haxe_me ["sys", "io", "File"]
17
17
  end
18
18
 
19
19
  end
data/lib/lib/type.rb CHANGED
@@ -4,30 +4,34 @@
4
4
  class Type
5
5
 
6
6
  def Type._typeof(v)
7
- _g = v.class.to_s
8
- case(_g)
9
- when "TrueClass"
10
- return ValueType.tbool
11
- when "FalseClass"
12
- return ValueType.tbool
13
- when "String"
14
- return ValueType.tclass(String)
15
- when "Fixnum"
16
- return ValueType.tint
17
- when "Float"
18
- return ValueType.tfloat
19
- when "Proc"
20
- return ValueType.tfunction
21
- when "NilClass"
22
- return ValueType.tnull
23
- when "Hash"
24
- return ValueType.tobject
25
- else
26
- return ValueType.tclass(v.class) if v.respond_to?("class")
27
- return ValueType.tunknown
7
+ return ValueType.tnull if v == nil
8
+ begin
9
+ _g = v.class.to_s
10
+ case(_g)
11
+ when "TrueClass"
12
+ return ValueType.tbool
13
+ when "FalseClass"
14
+ return ValueType.tbool
15
+ when "String"
16
+ return ValueType.tclass(String)
17
+ when "Fixnum"
18
+ return ValueType.tint
19
+ when "Float"
20
+ return ValueType.tfloat
21
+ when "Proc"
22
+ return ValueType.tfunction
23
+ when "Array"
24
+ return ValueType.tclass(Array)
25
+ when "Hash"
26
+ return ValueType.tobject
27
+ else
28
+ return ValueType.tenum(v.class) if v.respond_to?("ISENUM__")
29
+ return ValueType.tclass(v.class) if v.respond_to?("class")
30
+ return ValueType.tunknown
31
+ end
28
32
  end
29
33
  end
30
34
 
31
- haxe_me
35
+ haxe_me ["Type"]
32
36
  end
33
37
 
@@ -18,6 +18,6 @@
18
18
  def ValueType.tobject() ValueType.new("TObject",4) end
19
19
  def ValueType.tunknown() ValueType.new("TUnknown",8) end
20
20
  CONSTRUCTS__ = ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"]
21
- def ==(a) a.tag === @tag && a.index === @index && a.params == @params end
21
+ def ==(a) (!a.nil?) && (a.respond_to? 'ISENUM__') && a.tag === @tag && a.index === @index && a.params == @params end
22
22
  end
23
23
 
@@ -26,7 +26,7 @@ module X_List
26
26
  return @val
27
27
  end
28
28
 
29
- haxe_me
29
+ haxe_me ["_List", "ListIterator"]
30
30
  end
31
31
 
32
32
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
5
- prerelease:
4
+ version: 1.2.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - James Smith
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2015-02-01 00:00:00.000000000 Z
12
+ date: 2015-03-06 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: Diff and patch tables
16
15
  email:
@@ -21,103 +20,102 @@ executables:
21
20
  extensions: []
22
21
  extra_rdoc_files: []
23
22
  files:
23
+ - README.md
24
+ - bin/daff.rb
24
25
  - lib/daff.rb
25
- - lib/lib/type.rb
26
- - lib/lib/hx_sys.rb
27
- - lib/lib/lambda.rb
28
- - lib/lib/reflect.rb
29
- - lib/lib/rb/boot.rb
30
- - lib/lib/rb/ruby_iterator.rb
31
- - lib/lib/value_type.rb
32
- - lib/lib/hx_overrides.rb
33
- - lib/lib/coopy/simple_table.rb
26
+ - lib/lib/coopy/alignment.rb
34
27
  - lib/lib/coopy/cell_builder.rb
28
+ - lib/lib/coopy/cell_info.rb
29
+ - lib/lib/coopy/compare_flags.rb
35
30
  - lib/lib/coopy/compare_table.rb
36
- - lib/lib/coopy/table_io.rb
37
- - lib/lib/coopy/sql_compare.rb
31
+ - lib/lib/coopy/coopy.rb
32
+ - lib/lib/coopy/cross_match.rb
33
+ - lib/lib/coopy/csv.rb
34
+ - lib/lib/coopy/diff_render.rb
38
35
  - lib/lib/coopy/flat_cell_builder.rb
39
- - lib/lib/coopy/nested_cell_builder.rb
36
+ - lib/lib/coopy/highlight_patch.rb
37
+ - lib/lib/coopy/highlight_patch_unit.rb
38
+ - lib/lib/coopy/index.rb
40
39
  - lib/lib/coopy/index_item.rb
41
40
  - lib/lib/coopy/index_pair.rb
41
+ - lib/lib/coopy/merger.rb
42
+ - lib/lib/coopy/mover.rb
43
+ - lib/lib/coopy/ndjson.rb
44
+ - lib/lib/coopy/nested_cell_builder.rb
45
+ - lib/lib/coopy/ordering.rb
46
+ - lib/lib/coopy/row.rb
47
+ - lib/lib/coopy/simple_table.rb
48
+ - lib/lib/coopy/simple_view.rb
49
+ - lib/lib/coopy/sparse_sheet.rb
42
50
  - lib/lib/coopy/sql_column.rb
43
- - lib/lib/coopy/diff_render.rb
44
- - lib/lib/coopy/cross_match.rb
45
- - lib/lib/coopy/table_diff.rb
46
- - lib/lib/coopy/alignment.rb
47
- - lib/lib/coopy/terminal_diff_render.rb
51
+ - lib/lib/coopy/sql_compare.rb
52
+ - lib/lib/coopy/sql_database.rb
53
+ - lib/lib/coopy/sql_helper.rb
48
54
  - lib/lib/coopy/sql_table.rb
49
- - lib/lib/coopy/table_modifier.rb
50
- - lib/lib/coopy/highlight_patch.rb
51
- - lib/lib/coopy/table_text.rb
52
- - lib/lib/coopy/simple_view.rb
53
- - lib/lib/coopy/row.rb
54
- - lib/lib/coopy/index.rb
55
- - lib/lib/coopy/coopy.rb
56
- - lib/lib/coopy/cell_info.rb
57
- - lib/lib/coopy/view.rb
58
55
  - lib/lib/coopy/sql_table_name.rb
59
- - lib/lib/coopy/highlight_patch_unit.rb
60
- - lib/lib/coopy/compare_flags.rb
61
- - lib/lib/coopy/unit.rb
62
- - lib/lib/coopy/mover.rb
63
- - lib/lib/coopy/table_comparison_state.rb
64
- - lib/lib/coopy/sql_database.rb
65
- - lib/lib/coopy/csv.rb
66
56
  - lib/lib/coopy/sqlite_helper.rb
67
- - lib/lib/coopy/ordering.rb
68
- - lib/lib/coopy/merger.rb
69
- - lib/lib/coopy/sql_helper.rb
70
- - lib/lib/coopy/sparse_sheet.rb
71
- - lib/lib/coopy/ndjson.rb
72
57
  - lib/lib/coopy/table.rb
58
+ - lib/lib/coopy/table_comparison_state.rb
59
+ - lib/lib/coopy/table_diff.rb
60
+ - lib/lib/coopy/table_io.rb
61
+ - lib/lib/coopy/table_modifier.rb
62
+ - lib/lib/coopy/table_text.rb
63
+ - lib/lib/coopy/terminal_diff_render.rb
64
+ - lib/lib/coopy/unit.rb
65
+ - lib/lib/coopy/view.rb
73
66
  - lib/lib/coopy/viterbi.rb
74
- - lib/lib/math.rb
75
- - lib/lib/list.rb
76
- - lib/lib/sys/io/hx_file.rb
77
- - lib/lib/sys/io/file_output.rb
78
- - lib/lib/sys/io/file_handle.rb
79
- - lib/lib/x_list/list_iterator.rb
80
- - lib/lib/string_buf.rb
67
+ - lib/lib/haxe/ds/int_map.rb
68
+ - lib/lib/haxe/ds/string_map.rb
69
+ - lib/lib/haxe/format/json_parser.rb
70
+ - lib/lib/haxe/format/json_printer.rb
81
71
  - lib/lib/haxe/imap.rb
72
+ - lib/lib/haxe/io/bytes.rb
82
73
  - lib/lib/haxe/io/bytes_buffer.rb
83
- - lib/lib/haxe/io/input.rb
84
- - lib/lib/haxe/io/eof.rb
85
74
  - lib/lib/haxe/io/bytes_input.rb
86
75
  - lib/lib/haxe/io/bytes_output.rb
87
- - lib/lib/haxe/io/bytes.rb
76
+ - lib/lib/haxe/io/eof.rb
88
77
  - lib/lib/haxe/io/error.rb
78
+ - lib/lib/haxe/io/input.rb
89
79
  - lib/lib/haxe/io/output.rb
90
- - lib/lib/haxe/ds/int_map.rb
91
- - lib/lib/haxe/ds/string_map.rb
92
- - lib/lib/haxe/format/json_parser.rb
93
- - lib/lib/haxe/format/json_printer.rb
94
- - bin/daff.rb
95
- - README.md
80
+ - lib/lib/hx_overrides.rb
81
+ - lib/lib/hx_sys.rb
82
+ - lib/lib/lambda.rb
83
+ - lib/lib/list.rb
84
+ - lib/lib/math.rb
85
+ - lib/lib/rb/boot.rb
86
+ - lib/lib/rb/ruby_iterator.rb
87
+ - lib/lib/reflect.rb
88
+ - lib/lib/string_buf.rb
89
+ - lib/lib/sys/io/file_handle.rb
90
+ - lib/lib/sys/io/file_output.rb
91
+ - lib/lib/sys/io/hx_file.rb
92
+ - lib/lib/type.rb
93
+ - lib/lib/value_type.rb
94
+ - lib/lib/x_list/list_iterator.rb
96
95
  homepage: https://github.com/paulfitz/daff
97
96
  licenses:
98
97
  - MIT
98
+ metadata: {}
99
99
  post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
103
103
  required_ruby_version: !ruby/object:Gem::Requirement
104
- none: false
105
104
  requirements:
106
- - - ! '>='
105
+ - - ">="
107
106
  - !ruby/object:Gem::Version
108
107
  version: '0'
109
108
  required_rubygems_version: !ruby/object:Gem::Requirement
110
- none: false
111
109
  requirements:
112
- - - ! '>='
110
+ - - ">="
113
111
  - !ruby/object:Gem::Version
114
112
  version: '0'
115
113
  requirements: []
116
114
  rubyforge_project:
117
- rubygems_version: 1.8.23
115
+ rubygems_version: 2.2.2
118
116
  signing_key:
119
- specification_version: 3
120
- summary: ! '[![Build Status](https://travis-ci.org/paulfitz/daff.svg?branch=master)](https://travis-ci.org/paulfitz/daff)
117
+ specification_version: 4
118
+ summary: '[![Build Status](https://travis-ci.org/paulfitz/daff.svg?branch=master)](https://travis-ci.org/paulfitz/daff)
121
119
  [![NPM version](https://badge.fury.io/js/daff.svg)](http://badge.fury.io/js/daff)
122
120
  [![Gem Version](https://badge.fury.io/rb/daff.svg)](http://badge.fury.io/rb/daff)
123
121
  [![PyPI version](https://badge.fury.io/py/daff.svg)](http://badge.fury.io/py/daff)
@@ -129,8 +127,9 @@ summary: ! '[![Build Status](https://travis-ci.org/paulfitz/daff.svg?branch=mast
129
127
  of the "same" table. For a live demo, see: > http://paulfitz.github.com/daff/ Install
130
128
  the library for your favorite language: ````sh npm install daff -g # node/javascript
131
129
  pip install daff # python gem install daff # ruby composer require paulfitz/daff-php #
132
- php ```` Other translations are available here: > https://github.com/paulfitz/daff/releases Or
133
- use the library to view csv diffs on github via a chrome extension: > https://github.com/theodi/csvhub The
130
+ php install.packages(''daff'') # R wrapper by Edwin de Jonge ```` Other translations
131
+ are available here: > https://github.com/paulfitz/daff/releases Or use the library
132
+ to view csv diffs on github via a chrome extension: > https://github.com/theodi/csvhub The
134
133
  diff format used by `daff` is specified here: > http://dataprotocols.org/tabular-diff-format/ This
135
134
  library is a stripped down version of the coopy toolbox (see http://share.find.coop). To
136
135
  compare tables from different origins, or with automatically generated IDs, or
@@ -194,8 +193,16 @@ summary: ! '[![Build Status](https://travis-ci.org/paulfitz/daff.svg?branch=mast
194
193
  java make cs make cpp ``` For each language, the `daff` library expects to be handed
195
194
  an interface to tables you create, rather than creating them itself. This is to
196
195
  avoid inefficient copies from one format to another. You''ll find a `SimpleTable`
197
- class you can use if you find this awkward. API documentation ----------------- *
198
- You can browse the `daff` classes at http://paulfitz.github.io/daff-doc/ Reading
196
+ class you can use if you find this awkward. Other possibilities: * There''s a
197
+ daff wrapper for R written by [Edwin de Jonge](https://github.com/edwindj), see
198
+ https://github.com/edwindj/daff and http://cran.r-project.org/web/packages/daff
199
+ * There''s a hand-written ruby port by [James Smith](https://github.com/Floppy),
200
+ see https://github.com/theodi/coopy-ruby API documentation ----------------- *
201
+ You can browse the `daff` classes at http://paulfitz.github.io/daff-doc/ Sponsors
202
+ -------- The [Data Commons Co-op](http://datacommons.coop), "perhaps the geekiest
203
+ of all cooperative organizations on the planet," has given great moral support during
204
+ the initial development of `daff`. There''s currently no financial support for `daff`.
205
+ You could change that! [![tips](https://img.shields.io/gratipay/paulfitz.svg)](https://gratipay.com/paulfitz/) Reading
199
206
  material ---------------- * http://dataprotocols.org/tabular-diff-format/ : a specification
200
207
  of the diff format we use. * http://theodi.org/blog/csvhub-github-diffs-for-csv-files
201
208
  : using this library with github. * http://theodi.org/blog/adapting-git-simple-data