tokite 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed46c4561bc0d16d27c9ea6bbc79b31b840e4e97
|
4
|
+
data.tar.gz: e348d0f776400676808b4b5fe3bb5f4257872af0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aa4f62ed0f3e02a80d51f7327fe5ae6368667a13a55661dcabfda6632e69b399dfe5469b3ae93a0dd8169f916a7b6ba5815c3b6f6ac8b9ce5df1ef8c33ea33d
|
7
|
+
data.tar.gz: '0951d5b98aec5e9ae357cee76d1f2f71891da7483f8db70ec035d5add538c3fb49a9f18e5c944b5027c89b8077efe4010abad6ef5e3cf44ae8dc29ddae73ad2a'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
@import "bulma/sass/utilities/initial-variables";
|
2
|
+
|
3
|
+
// Bootstrap like colors
|
4
|
+
$white: #fff;
|
5
|
+
$black: #000;
|
6
|
+
$red: #d9534f;
|
7
|
+
$orange: #f0ad4e;
|
8
|
+
$yellow: #ffd500;
|
9
|
+
$green: #5cb85c;
|
10
|
+
$blue: #0275d8;
|
11
|
+
$teal: #5bc0de;
|
12
|
+
$pink: #ff5b77;
|
13
|
+
$purple: #613d7c;
|
14
|
+
|
15
|
+
$primary: $blue;
|
16
|
+
$info: $teal;
|
17
|
+
$success: $green;
|
18
|
+
$warning: $orange;
|
19
|
+
$danger: $red;
|
20
|
+
$dark: $grey-darker;
|
21
|
+
$text: $grey-dark;
|
22
|
+
|
23
|
+
@import "bulma/bulma";
|
24
|
+
|
25
|
+
.vspace-40 {
|
26
|
+
margin: 40px 0;
|
27
|
+
}
|
@@ -22,7 +22,7 @@ module Tokite
|
|
22
22
|
rule(:quot_word) { quot >> quoted_char.repeat(1).as(:word) >> quot }
|
23
23
|
rule(:plain_word) { (match('[^\s/"]') >> match('[^\s]').repeat).as(:word) }
|
24
24
|
rule(:field) { match('\w').repeat(1).as(:field) }
|
25
|
-
rule(:word) { (field >> str(':')).maybe >> (regexp_word | quot_word | plain_word) }
|
25
|
+
rule(:word) { (field >> str(':') >> space?).maybe >> (regexp_word | quot_word | plain_word) }
|
26
26
|
|
27
27
|
rule(:query) { word >> (space >> word).repeat }
|
28
28
|
root :query
|
@@ -46,20 +46,17 @@ module Tokite
|
|
46
46
|
def match?(doc)
|
47
47
|
tree.all? do |word|
|
48
48
|
field = word[:field]
|
49
|
+
if field
|
50
|
+
targets = doc[field.to_sym] ? [doc[field.to_sym].downcase] : []
|
51
|
+
else
|
52
|
+
targets = doc.values.map(&:downcase)
|
53
|
+
end
|
49
54
|
if word[:regexp_word]
|
50
|
-
regexp = word[:regexp_word].to_s
|
51
|
-
|
52
|
-
doc[field.to_sym]&.match(regexp)
|
53
|
-
else
|
54
|
-
doc.values.any?{|text| text.match(regexp) }
|
55
|
-
end
|
55
|
+
regexp = word[:regexp_word].to_s.downcase
|
56
|
+
targets.any?{|text| text.match(regexp) }
|
56
57
|
else
|
57
|
-
value = word[:word].to_s
|
58
|
-
|
59
|
-
doc[field.to_sym]&.index(value)
|
60
|
-
else
|
61
|
-
doc.values.any?{|text| text.index(value) }
|
62
|
-
end
|
58
|
+
value = word[:word].to_s.downcase
|
59
|
+
targets.any?{|text| text.index(value) }
|
63
60
|
end
|
64
61
|
end
|
65
62
|
end
|
data/lib/tokite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tokite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hogelog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -176,7 +176,7 @@ files:
|
|
176
176
|
- Rakefile
|
177
177
|
- app/assets/config/tokite_manifest.js
|
178
178
|
- app/assets/javascripts/tokite/application.js
|
179
|
-
- app/assets/stylesheets/tokite/application.
|
179
|
+
- app/assets/stylesheets/tokite/application.scss
|
180
180
|
- app/controllers/tokite/application_controller.rb
|
181
181
|
- app/controllers/tokite/hooks_controller.rb
|
182
182
|
- app/controllers/tokite/rules_controller.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
-
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require bulma/bulma
|
14
|
-
*/
|
15
|
-
|
16
|
-
.vspace-40 {
|
17
|
-
margin: 40px 0;
|
18
|
-
}
|