inci_score 2.2.0 → 2.2.1

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
  SHA1:
3
- metadata.gz: 1ebdee369644b8101b581422186444045721e4fe
4
- data.tar.gz: e1415f118ec88be4a4c6e7dcf5326e54cb390669
3
+ metadata.gz: 8bc9d1f6ee80c730c5d5f12837fed8d774950369
4
+ data.tar.gz: ccb0394552ba0e2966c5260e84c338aa61b58a09
5
5
  SHA512:
6
- metadata.gz: 7eaede4cffde022ff2ca533a4658bcfa7735234549fcb35f66f8d2373bfb6998ba22171c897f0637f8520e2d8c4de2a369c9ef3d0ab043cb18dec5fa4032a632
7
- data.tar.gz: 5a6a3adb64504755a04f22098c06037a5a6b9283a1509c0e26518ed4640f80c69c3bc69d678c04dd23593c23783babb4840a8eaa5266bdd01058372a933d6935
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 Web API (read below) and when printing them to standard output.
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
- 0 - aqua
88
- 4 - dimethicone
89
- 3 - peg-10
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 each library three times, picking the best lap.
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"
@@ -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 @workers > 1
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
@@ -1,3 +1,3 @@
1
1
  module InciScore
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
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.0
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-04 00:00:00.000000000 Z
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