lazy_doc 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -21
- data/lib/lazy_doc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjE5Nzc1Y2ZiNTYzN2Q3ZGZmZjJlYTMxYzdlOGJkMGNjYTUwZDgzMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzczZTY4YTI0N2Y3OGU0YjYwMTQwYWM1MjkwMzczMzg0MWZlYTYyYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjI3NTY4MmU5MmY5OThjMzNhZDc2OGM2OTU2NTViYmYwNDFiMTkyMDgxZDZk
|
10
|
+
NDY1ZjIyZTlmMTVkYmNhYzkxMzBlZWRlNWU5MjRjYWQ0MWEwNDFkOTMyNGM5
|
11
|
+
ODhmMDg2ZTRmN2RiNmQ2MzcxMDNhNzMxNGY0MGNhZTc3ZDRhYTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWU5MmEyNTA3N2M2MTA3MGI1NDk5NjBiZTMyYzRkYTEwYmFlNDM1NTUwNGU5
|
14
|
+
NjUzZjBiNjI1ODA0MDIyMmQ5YzE3OTZlYTI2YzFmNGViNWMyNWQzZDI3YzJm
|
15
|
+
MjNhOWRlY2ZkOGE0NzU5MjI1ZWU0NWMwODU1N2FjMGE0MTNjZDk=
|
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# LazyDoc
|
2
2
|
|
3
|
-
NOTE: LazyDoc is currently in alpha and is not quite ready for use.
|
4
|
-
|
5
3
|
[![Build Status](https://travis-ci.org/ryanoglesby08/lazy-doc.png)](https://travis-ci.org/ryanoglesby08/lazy-doc)
|
6
4
|
|
7
5
|
|
@@ -12,7 +10,7 @@ LazyDoc provides a declarative DSL for extracting deeply nested values from a JS
|
|
12
10
|
parsed so that needed attributes from the document are only parsed when accessed. Finally, parsed values are cached
|
13
11
|
so that subsequent access does not access the JSON again.
|
14
12
|
|
15
|
-
*Currently, LazyDoc only supports JSON. XML support
|
13
|
+
*Currently, LazyDoc only supports JSON. XML support may be added later.*
|
16
14
|
|
17
15
|
## Installation
|
18
16
|
|
@@ -57,24 +55,6 @@ puts user.address
|
|
57
55
|
puts user.job
|
58
56
|
```
|
59
57
|
|
60
|
-
## To Do
|
61
|
-
|
62
|
-
1. DONE - Full path parsing more than just top level. ex: `access :name, via: [:profile, :basic_info, :name]`
|
63
|
-
2. DONE - Error throwing for incorrectly specified paths
|
64
|
-
3. DONE - Default value if json is null or empty. ex: `access :currency, default: 'USD'`
|
65
|
-
4. DONE - Transforms. ex: `access :name, finally: lambda { |name| name.gsub('-',' ') }`
|
66
|
-
5. DONE - Objects from sub-trees. ex: `access :profile, as: Profile` (This would construct a LazyDoc Profile object and pass the json found at "profile" to it)
|
67
|
-
6. Collections.
|
68
|
-
- DONE - Map. For example, extract array of customer names from array of customers. ex: `access :customers, extract: :name`
|
69
|
-
- DONE - Objects from collection. Instead of extracting just the name, extract whole objects like in #5. ex: `access :customers, as: Customer`
|
70
|
-
- Other Collection manipulations, select, inject, count, etc
|
71
|
-
7. Joins
|
72
|
-
- Using previously defined attributes. ex: `join :address, from: [:street, :city, :state:, :zip]`
|
73
|
-
- Defining attributes in place.
|
74
|
-
8. DONE - Multiple simple paths in one line (ex: `access :name, :street, :city, :state`)
|
75
|
-
9. DONE- Infer camelCase to snake_case and vice versa in JSON ex: `access :customer_name` (Where the json has customerName)
|
76
|
-
10. XML support
|
77
|
-
|
78
58
|
## Contributing
|
79
59
|
|
80
60
|
1. Fork it
|
data/lib/lazy_doc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_doc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Oglesby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|