monolens 0.2.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/bin/monolens +11 -0
  4. data/lib/monolens/array/compact.rb +2 -2
  5. data/lib/monolens/array/join.rb +2 -2
  6. data/lib/monolens/array/map.rb +45 -6
  7. data/lib/monolens/array.rb +2 -2
  8. data/lib/monolens/coerce/date.rb +22 -6
  9. data/lib/monolens/coerce/date_time.rb +30 -6
  10. data/lib/monolens/coerce/integer.rb +15 -0
  11. data/lib/monolens/coerce/string.rb +13 -0
  12. data/lib/monolens/coerce.rb +12 -3
  13. data/lib/monolens/command.rb +96 -0
  14. data/lib/monolens/core/chain.rb +2 -2
  15. data/lib/monolens/core/dig.rb +52 -0
  16. data/lib/monolens/core/mapping.rb +23 -3
  17. data/lib/monolens/core.rb +6 -0
  18. data/lib/monolens/error.rb +9 -2
  19. data/lib/monolens/error_handler.rb +21 -0
  20. data/lib/monolens/file.rb +2 -7
  21. data/lib/monolens/lens/fetch_support.rb +19 -0
  22. data/lib/monolens/lens/location.rb +17 -0
  23. data/lib/monolens/lens/options.rb +41 -0
  24. data/lib/monolens/lens.rb +39 -23
  25. data/lib/monolens/object/extend.rb +53 -0
  26. data/lib/monolens/object/keys.rb +8 -10
  27. data/lib/monolens/object/rename.rb +3 -3
  28. data/lib/monolens/object/select.rb +71 -15
  29. data/lib/monolens/object/transform.rb +34 -12
  30. data/lib/monolens/object/values.rb +34 -10
  31. data/lib/monolens/object.rb +6 -0
  32. data/lib/monolens/skip/null.rb +1 -1
  33. data/lib/monolens/str/downcase.rb +2 -2
  34. data/lib/monolens/str/split.rb +2 -2
  35. data/lib/monolens/str/strip.rb +3 -1
  36. data/lib/monolens/str/upcase.rb +2 -2
  37. data/lib/monolens/version.rb +1 -1
  38. data/lib/monolens.rb +6 -0
  39. data/spec/fixtures/coerce.yml +3 -2
  40. data/spec/fixtures/transform.yml +5 -4
  41. data/spec/monolens/array/test_map.rb +89 -6
  42. data/spec/monolens/coerce/test_date.rb +34 -4
  43. data/spec/monolens/coerce/test_datetime.rb +70 -7
  44. data/spec/monolens/coerce/test_integer.rb +46 -0
  45. data/spec/monolens/coerce/test_string.rb +15 -0
  46. data/spec/monolens/command/map-upcase.lens.yml +5 -0
  47. data/spec/monolens/command/names-with-null.json +5 -0
  48. data/spec/monolens/command/names.json +4 -0
  49. data/spec/monolens/command/robust-map-upcase.lens.yml +7 -0
  50. data/spec/monolens/core/test_dig.rb +78 -0
  51. data/spec/monolens/core/test_mapping.rb +53 -11
  52. data/spec/monolens/lens/test_options.rb +73 -0
  53. data/spec/monolens/object/test_extend.rb +94 -0
  54. data/spec/monolens/object/test_keys.rb +54 -22
  55. data/spec/monolens/object/test_rename.rb +1 -1
  56. data/spec/monolens/object/test_select.rb +217 -4
  57. data/spec/monolens/object/test_transform.rb +93 -6
  58. data/spec/monolens/object/test_values.rb +110 -12
  59. data/spec/monolens/test_command.rb +128 -0
  60. data/spec/monolens/test_error_traceability.rb +60 -0
  61. data/spec/monolens/test_lens.rb +1 -1
  62. data/spec/test_readme.rb +7 -5
  63. metadata +37 -2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monolens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bmg
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Data transformations inspired by Cambria lenses
56
70
  email: blambeau@gmail.com
57
71
  executables: []
@@ -62,6 +76,7 @@ files:
62
76
  - LICENSE.md
63
77
  - README.md
64
78
  - Rakefile
79
+ - bin/monolens
65
80
  - lib/monolens.rb
66
81
  - lib/monolens/array.rb
67
82
  - lib/monolens/array/compact.rb
@@ -70,13 +85,22 @@ files:
70
85
  - lib/monolens/coerce.rb
71
86
  - lib/monolens/coerce/date.rb
72
87
  - lib/monolens/coerce/date_time.rb
88
+ - lib/monolens/coerce/integer.rb
89
+ - lib/monolens/coerce/string.rb
90
+ - lib/monolens/command.rb
73
91
  - lib/monolens/core.rb
74
92
  - lib/monolens/core/chain.rb
93
+ - lib/monolens/core/dig.rb
75
94
  - lib/monolens/core/mapping.rb
76
95
  - lib/monolens/error.rb
96
+ - lib/monolens/error_handler.rb
77
97
  - lib/monolens/file.rb
78
98
  - lib/monolens/lens.rb
99
+ - lib/monolens/lens/fetch_support.rb
100
+ - lib/monolens/lens/location.rb
101
+ - lib/monolens/lens/options.rb
79
102
  - lib/monolens/object.rb
103
+ - lib/monolens/object/extend.rb
80
104
  - lib/monolens/object/keys.rb
81
105
  - lib/monolens/object/rename.rb
82
106
  - lib/monolens/object/select.rb
@@ -98,7 +122,16 @@ files:
98
122
  - spec/monolens/array/test_map.rb
99
123
  - spec/monolens/coerce/test_date.rb
100
124
  - spec/monolens/coerce/test_datetime.rb
125
+ - spec/monolens/coerce/test_integer.rb
126
+ - spec/monolens/coerce/test_string.rb
127
+ - spec/monolens/command/map-upcase.lens.yml
128
+ - spec/monolens/command/names-with-null.json
129
+ - spec/monolens/command/names.json
130
+ - spec/monolens/command/robust-map-upcase.lens.yml
131
+ - spec/monolens/core/test_dig.rb
101
132
  - spec/monolens/core/test_mapping.rb
133
+ - spec/monolens/lens/test_options.rb
134
+ - spec/monolens/object/test_extend.rb
102
135
  - spec/monolens/object/test_keys.rb
103
136
  - spec/monolens/object/test_rename.rb
104
137
  - spec/monolens/object/test_select.rb
@@ -109,6 +142,8 @@ files:
109
142
  - spec/monolens/str/test_split.rb
110
143
  - spec/monolens/str/test_strip.rb
111
144
  - spec/monolens/str/test_upcase.rb
145
+ - spec/monolens/test_command.rb
146
+ - spec/monolens/test_error_traceability.rb
112
147
  - spec/monolens/test_lens.rb
113
148
  - spec/spec_helper.rb
114
149
  - spec/test_monolens.rb