relaxed_cookiejar 0.1.0 → 0.1.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
- SHA1:
3
- metadata.gz: cd92f43d1d87ec9ffe186ab670d3445a91acfac4
4
- data.tar.gz: 7767f1ce2d6232b6ed633335ee40bac129654296
2
+ SHA256:
3
+ metadata.gz: 6e885dd852d45a5aac76685f8acb3bfb5af4d2f53623c7848b413366f20c7ee2
4
+ data.tar.gz: 7f52b6553e3cdd409d9051b41c47df4858246902fd4047fccd4430066e093605
5
5
  SHA512:
6
- metadata.gz: d435aa0c267fe09f072ea3dafcd3f5b34829e7bf91f1c94818c1b14732c552bf40a164bd0256a15371ee5337c8fda4123b49a18b9a463089795a6d9e46533321
7
- data.tar.gz: c9d84d5082412d2403638fd47cfe4f6d89689d251d1a14f5c53f0f41372d68d8e11565428a6c99af99bdd21a98ba6502dd6283f1e1501626e1fdfa8b881bd924
6
+ metadata.gz: 1f3e17eb09471dc95beedfb5cba3b129e1875ef23571fbe06e7f6882265c83b6b686a679424b2e06f3e563997abc2a90fdf1fe2120d51a342f05e429c938c529
7
+ data.tar.gz: c7ec9844c62e072f71f3b47cb8de8c6386f20633e7f4f3f4638918ab521f194a34f5e374fbc5486250731835ebacf1e092ec4f47fd3ca56fe83907391ae66085
data/Dockerfile CHANGED
@@ -1,62 +1,62 @@
1
- FROM ruby:2.4.2
2
-
3
- # Bundler options
4
- #
5
- # The default value is taken from Travis's build options, so they should be
6
- # good enough for most cases. For development, be sure to set a blank default
7
- # in docker-compose.override.yml.
8
- ARG BUNDLER_OPTS="--jobs=3 \
9
- --retry=3 \
10
- --deployment"
11
-
12
- # The home directory of the gem.
13
- #
14
- # During development, make sure that the APP_DIR environment variable is
15
- # identical to the variable in your docker-compose.override.yml file,
16
- # otherwise things might not work as expected.
17
- ENV APP_DIR="/opt/relaxed_cookiejar"
18
-
19
- # Install required packages
20
- # RUN apt-get update -y \
21
- # && apt-get install -y --no-install-recommends \
22
- # git-core \
23
- # build-essential \
24
- # libffi-dev \
25
- # libxml2-dev \
26
- # libssl-dev \
27
- # libcurl4-gnutls-dev \
28
- # apt-utils \
29
- # && rm -rf /var/lib/apt/lists/*
30
-
31
- # Create a non-root user
32
- RUN groupadd -r travis \
33
- && useradd -m -r -g travis travis
34
- RUN mkdir -p ${APP_DIR} \
35
- && chown -R travis:travis ${APP_DIR}
36
-
37
- # Move the the application folder to perform all the following tasks.
38
- WORKDIR ${APP_DIR}
39
- # Use the non-root user to perform any commands from this point forward.
40
- #
41
- # NOTE: The COPY command requires the --chown flag set otherwise it will
42
- # copy things as root.
43
- USER travis
44
-
45
- # Copy the gem's gemspec file so `bundle install` can run when the
46
- # container is initialized.
47
- #
48
- # The added benefit is that Docker will cache this file and will not trigger
49
- # the bundle install unless the gemspec changed on the filesystem.
50
- #
51
- # NOTE: If the command fails because of the --chown flag, make sure you have a
52
- # recent stable version of Docker.
53
- COPY --chown=travis:travis . ./
54
-
55
-
56
- RUN bundle install ${BUNDLER_OPTS}
57
-
58
- # Copy over the files, in case the Docker Compose file does not specify a
59
- # mount point.
60
- COPY --chown=travis:travis . ./
61
-
1
+ FROM ruby:2.4.2
2
+
3
+ # Bundler options
4
+ #
5
+ # The default value is taken from Travis's build options, so they should be
6
+ # good enough for most cases. For development, be sure to set a blank default
7
+ # in docker-compose.override.yml.
8
+ ARG BUNDLER_OPTS="--jobs=3 \
9
+ --retry=3 \
10
+ --deployment"
11
+
12
+ # The home directory of the gem.
13
+ #
14
+ # During development, make sure that the APP_DIR environment variable is
15
+ # identical to the variable in your docker-compose.override.yml file,
16
+ # otherwise things might not work as expected.
17
+ ENV APP_DIR="/opt/relaxed_cookiejar"
18
+
19
+ # Install required packages
20
+ # RUN apt-get update -y \
21
+ # && apt-get install -y --no-install-recommends \
22
+ # git-core \
23
+ # build-essential \
24
+ # libffi-dev \
25
+ # libxml2-dev \
26
+ # libssl-dev \
27
+ # libcurl4-gnutls-dev \
28
+ # apt-utils \
29
+ # && rm -rf /var/lib/apt/lists/*
30
+
31
+ # Create a non-root user
32
+ RUN groupadd -r travis \
33
+ && useradd -m -r -g travis travis
34
+ RUN mkdir -p ${APP_DIR} \
35
+ && chown -R travis:travis ${APP_DIR}
36
+
37
+ # Move the the application folder to perform all the following tasks.
38
+ WORKDIR ${APP_DIR}
39
+ # Use the non-root user to perform any commands from this point forward.
40
+ #
41
+ # NOTE: The COPY command requires the --chown flag set otherwise it will
42
+ # copy things as root.
43
+ USER travis
44
+
45
+ # Copy the gem's gemspec file so `bundle install` can run when the
46
+ # container is initialized.
47
+ #
48
+ # The added benefit is that Docker will cache this file and will not trigger
49
+ # the bundle install unless the gemspec changed on the filesystem.
50
+ #
51
+ # NOTE: If the command fails because of the --chown flag, make sure you have a
52
+ # recent stable version of Docker.
53
+ COPY --chown=travis:travis . ./
54
+
55
+
56
+ RUN bundle install ${BUNDLER_OPTS}
57
+
58
+ # Copy over the files, in case the Docker Compose file does not specify a
59
+ # mount point.
60
+ COPY --chown=travis:travis . ./
61
+
62
62
  CMD ["bash"]
data/Gemfile.lock CHANGED
@@ -1,49 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaxed_cookiejar (0.1.0)
5
- cookiejar (= 0.3.3)
4
+ relaxed_cookiejar (0.1.1)
5
+ cookiejar (>= 0.3.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- coderay (1.1.2)
11
- cookiejar (0.3.3)
12
- diff-lcs (1.3)
13
- docile (1.1.5)
14
- json (2.1.0)
15
- method_source (0.9.0)
16
- pry (0.11.3)
17
- coderay (~> 1.1.0)
18
- method_source (~> 0.9.0)
10
+ coderay (1.1.3)
11
+ cookiejar (0.3.4)
12
+ diff-lcs (1.5.1)
13
+ docile (1.4.0)
14
+ method_source (1.1.0)
15
+ pry (0.14.2)
16
+ coderay (~> 1.1)
17
+ method_source (~> 1.0)
19
18
  rake (10.5.0)
20
- rspec (3.7.0)
21
- rspec-core (~> 3.7.0)
22
- rspec-expectations (~> 3.7.0)
23
- rspec-mocks (~> 3.7.0)
24
- rspec-collection_matchers (1.1.3)
19
+ rspec (3.13.0)
20
+ rspec-core (~> 3.13.0)
21
+ rspec-expectations (~> 3.13.0)
22
+ rspec-mocks (~> 3.13.0)
23
+ rspec-collection_matchers (1.2.1)
25
24
  rspec-expectations (>= 2.99.0.beta1)
26
- rspec-core (3.7.1)
27
- rspec-support (~> 3.7.0)
28
- rspec-expectations (3.7.0)
25
+ rspec-core (3.13.0)
26
+ rspec-support (~> 3.13.0)
27
+ rspec-expectations (3.13.0)
29
28
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.7.0)
31
- rspec-mocks (3.7.0)
29
+ rspec-support (~> 3.13.0)
30
+ rspec-mocks (3.13.1)
32
31
  diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.7.0)
34
- rspec-support (3.7.1)
35
- simplecov (0.15.1)
36
- docile (~> 1.1.0)
37
- json (>= 1.8, < 3)
38
- simplecov-html (~> 0.10.0)
39
- simplecov-html (0.10.2)
32
+ rspec-support (~> 3.13.0)
33
+ rspec-support (3.13.1)
34
+ simplecov (0.22.0)
35
+ docile (~> 1.1)
36
+ simplecov-html (~> 0.11)
37
+ simplecov_json_formatter (~> 0.1)
38
+ simplecov-html (0.12.3)
39
+ simplecov_json_formatter (0.1.4)
40
40
 
41
41
  PLATFORMS
42
42
  ruby
43
- x64-mingw32
43
+ x86_64-linux
44
44
 
45
45
  DEPENDENCIES
46
- bundler (~> 1.16)
47
46
  pry (~> 0.11)
48
47
  rake (~> 10.0)
49
48
  relaxed_cookiejar!
@@ -52,4 +51,4 @@ DEPENDENCIES
52
51
  simplecov (~> 0.15)
53
52
 
54
53
  BUNDLED WITH
55
- 1.16.1
54
+ 2.5.6
data/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/relaxed_cookiejar.svg)](https://badge.fury.io/rb/relaxed_cookiejar)
4
4
  [![Build Status](https://travis-ci.org/andreimaxim/relaxed_cookiejar.svg?branch=master)](https://travis-ci.org/andreimaxim/relaxed_cookiejar)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/50e30f3b65985e299e9e/maintainability)](https://codeclimate.com/github/andreimaxim/relaxed_cookiejar/maintainability)
6
- [![Test Coverage](https://api.codeclimate.com/v1/badges/50e30f3b65985e299e9e/test_coverage)](https://codeclimate.com/github/andreimaxim/relaxed_cookiejar/test_coverage)
7
-
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/01636d74408d3f1fdd7d/maintainability)](https://codeclimate.com/github/andreimaxim/relaxed_cookiejar/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/01636d74408d3f1fdd7d/test_coverage)](https://codeclimate.com/github/andreimaxim/relaxed_cookiejar/test_coverage)
8
7
 
9
8
  A gem that includes a monkeypatch for the original CookieJar gem.
10
9
 
data/bin/console CHANGED
File without changes
data/bin/setup CHANGED
File without changes
data/docker-compose.yml CHANGED
@@ -1,6 +1,6 @@
1
- version: '3'
2
-
3
- services:
4
-
5
- gem:
1
+ version: '3'
2
+
3
+ services:
4
+
5
+ gem:
6
6
  build: .
@@ -1,54 +1,54 @@
1
- require 'cookiejar'
2
-
3
-
4
- module RelaxedCookieJar
5
- module CookieValidation
6
-
7
- def self.included(base)
8
- base.extend(ClassMethods)
9
-
10
- base.module_eval do
11
- # This was the only way I found that would reliably override a static
12
- # method defined on a module, otherwise the old method was called.
13
- #
14
- # If you have a better idea of doing this, please create a PR.
15
- singleton_class.send :alias_method,
16
- :compute_search_domains_for_host_with_no_recursion,
17
- :compute_search_domains_for_host
18
-
19
- singleton_class.send :alias_method,
20
- :compute_search_domains_for_host,
21
- :compute_search_domains_for_host_with_recursion
22
- end
23
- end
24
-
25
- module ClassMethods
26
-
27
- def compute_search_domains_for_host_with_recursion(host)
28
- host = effective_host host
29
- result = [host]
30
-
31
- if host =~ CookieJar::CookieValidation::IPADDR
32
- result
33
- else
34
- result + recursive_search_domain(host)
35
- end
36
- end
37
-
38
- def recursive_search_domain(host)
39
- m = CookieJar::CookieValidation::BASE_HOSTNAME.match(host)
40
-
41
- result = [".#{host}"]
42
-
43
- if m.nil?
44
- result
45
- else
46
- result + recursive_search_domain(m[1])
47
- end
48
- end
49
- end
50
- end
51
- end
52
-
53
- # The actual monkeypatching.
54
- CookieJar::CookieValidation.include RelaxedCookieJar::CookieValidation
1
+ require 'cookiejar'
2
+
3
+
4
+ module RelaxedCookieJar
5
+ module CookieValidation
6
+
7
+ def self.included(base)
8
+ base.extend(ClassMethods)
9
+
10
+ base.module_eval do
11
+ # This was the only way I found that would reliably override a static
12
+ # method defined on a module, otherwise the old method was called.
13
+ #
14
+ # If you have a better idea of doing this, please create a PR.
15
+ singleton_class.send :alias_method,
16
+ :compute_search_domains_for_host_with_no_recursion,
17
+ :compute_search_domains_for_host
18
+
19
+ singleton_class.send :alias_method,
20
+ :compute_search_domains_for_host,
21
+ :compute_search_domains_for_host_with_recursion
22
+ end
23
+ end
24
+
25
+ module ClassMethods
26
+
27
+ def compute_search_domains_for_host_with_recursion(host)
28
+ host = effective_host host
29
+ result = [host]
30
+
31
+ if host =~ CookieJar::CookieValidation::IPADDR
32
+ result
33
+ else
34
+ result + recursive_search_domain(host)
35
+ end
36
+ end
37
+
38
+ def recursive_search_domain(host)
39
+ m = CookieJar::CookieValidation::BASE_HOSTNAME.match(host)
40
+
41
+ result = [".#{host}"]
42
+
43
+ if m.nil?
44
+ result
45
+ else
46
+ result + recursive_search_domain(m[1])
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ # The actual monkeypatching.
54
+ CookieJar::CookieValidation.include RelaxedCookieJar::CookieValidation
@@ -1,3 +1,3 @@
1
1
  module RelaxedCookieJar
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -13,9 +13,6 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = 'https://github.com/andreimaxim/relaxed_cookiejar'
14
14
  spec.license = 'MIT'
15
15
 
16
- spec.cert_chain = ['certs/andreimaxim.pem']
17
- spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $0 =~ /gem\z/
18
-
19
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
17
  f.match(%r{^(test|spec|features)/})
21
18
  end
@@ -23,7 +20,6 @@ Gem::Specification.new do |spec|
23
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
21
  spec.require_paths = ['lib']
25
22
 
26
- spec.add_development_dependency 'bundler', '~> 1.16'
27
23
  spec.add_development_dependency 'rake', '~> 10.0'
28
24
  spec.add_development_dependency 'simplecov', '~> 0.15'
29
25
  spec.add_development_dependency 'pry', '~> 0.11'
@@ -34,5 +30,5 @@ Gem::Specification.new do |spec|
34
30
  # people doing any kind of updates in the future will have
35
31
  # a Bundler error instead of trying to figure out which gem
36
32
  # is monkeypatched.
37
- spec.add_dependency 'cookiejar', '0.3.3'
33
+ spec.add_dependency 'cookiejar', '>= 0.3.3'
38
34
  end
metadata CHANGED
@@ -1,30 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaxed_cookiejar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Maxim
8
8
  autorequire:
9
9
  bindir: exe
10
- cert_chain:
11
- - certs/andreimaxim.pem
12
- date: 2018-02-15 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2024-05-15 00:00:00.000000000 Z
13
12
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '1.16'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '1.16'
28
13
  - !ruby/object:Gem::Dependency
29
14
  name: rake
30
15
  requirement: !ruby/object:Gem::Requirement
@@ -99,14 +84,14 @@ dependencies:
99
84
  name: cookiejar
100
85
  requirement: !ruby/object:Gem::Requirement
101
86
  requirements:
102
- - - '='
87
+ - - ">="
103
88
  - !ruby/object:Gem::Version
104
89
  version: 0.3.3
105
90
  type: :runtime
106
91
  prerelease: false
107
92
  version_requirements: !ruby/object:Gem::Requirement
108
93
  requirements:
109
- - - '='
94
+ - - ">="
110
95
  - !ruby/object:Gem::Version
111
96
  version: 0.3.3
112
97
  description:
@@ -151,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
136
  - !ruby/object:Gem::Version
152
137
  version: '0'
153
138
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.6.13
139
+ rubygems_version: 3.5.9
156
140
  signing_key:
157
141
  specification_version: 4
158
142
  summary: Relaxed options for CookieJar