rql_parser 0.0.1alpha2 → 0.0.1alpha3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 719fb3cc6b383537faf3cb1e886407d3a5a748233529ada78720e7456dc775c9
4
- data.tar.gz: c48c4574afa0f65020dc1dac83172d880b26c7da71f117905332bd14735ac8cf
3
+ metadata.gz: d59c753d26bd53b0ad5a268acb1ce5b4bcb40f1d4f0682f2834e5dab4bafa968
4
+ data.tar.gz: 37c54da788af245b197765af41ec6069cc16b829bf47bed9f3bdc6d8c85a1d21
5
5
  SHA512:
6
- metadata.gz: afa5f03569a03c0704cd44fbcd235dd556a02055b8b565252c9b8ce1b6babb94c865058e896f92f902e268c7ab79b63afabbb08d3347cb1237e9feb9107f9a77
7
- data.tar.gz: ffbc7089e67aa8bfeb406e6275adb5ac3c6a4b8226ab2d2fbff13433ea75fd1c86500f6678f5beab3376e92cbbc1abd2021da19da24ee5b22227930356f9f21a
6
+ metadata.gz: 067bca6a134e1c4e93d4db0bd75a87ad709f25c1d5bc6dbc398d8040a09e4bd6a0396285e8e963add7d828903b65b3303118c64f7224025dfc07fddafc2be490
7
+ data.tar.gz: 4fd670220b3f9694d70d5bc42c30a957b2e740ce17f1d648bee1349a274863de6c9eb0c09fbed016c7863e64316b252a3394793e9fdff3da6c41d9be5f5b6ab2
data/README.md CHANGED
@@ -18,7 +18,17 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- > TODO: Write usage instructions here
21
+ See [ActiveInteraction](https://github.com/AaronLasseigne/active_interaction)
22
+
23
+ ```ruby
24
+ # in controller
25
+ output = RqlParser::FromParams.run(params.to_unsafe_hash)
26
+ # or
27
+ rql = 'eq(hello,world)&ruby=eq=awesome' # your RQL query here
28
+ output = RqlParser::Parse.run(rql)
29
+ ```
30
+
31
+ `output.result` yields a binary tree representing the query.
22
32
 
23
33
  ## Development
24
34
 
@@ -0,0 +1,13 @@
1
+ module RqlParser
2
+ class BaseInteraction < ActiveInteraction::Base
3
+ private
4
+
5
+ def perform(interaction)
6
+ if interaction.valid?
7
+ interaction.result
8
+ else
9
+ errors.merge!(interaction.errors)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module RqlParser
2
- VERSION = '0.0.1alpha2'.freeze
2
+ VERSION = '0.0.1alpha3'.freeze
3
3
  end
data/lib/rql_parser.rb CHANGED
@@ -1,6 +1,5 @@
1
- require "rql_parser/version"
1
+ require 'active_interaction'
2
+
3
+ module RqlParser; end
2
4
 
3
- module RqlParser
4
- class Error < StandardError; end
5
- # Your code goes here...
6
- end
5
+ require "rql_parser/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rql_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1alpha2
4
+ version: 0.0.1alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aliaksei Kharkou
@@ -69,8 +69,8 @@ files:
69
69
  - Rakefile
70
70
  - bin/console
71
71
  - bin/setup
72
- - lib/base_interaction.rb
73
72
  - lib/rql_parser.rb
73
+ - lib/rql_parser/base_interaction.rb
74
74
  - lib/rql_parser/format.rb
75
75
  - lib/rql_parser/from_params.rb
76
76
  - lib/rql_parser/parse.rb
@@ -1,13 +0,0 @@
1
- require 'active_interaction'
2
-
3
- class BaseInteraction < ActiveInteraction::Base
4
- private
5
-
6
- def perform(interaction)
7
- if interaction.valid?
8
- interaction.result
9
- else
10
- errors.merge!(interaction.errors)
11
- end
12
- end
13
- end