inci_score 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/inci_score.gemspec +1 -0
- data/lib/inci_score/server.rb +5 -1
- data/lib/inci_score/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc9d1f6ee80c730c5d5f12837fed8d774950369
|
4
|
+
data.tar.gz: ccb0394552ba0e2966c5260e84c338aa61b58a09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 629adf023e81fa545af1dbb675abe4467ef9aae42bb9f22e73d691339a8e9e585e7719902cf2f3b09c9a4d64c46032d17e9d72d92a378ec6a8d4a4beb9ff8e25
|
7
|
+
data.tar.gz: 36af9780ea2534d18a92be8d122649596a692f18720d5da5eb63b1a44cc9d7c4afe6c55b9a57fc33810f61d8fba5811912481ec0f70b975c751fc7d26334a203
|
data/README.md
CHANGED
@@ -57,7 +57,7 @@ inci.score
|
|
57
57
|
=> 53.762874945799766
|
58
58
|
```
|
59
59
|
|
60
|
-
As you see the results are wrapped by an *InciScore::Response* object, this is useful when dealing with the
|
60
|
+
As you see the results are wrapped by an *InciScore::Response* object, this is useful when dealing with the CLI and HTTP interfaces (read below).
|
61
61
|
|
62
62
|
### Unrecognized components
|
63
63
|
The API treats unrecognized components as a common case by just marking the object as non valid and raise a warning in case more than 30% of the ingredients are not found.
|
@@ -84,9 +84,9 @@ TOTAL SCORE:
|
|
84
84
|
VALID STATE:
|
85
85
|
true
|
86
86
|
COMPONENTS (hazard - name):
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
aqua
|
88
|
+
dimethicone
|
89
|
+
peg-10
|
90
90
|
UNRECOGNIZED:
|
91
91
|
noent
|
92
92
|
```
|
@@ -98,7 +98,7 @@ inci_score --fresh --src="aqua, dimethicone"
|
|
98
98
|
```
|
99
99
|
|
100
100
|
### HTTP server
|
101
|
-
The CLI interface exposes a Web layer based on the [Puma](http://puma.io/) application server.
|
101
|
+
The CLI interface exposes a Web layer based on the [Puma](http://puma.io/) application server.
|
102
102
|
The HTTP server is started on the specified port by spawning as many workers as your current workstation supports:
|
103
103
|
```shell
|
104
104
|
inci_score --http=9292
|
@@ -107,7 +107,7 @@ Consider all other options are discarded when running HTTP server.
|
|
107
107
|
|
108
108
|
#### Triggering a request
|
109
109
|
The HTTP server responds with a JSON representation of the original *InciScore::Response* object.
|
110
|
-
You can pass the source string directly as a HTTP parameter:
|
110
|
+
You can pass the source string directly as a HTTP parameter (URI escaped):
|
111
111
|
|
112
112
|
```shell
|
113
113
|
curl http://127.0.0.1:9292?src=aqua,dimethicone
|
@@ -137,13 +137,14 @@ I registered these benchmarks with a MacBook PRO 15 mid 2015 having these specs:
|
|
137
137
|
* OSX El Captain
|
138
138
|
* 2,2 GHz Intel Core i7 (4 cores)
|
139
139
|
* 16 GB 1600 MHz DDR3
|
140
|
+
* Ruby 2.4
|
140
141
|
|
141
142
|
### Wrk
|
142
143
|
As always i used [wrk](https://github.com/wg/wrk) as the loading tool.
|
143
|
-
I measured
|
144
|
+
I measured the library three times, picking the best lap.
|
144
145
|
The following script command is used:
|
145
146
|
|
146
|
-
```
|
147
|
+
```shell
|
147
148
|
wrk -t 4 -c 100 -d 30s --timeout 2000 http://127.0.0.1:9292/?src=<list_of_ingredients>
|
148
149
|
```
|
149
150
|
|
data/inci_score.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_runtime_dependency "nokogiri", "~> 1.6"
|
20
20
|
s.add_runtime_dependency "puma", "~> 3"
|
21
|
+
s.add_runtime_dependency "rack", ">= 1.6"
|
21
22
|
s.add_runtime_dependency "RubyInline", "~> 3"
|
22
23
|
|
23
24
|
s.add_development_dependency "bundler", "~> 1.11"
|
data/lib/inci_score/server.rb
CHANGED
@@ -28,10 +28,14 @@ module InciScore
|
|
28
28
|
@config_klass.new do |c|
|
29
29
|
c.rackup RACKUP_FILE
|
30
30
|
c.bind "tcp://#{DEFAULT_HOST}:#{@port}"
|
31
|
-
c.workers @workers if
|
31
|
+
c.workers @workers if workers?
|
32
32
|
c.threads *@threads
|
33
33
|
c.preload_app! if @preload
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
private def workers?
|
38
|
+
@workers > 1 && !Puma.jruby? && !Puma.windows?
|
39
|
+
end
|
36
40
|
end
|
37
41
|
end
|
data/lib/inci_score/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inci_score
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- costajob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rack
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: RubyInline
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|