daff 1.2.4 → 1.2.6
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 +7 -0
- data/README.md +11 -0
- data/lib/daff.rb +14 -6
- data/lib/lib/coopy/alignment.rb +1 -1
- data/lib/lib/coopy/cell_builder.rb +1 -1
- data/lib/lib/coopy/cell_info.rb +1 -1
- data/lib/lib/coopy/compare_flags.rb +1 -1
- data/lib/lib/coopy/compare_table.rb +4 -2
- data/lib/lib/coopy/coopy.rb +3 -3
- data/lib/lib/coopy/cross_match.rb +1 -1
- data/lib/lib/coopy/csv.rb +2 -2
- data/lib/lib/coopy/diff_render.rb +1 -1
- data/lib/lib/coopy/flat_cell_builder.rb +2 -2
- data/lib/lib/coopy/highlight_patch.rb +11 -6
- data/lib/lib/coopy/highlight_patch_unit.rb +1 -1
- data/lib/lib/coopy/index.rb +1 -1
- data/lib/lib/coopy/index_item.rb +1 -1
- data/lib/lib/coopy/index_pair.rb +1 -1
- data/lib/lib/coopy/merger.rb +1 -1
- data/lib/lib/coopy/mover.rb +2 -2
- data/lib/lib/coopy/ndjson.rb +1 -1
- data/lib/lib/coopy/nested_cell_builder.rb +1 -1
- data/lib/lib/coopy/ordering.rb +1 -1
- data/lib/lib/coopy/row.rb +1 -1
- data/lib/lib/coopy/simple_table.rb +1 -1
- data/lib/lib/coopy/simple_view.rb +1 -1
- data/lib/lib/coopy/sparse_sheet.rb +1 -1
- data/lib/lib/coopy/sql_column.rb +1 -1
- data/lib/lib/coopy/sql_compare.rb +1 -1
- data/lib/lib/coopy/sql_database.rb +1 -1
- data/lib/lib/coopy/sql_helper.rb +1 -1
- data/lib/lib/coopy/sql_table.rb +1 -1
- data/lib/lib/coopy/sql_table_name.rb +1 -1
- data/lib/lib/coopy/sqlite_helper.rb +1 -1
- data/lib/lib/coopy/table.rb +1 -1
- data/lib/lib/coopy/table_comparison_state.rb +1 -1
- data/lib/lib/coopy/table_diff.rb +2 -2
- data/lib/lib/coopy/table_io.rb +1 -1
- data/lib/lib/coopy/table_modifier.rb +1 -1
- data/lib/lib/coopy/terminal_diff_render.rb +1 -1
- data/lib/lib/coopy/unit.rb +1 -1
- data/lib/lib/coopy/view.rb +1 -1
- data/lib/lib/coopy/viterbi.rb +1 -1
- data/lib/lib/haxe/ds/int_map.rb +1 -1
- data/lib/lib/haxe/ds/string_map.rb +1 -1
- data/lib/lib/haxe/format/json_parser.rb +6 -6
- data/lib/lib/haxe/format/json_printer.rb +1 -1
- data/lib/lib/haxe/imap.rb +1 -1
- data/lib/lib/haxe/io/bytes.rb +1 -1
- data/lib/lib/haxe/io/eof.rb +1 -1
- data/lib/lib/haxe/io/error.rb +1 -1
- data/lib/lib/haxe/io/output.rb +1 -1
- data/lib/lib/hx_overrides.rb +1 -13
- data/lib/lib/hx_sys.rb +2 -2
- data/lib/lib/lambda.rb +1 -1
- data/lib/lib/list.rb +1 -1
- data/lib/lib/rb/boot.rb +1 -1
- data/lib/lib/rb/ruby_iterator.rb +1 -1
- data/lib/lib/reflect.rb +1 -1
- data/lib/lib/string_buf.rb +1 -1
- data/lib/lib/sys/io/file_handle.rb +1 -1
- data/lib/lib/sys/io/file_output.rb +1 -1
- data/lib/lib/sys/io/hx_file.rb +1 -1
- data/lib/lib/type.rb +26 -22
- data/lib/lib/value_type.rb +1 -1
- data/lib/lib/x_list/list_iterator.rb +1 -1
- 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! [](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'
|
data/lib/lib/coopy/alignment.rb
CHANGED
@@ -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
|
data/lib/lib/coopy/cell_info.rb
CHANGED
@@ -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
|
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
|
data/lib/lib/coopy/coopy.rb
CHANGED
@@ -31,7 +31,7 @@ module Coopy
|
|
31
31
|
ext = ""
|
32
32
|
pt = name.rindex(".",nil || 0) || -1
|
33
33
|
if pt >= 0
|
34
|
-
ext =
|
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.
|
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
|
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
|
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
|
@@ -62,11 +62,11 @@ module Coopy
|
|
62
62
|
score+=1
|
63
63
|
end
|
64
64
|
end
|
65
|
-
str = "_" + _hx_str(str) if
|
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 =
|
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 =
|
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
|
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
|
-
|
418
|
-
|
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
|
data/lib/lib/coopy/index.rb
CHANGED
data/lib/lib/coopy/index_item.rb
CHANGED
data/lib/lib/coopy/index_pair.rb
CHANGED
data/lib/lib/coopy/merger.rb
CHANGED
data/lib/lib/coopy/mover.rb
CHANGED
@@ -155,7 +155,7 @@ module Coopy
|
|
155
155
|
k = _it._next
|
156
156
|
blks.push(k)
|
157
157
|
end
|
158
|
-
blks.sort
|
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
|
data/lib/lib/coopy/ndjson.rb
CHANGED
data/lib/lib/coopy/ordering.rb
CHANGED
data/lib/lib/coopy/row.rb
CHANGED
data/lib/lib/coopy/sql_column.rb
CHANGED
data/lib/lib/coopy/sql_helper.rb
CHANGED
@@ -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
|
data/lib/lib/coopy/sql_table.rb
CHANGED
data/lib/lib/coopy/table.rb
CHANGED
data/lib/lib/coopy/table_diff.rb
CHANGED
@@ -89,7 +89,7 @@ module Coopy
|
|
89
89
|
score+=1
|
90
90
|
end
|
91
91
|
end
|
92
|
-
str = "_" + _hx_str(str) if
|
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
|
data/lib/lib/coopy/table_io.rb
CHANGED
data/lib/lib/coopy/unit.rb
CHANGED
data/lib/lib/coopy/view.rb
CHANGED
data/lib/lib/coopy/viterbi.rb
CHANGED
data/lib/lib/haxe/ds/int_map.rb
CHANGED
@@ -183,7 +183,7 @@ module Format
|
|
183
183
|
end
|
184
184
|
f = nil
|
185
185
|
begin
|
186
|
-
x =
|
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 +=
|
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(
|
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 +=
|
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(
|
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
|
data/lib/lib/haxe/imap.rb
CHANGED
data/lib/lib/haxe/io/bytes.rb
CHANGED
data/lib/lib/haxe/io/eof.rb
CHANGED
data/lib/lib/haxe/io/error.rb
CHANGED
@@ -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
|
data/lib/lib/haxe/io/output.rb
CHANGED
data/lib/lib/hx_overrides.rb
CHANGED
@@ -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
|
-
|
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 =
|
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
data/lib/lib/list.rb
CHANGED
data/lib/lib/rb/boot.rb
CHANGED
data/lib/lib/rb/ruby_iterator.rb
CHANGED
data/lib/lib/reflect.rb
CHANGED
data/lib/lib/string_buf.rb
CHANGED
@@ -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
|
data/lib/lib/sys/io/hx_file.rb
CHANGED
data/lib/lib/type.rb
CHANGED
@@ -4,30 +4,34 @@
|
|
4
4
|
class Type
|
5
5
|
|
6
6
|
def Type._typeof(v)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
|
data/lib/lib/value_type.rb
CHANGED
@@ -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
|
|
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.
|
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-
|
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/
|
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/
|
37
|
-
- lib/lib/coopy/
|
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/
|
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/
|
44
|
-
- lib/lib/coopy/
|
45
|
-
- lib/lib/coopy/
|
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/
|
75
|
-
- lib/lib/
|
76
|
-
- lib/lib/
|
77
|
-
- lib/lib/
|
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/
|
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/
|
91
|
-
- lib/lib/
|
92
|
-
- lib/lib/
|
93
|
-
- lib/lib/
|
94
|
-
-
|
95
|
-
-
|
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:
|
115
|
+
rubygems_version: 2.2.2
|
118
116
|
signing_key:
|
119
|
-
specification_version:
|
120
|
-
summary:
|
117
|
+
specification_version: 4
|
118
|
+
summary: '[](https://travis-ci.org/paulfitz/daff)
|
121
119
|
[](http://badge.fury.io/js/daff)
|
122
120
|
[](http://badge.fury.io/rb/daff)
|
123
121
|
[](http://badge.fury.io/py/daff)
|
@@ -129,8 +127,9 @@ summary: ! '[ # 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: ! '[, 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! [](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
|