accept_language 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE.md} +1 -1
- data/README.md +13 -21
- data/lib/accept_language.rb +1 -1
- data/lib/accept_language/intersection.rb +1 -1
- data/lib/accept_language/parser.rb +1 -1
- metadata +91 -50
- data/.gitignore +0 -8
- data/.rspec +0 -3
- data/.rubocop.yml +0 -1
- data/.rubocop_todo.yml +0 -29
- data/.travis.yml +0 -7
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -5
- data/Gemfile.lock +0 -61
- data/Rakefile +0 -20
- data/VERSION.semver +0 -1
- data/accept_language.gemspec +0 -29
- data/bin/console +0 -8
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b2ef71586c1b52c839323443779e12b8feff9b54aa818b11d427762b1fac5ae
|
4
|
+
data.tar.gz: 99f4391638e32daa51aac44ca008cef6bfaf37a4a40a3ffdab10959dcb023753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b61d1f98342c9e8e90bd72c9b3c906a9b52c01f8adb7a1edd7165a6303c61dbd8e202cfdc45eb9d8f1d57ab855052bc2d8c6bfac4e73c2b4a3df95be70bed24
|
7
|
+
data.tar.gz: 2cd335536235546b9c95b2ebcca1f6cfadfa9a0c9d03b5d33f3cc1a6b8965bec958ada7a79c78248ca7f8d7aa083ee42d3e5181b1496f717d99f9768c1c94213
|
data/{LICENSE.txt → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ A tiny library for parsing the `Accept-Language` header from browsers (as define
|
|
5
5
|
## Status
|
6
6
|
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/accept_language.svg)](https://badge.fury.io/rb/accept_language)
|
8
|
-
[![
|
8
|
+
[![Build Status](https://travis-ci.org/cyril/accept_language.rb.svg?branch=master)](https://travis-ci.org/cyril/accept_language.rb)
|
9
9
|
[![Inline Docs](https://inch-ci.org/github/cyril/accept_language.rb.svg)](https://inch-ci.org/github/cyril/accept_language.rb)
|
10
10
|
|
11
11
|
## Installation
|
@@ -13,7 +13,7 @@ A tiny library for parsing the `Accept-Language` header from browsers (as define
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem
|
16
|
+
gem "accept_language"
|
17
17
|
```
|
18
18
|
|
19
19
|
And then execute:
|
@@ -31,8 +31,8 @@ It's intended to be used in a Web server that supports some level of internation
|
|
31
31
|
Examples:
|
32
32
|
|
33
33
|
```ruby
|
34
|
-
AcceptLanguage.parse(
|
35
|
-
AcceptLanguage.parse(
|
34
|
+
AcceptLanguage.parse("da, en-gb;q=0.8, en;q=0.7") # => {:da=>1.0, :"en-gb"=>0.8, :en=>0.7}
|
35
|
+
AcceptLanguage.parse("fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5") # => {:"fr-ch"=>1.0, :fr=>0.9, :en=>0.8, :de=>0.7, :*=>0.5}
|
36
36
|
```
|
37
37
|
|
38
38
|
In order to help facilitate better i18n, a method is provided to return the intersection of the languages the user prefers and the languages your application supports.
|
@@ -40,13 +40,13 @@ In order to help facilitate better i18n, a method is provided to return the inte
|
|
40
40
|
Examples:
|
41
41
|
|
42
42
|
```ruby
|
43
|
-
AcceptLanguage.intersection(
|
44
|
-
AcceptLanguage.intersection(
|
45
|
-
AcceptLanguage.intersection(
|
46
|
-
AcceptLanguage.intersection(
|
47
|
-
AcceptLanguage.intersection(
|
48
|
-
AcceptLanguage.intersection(
|
49
|
-
AcceptLanguage.intersection(
|
43
|
+
AcceptLanguage.intersection("da, en-gb;q=0.8, en;q=0.7", :ja, :ro, :da) # => :da
|
44
|
+
AcceptLanguage.intersection("da, en-gb;q=0.8, en;q=0.7", :ja, :ro) # => nil
|
45
|
+
AcceptLanguage.intersection("fr-CH", :fr, two_letter_truncate: false) # => nil
|
46
|
+
AcceptLanguage.intersection("fr-CH", :fr, two_letter_truncate: true) # => :fr
|
47
|
+
AcceptLanguage.intersection("de, zh;q=0.4, fr;q=0", :fr) # => nil
|
48
|
+
AcceptLanguage.intersection("de, zh;q=0.4, *;q=0.5, fr;q=0", :fr) # => nil
|
49
|
+
AcceptLanguage.intersection("de, zh;q=0.4, *;q=0.5, fr;q=0", :ar) # => :ar
|
50
50
|
```
|
51
51
|
|
52
52
|
### Rails integration example
|
@@ -61,9 +61,9 @@ class ApplicationController < ActionController::Base
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def best_locale_from_request
|
64
|
-
return I18n.default_locale unless request.headers.key?(
|
64
|
+
return I18n.default_locale unless request.headers.key?("HTTP_ACCEPT_LANGUAGE")
|
65
65
|
|
66
|
-
string = request.headers.fetch(
|
66
|
+
string = request.headers.fetch("HTTP_ACCEPT_LANGUAGE")
|
67
67
|
locale = AcceptLanguage.intersection(string, I18n.default_locale, *I18n.available_locales)
|
68
68
|
|
69
69
|
# If the server cannot serve any matching language,
|
@@ -77,10 +77,6 @@ class ApplicationController < ActionController::Base
|
|
77
77
|
end
|
78
78
|
```
|
79
79
|
|
80
|
-
## Contributing
|
81
|
-
|
82
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/cyril/accept_language.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
83
|
-
|
84
80
|
## Versioning
|
85
81
|
|
86
82
|
__AcceptLanguage__ uses [Semantic Versioning 2.0.0](https://semver.org/)
|
@@ -88,7 +84,3 @@ __AcceptLanguage__ uses [Semantic Versioning 2.0.0](https://semver.org/)
|
|
88
84
|
## License
|
89
85
|
|
90
86
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
91
|
-
|
92
|
-
## Code of Conduct
|
93
|
-
|
94
|
-
Everyone interacting in the AcceptLanguage project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cyril/accept_language.rb/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/accept_language.rb
CHANGED
@@ -7,7 +7,7 @@ module AcceptLanguage
|
|
7
7
|
# @see https://tools.ietf.org/html/rfc2616#section-14.4
|
8
8
|
module Parser
|
9
9
|
def self.call(raw_input, two_letter_truncate: false)
|
10
|
-
raw_input.to_s.delete(
|
10
|
+
raw_input.to_s.delete(" ").split(",").inject({}) do |hash, lang|
|
11
11
|
tag, quality = lang.split(/;q=/i)
|
12
12
|
next hash if tag.nil?
|
13
13
|
|
metadata
CHANGED
@@ -1,122 +1,164 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accept_language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
56
|
+
name: rubocop-md
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-performance
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-thread_safety
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
69
125
|
- !ruby/object:Gem::Dependency
|
70
126
|
name: simplecov
|
71
127
|
requirement: !ruby/object:Gem::Requirement
|
72
128
|
requirements:
|
73
|
-
- - "
|
129
|
+
- - ">="
|
74
130
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
131
|
+
version: '0'
|
76
132
|
type: :development
|
77
133
|
prerelease: false
|
78
134
|
version_requirements: !ruby/object:Gem::Requirement
|
79
135
|
requirements:
|
80
|
-
- - "
|
136
|
+
- - ">="
|
81
137
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
138
|
+
version: '0'
|
83
139
|
- !ruby/object:Gem::Dependency
|
84
140
|
name: yard
|
85
141
|
requirement: !ruby/object:Gem::Requirement
|
86
142
|
requirements:
|
87
|
-
- - "
|
143
|
+
- - ">="
|
88
144
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
145
|
+
version: '0'
|
90
146
|
type: :development
|
91
147
|
prerelease: false
|
92
148
|
version_requirements: !ruby/object:Gem::Requirement
|
93
149
|
requirements:
|
94
|
-
- - "
|
150
|
+
- - ">="
|
95
151
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
152
|
+
version: '0'
|
97
153
|
description: Parses the Accept-Language header from an HTTP request and produces a
|
98
154
|
hash of languages and qualities.
|
99
|
-
email:
|
100
|
-
- contact@cyril.email
|
155
|
+
email: contact@cyril.email
|
101
156
|
executables: []
|
102
157
|
extensions: []
|
103
158
|
extra_rdoc_files: []
|
104
159
|
files:
|
105
|
-
-
|
106
|
-
- ".rspec"
|
107
|
-
- ".rubocop.yml"
|
108
|
-
- ".rubocop_todo.yml"
|
109
|
-
- ".travis.yml"
|
110
|
-
- CODE_OF_CONDUCT.md
|
111
|
-
- Gemfile
|
112
|
-
- Gemfile.lock
|
113
|
-
- LICENSE.txt
|
160
|
+
- LICENSE.md
|
114
161
|
- README.md
|
115
|
-
- Rakefile
|
116
|
-
- VERSION.semver
|
117
|
-
- accept_language.gemspec
|
118
|
-
- bin/console
|
119
|
-
- bin/setup
|
120
162
|
- lib/accept_language.rb
|
121
163
|
- lib/accept_language/intersection.rb
|
122
164
|
- lib/accept_language/parser.rb
|
@@ -124,7 +166,7 @@ homepage: https://github.com/cyril/accept_language.rb
|
|
124
166
|
licenses:
|
125
167
|
- MIT
|
126
168
|
metadata: {}
|
127
|
-
post_install_message:
|
169
|
+
post_install_message:
|
128
170
|
rdoc_options: []
|
129
171
|
require_paths:
|
130
172
|
- lib
|
@@ -132,16 +174,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
174
|
requirements:
|
133
175
|
- - ">="
|
134
176
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
177
|
+
version: 2.7.0
|
136
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
179
|
requirements:
|
138
180
|
- - ">="
|
139
181
|
- !ruby/object:Gem::Version
|
140
182
|
version: '0'
|
141
183
|
requirements: []
|
142
|
-
|
143
|
-
|
144
|
-
signing_key:
|
184
|
+
rubygems_version: 3.2.15
|
185
|
+
signing_key:
|
145
186
|
specification_version: 4
|
146
187
|
summary: Parser for Accept-Language request HTTP header
|
147
188
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-06-14 00:44:48 +0200 using RuboCop version 0.71.0.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 1
|
10
|
-
Metrics/AbcSize:
|
11
|
-
Max: 18
|
12
|
-
|
13
|
-
# Offense count: 2
|
14
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
15
|
-
# ExcludedMethods: refine
|
16
|
-
Metrics/BlockLength:
|
17
|
-
Max: 75
|
18
|
-
|
19
|
-
# Offense count: 1
|
20
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
21
|
-
Metrics/MethodLength:
|
22
|
-
Max: 11
|
23
|
-
|
24
|
-
# Offense count: 8
|
25
|
-
# Cop supports --auto-correct.
|
26
|
-
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
27
|
-
# URISchemes: http, https
|
28
|
-
Metrics/LineLength:
|
29
|
-
Max: 112
|
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at contact@cyril.email. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
accept_language (1.0.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ast (2.4.0)
|
10
|
-
diff-lcs (1.3)
|
11
|
-
docile (1.3.2)
|
12
|
-
jaro_winkler (1.5.2)
|
13
|
-
json (2.2.0)
|
14
|
-
parallel (1.17.0)
|
15
|
-
parser (2.6.3.0)
|
16
|
-
ast (~> 2.4.0)
|
17
|
-
rainbow (3.0.0)
|
18
|
-
rake (10.5.0)
|
19
|
-
rspec (3.8.0)
|
20
|
-
rspec-core (~> 3.8.0)
|
21
|
-
rspec-expectations (~> 3.8.0)
|
22
|
-
rspec-mocks (~> 3.8.0)
|
23
|
-
rspec-core (3.8.1)
|
24
|
-
rspec-support (~> 3.8.0)
|
25
|
-
rspec-expectations (3.8.4)
|
26
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.8.0)
|
28
|
-
rspec-mocks (3.8.1)
|
29
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.8.0)
|
31
|
-
rspec-support (3.8.2)
|
32
|
-
rubocop (0.71.0)
|
33
|
-
jaro_winkler (~> 1.5.1)
|
34
|
-
parallel (~> 1.10)
|
35
|
-
parser (>= 2.6)
|
36
|
-
rainbow (>= 2.2.2, < 4.0)
|
37
|
-
ruby-progressbar (~> 1.7)
|
38
|
-
unicode-display_width (>= 1.4.0, < 1.7)
|
39
|
-
ruby-progressbar (1.10.1)
|
40
|
-
simplecov (0.16.1)
|
41
|
-
docile (~> 1.1)
|
42
|
-
json (>= 1.8, < 3)
|
43
|
-
simplecov-html (~> 0.10.0)
|
44
|
-
simplecov-html (0.10.2)
|
45
|
-
unicode-display_width (1.6.0)
|
46
|
-
yard (0.9.19)
|
47
|
-
|
48
|
-
PLATFORMS
|
49
|
-
ruby
|
50
|
-
|
51
|
-
DEPENDENCIES
|
52
|
-
accept_language!
|
53
|
-
bundler (~> 2.0)
|
54
|
-
rake (~> 10.0)
|
55
|
-
rspec (~> 3.0)
|
56
|
-
rubocop (~> 0.71)
|
57
|
-
simplecov (~> 0.16)
|
58
|
-
yard (~> 0.9)
|
59
|
-
|
60
|
-
BUNDLED WITH
|
61
|
-
2.0.1
|
data/Rakefile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
|
6
|
-
RSpec::Core::RakeTask.new(:spec)
|
7
|
-
|
8
|
-
require 'rubocop/rake_task'
|
9
|
-
|
10
|
-
RuboCop::RakeTask.new
|
11
|
-
|
12
|
-
namespace :test do
|
13
|
-
task :coverage do
|
14
|
-
ENV['COVERAGE'] = 'true'
|
15
|
-
Rake::Task['test'].invoke
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
task(:doc_stats) { ruby '-S yard stats' }
|
20
|
-
task default: %i[spec doc_stats rubocop]
|
data/VERSION.semver
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.0
|
data/accept_language.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'accept_language'
|
5
|
-
spec.version = File.read('VERSION.semver').chomp
|
6
|
-
spec.authors = ['Cyril Kato']
|
7
|
-
spec.email = ['contact@cyril.email']
|
8
|
-
|
9
|
-
spec.summary = 'Parser for Accept-Language request HTTP header'
|
10
|
-
spec.description = 'Parses the Accept-Language header from an HTTP ' \
|
11
|
-
'request and produces a hash of languages and qualities.'
|
12
|
-
spec.homepage = 'https://github.com/cyril/accept_language.rb'
|
13
|
-
spec.license = 'MIT'
|
14
|
-
|
15
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
16
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
17
|
-
end
|
18
|
-
|
19
|
-
spec.bindir = 'exe'
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = ['lib']
|
22
|
-
|
23
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
24
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
26
|
-
spec.add_development_dependency 'rubocop', '~> 0.71'
|
27
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
28
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
29
|
-
end
|
data/bin/console
DELETED