dreader 0.5.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.org +92 -0
- data/Gemfile.lock +20 -7
- data/README.org +821 -0
- data/dreader.gemspec +6 -4
- data/examples/age/age.rb +41 -25
- data/examples/age_with_multiple_checks/Birthdays.ods +0 -0
- data/examples/age_with_multiple_checks/age_with_multiple_checks.rb +64 -0
- data/examples/local_vars/local_vars.rb +28 -0
- data/examples/template/template_generation.rb +37 -0
- data/examples/wikipedia_big_us_cities/big_us_cities.rb +24 -20
- data/examples/wikipedia_us_cities/us_cities.rb +31 -28
- data/examples/wikipedia_us_cities/us_cities_bulk_declare.rb +25 -23
- data/lib/dreader/column.rb +39 -0
- data/lib/dreader/engine.rb +495 -0
- data/lib/dreader/options.rb +16 -0
- data/lib/dreader/util.rb +86 -0
- data/lib/dreader/version.rb +1 -1
- data/lib/dreader.rb +5 -411
- metadata +60 -24
- data/Changelog.org +0 -20
- data/README.md +0 -469
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40c16cce6fa4d2c813f381b7adefd8a6dd241db8b2133188aaf483c433e054ed
|
4
|
+
data.tar.gz: 4a35caf1ee4703628db442a9852090dbe87055301c0963ba00580bc7eb9f4e38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17fc5631ac685e5117d6ef9c1199422c7ef9a347c8d05436b2fd28fbf421465a9035930c0f45adcc19bc94279bf7ff2ba8a4f7f6b932ef2befcc82743e03ee4
|
7
|
+
data.tar.gz: 9a124ddd059c973710800f2b058482b13d155852e0ebb1740e54e90d92100396f9b391a17806c9e1f561c527680d0ab50d59ef3b2162f1fa9ce5da350b29fe3a
|
data/CHANGELOG.org
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
#+TITLE: Changelog
|
2
|
+
|
3
|
+
|
4
|
+
* Version 1.1.0
|
5
|
+
** Fixes an issue with visibility of variables
|
6
|
+
|
7
|
+
Version 1.1.0 makes Engine a module and requires to use extend
|
8
|
+
|
9
|
+
This allows to isolate declarations in different variables.
|
10
|
+
|
11
|
+
|
12
|
+
** Renames process to mappings
|
13
|
+
|
14
|
+
** Renames the variables in a more consistent way
|
15
|
+
|
16
|
+
#+begin_example ruby
|
17
|
+
attr_accessor :declared_options
|
18
|
+
# the specification of the columns to process
|
19
|
+
attr_accessor :declared_columns
|
20
|
+
# some example lines
|
21
|
+
attr_accessor :declared_examples
|
22
|
+
# the specification of the virtual columns
|
23
|
+
attr_accessor :declared_virtual_columns
|
24
|
+
# the mapping rules
|
25
|
+
attr_accessor :declared_mapping
|
26
|
+
#+end_example
|
27
|
+
|
28
|
+
** Declares =data= as a synonym of =table=
|
29
|
+
** Adds options to do everything in one pass
|
30
|
+
|
31
|
+
By passing the options
|
32
|
+
|
33
|
+
- =virtual=
|
34
|
+
- =mapping=
|
35
|
+
|
36
|
+
to =read= you can read and process the data in one step.
|
37
|
+
|
38
|
+
See the README for more details.
|
39
|
+
|
40
|
+
** Revises the logging messages
|
41
|
+
** Refactor some code to make it more readable
|
42
|
+
** Refactors the restructure function to make it more flexible
|
43
|
+
|
44
|
+
Now refactor takes as input symbols and hashes and reshapes
|
45
|
+
according to the specification.
|
46
|
+
|
47
|
+
See the README for an example.
|
48
|
+
|
49
|
+
|
50
|
+
* Version 1.0.0
|
51
|
+
** Changes the DSL to allow declaration in a class
|
52
|
+
|
53
|
+
The preferred way of using Dreader is by declaring options, column,
|
54
|
+
..., in a class and then instantiate the class and do the work
|
55
|
+
|
56
|
+
See the README for more details.
|
57
|
+
|
58
|
+
** The bulk_declare method has been removed. Use ~columns~ instead
|
59
|
+
|
60
|
+
* Version 0.6.2
|
61
|
+
** Adds row_errors and row_numbers in the hash of a row
|
62
|
+
** Support ~{ a: 'A' }~ notation also in column
|
63
|
+
** Now uses a logger and allows to specify logger and logger_level outside the class
|
64
|
+
|
65
|
+
If you pass the read a =logger:= and/or a =logger_level:=, dreader
|
66
|
+
will now honor them and log to the logger you specified, rather
|
67
|
+
than to standard output
|
68
|
+
|
69
|
+
* Version 0.5.0
|
70
|
+
** Fixes issues with Gem declaration
|
71
|
+
|
72
|
+
* Version 0.4.2
|
73
|
+
** Better error messages for process and check functions
|
74
|
+
dreader now captures exceptions raised by process and check and
|
75
|
+
prints and error message to stdout if an error is found.
|
76
|
+
the exception is then propagated in the standard way.
|
77
|
+
** New method bulk_declare
|
78
|
+
bulk_declare allow to easily declare columns which don't need a
|
79
|
+
specific treatment
|
80
|
+
** Read will now complains if the argument passed is not a hash
|
81
|
+
** Virtualcols is now accessible (attr_reader)
|
82
|
+
** Fixed a bug with slice
|
83
|
+
|
84
|
+
* Version 0.4.1
|
85
|
+
** Fixed an issue with ~read~: it always required a hash as input
|
86
|
+
** Changed syntax of ~debug~, which now accepts a hash as argument
|
87
|
+
This makes its syntax similar to ~read~.
|
88
|
+
** Improved output of ~debug~
|
89
|
+
By default ~debug~ now prints the output of ~process~ and ~check~.
|
90
|
+
You can disable this feature by passing ~process: false~ and/or ~check:
|
91
|
+
false~ to the ~debug~. Notice that ~check~ implies ~process~.
|
92
|
+
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,39 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dreader (
|
4
|
+
dreader (1.2.0)
|
5
|
+
fast_excel
|
5
6
|
roo
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
debug (1.8.0)
|
12
|
+
irb (>= 1.5.0)
|
13
|
+
reline (>= 0.3.1)
|
14
|
+
fast_excel (0.4.1)
|
15
|
+
ffi (> 1.9, < 2)
|
16
|
+
ffi (1.16.2)
|
17
|
+
io-console (0.6.0)
|
18
|
+
irb (1.7.2)
|
19
|
+
reline (>= 0.3.6)
|
20
|
+
nokogiri (1.15.4-x86_64-linux)
|
21
|
+
racc (~> 1.4)
|
22
|
+
racc (1.7.1)
|
13
23
|
rake (10.5.0)
|
14
|
-
|
24
|
+
reline (0.3.6)
|
25
|
+
io-console (~> 0.5)
|
26
|
+
roo (2.10.0)
|
15
27
|
nokogiri (~> 1)
|
16
|
-
rubyzip (>= 1.
|
17
|
-
rubyzip (
|
28
|
+
rubyzip (>= 1.3.0, < 3.0.0)
|
29
|
+
rubyzip (2.3.2)
|
18
30
|
|
19
31
|
PLATFORMS
|
20
32
|
ruby
|
21
33
|
|
22
34
|
DEPENDENCIES
|
23
35
|
bundler (~> 1.16)
|
36
|
+
debug (>= 1.0.0)
|
24
37
|
dreader!
|
25
38
|
rake (~> 10.0)
|
26
39
|
|