http-cookie 1.0.4 → 1.0.5

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
  SHA256:
3
- metadata.gz: 6e3fc7cc6e374fa6bdd53c2a32cae8b8856615df4aad76fe496ab6375738652e
4
- data.tar.gz: 0132bb41158fa3bf84a0adf2fcf7226115a1126efbc12c879f465a8c2114215b
3
+ metadata.gz: 5230b0bd44e032652855e7b9e60e3d994ca56adbd57550c7520930d4dbf734a4
4
+ data.tar.gz: 65240197f49ac57bac8c6f3d1104cfe4f8fff77e1ac992c05c72d74efbba8300
5
5
  SHA512:
6
- metadata.gz: 341c0b9947ed005f8c73030ad7b5380aa19d76cbfc2f3f09ac69207a9a5b33e62f0094f6b68b98ad839f110c565f7afc08a9ff504c82affe736a8bcb55908e05
7
- data.tar.gz: c4346ce6bae86a394c72b38f079c3c272205df3b7453c630e1dc3fc1ae7dec7ee0f652c9b5f2b12151fb6b7b402a5fbc41b832c051cf17102bd1cd584f72b461
6
+ metadata.gz: 7fc5bb2e287d60d060c54eb9fb9ccb6d55c55e84ec35525deff8c088c873d6ac26db86f7f1cf3c03a7cbf05e397b6cd0e3a1e1171c2dcff8848e0345a34b0905
7
+ data.tar.gz: 1c85e07a65fac1d5440126bea27dbc01160edc9a791f56e021cd3142070eada54bf1ec3cda31c9d9273f23c3a84c8786c308bcdd27e03f7266c203dde4abdd6f
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - "*"
10
+
11
+ jobs:
12
+ test:
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu]
17
+ # We still kind of support Ruby 1.8.7
18
+ ruby: [2.7, "3.0", 3.1, head, jruby]
19
+
20
+ name: >-
21
+ ${{matrix.os}}:ruby-${{matrix.ruby}}
22
+ runs-on: ${{matrix.os}}-latest
23
+ continue-on-error: ${{matrix.ruby == 'head' || matrix.ruby == 'jruby'}}
24
+
25
+ steps:
26
+ - name: Check out
27
+ uses: actions/checkout@v2
28
+
29
+ - name: Set up ruby and bundle
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{matrix.ruby}}
33
+ bundler-cache: true
34
+
35
+ - name: Run rake
36
+ run: |
37
+ bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## Unreleased
1
+ ## 1.0.5 (2022-05-25)
2
+
3
+ - Silence SQLite3 warnings
4
+
5
+ ## 1.0.4 (2021-06-07)
2
6
 
3
7
  - Support Mozilla's cookie storage format up to version 7.
4
8
 
data/http-cookie.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
25
25
  gem.extra_rdoc_files = ['README.md', 'LICENSE.txt']
26
26
 
27
27
  gem.add_runtime_dependency("domain_name", ["~> 0.5"])
28
- gem.add_development_dependency("sqlite3", ["~> 1.3.3"]) unless defined?(JRUBY_VERSION)
28
+ gem.add_development_dependency("sqlite3", ["~> 1.3"]) unless defined?(JRUBY_VERSION)
29
29
  gem.add_development_dependency("bundler", [">= 1.2.0"])
30
30
  gem.add_development_dependency("test-unit", [">= 2.4.3", *("< 3" if RUBY_VERSION < "1.9")])
31
31
  gem.add_development_dependency("rake", [">= 0.9.2.2", *("< 11" if RUBY_VERSION < "1.9")])
@@ -1,5 +1,5 @@
1
1
  module HTTP
2
2
  class Cookie
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -136,7 +136,7 @@ class HTTP::CookieJar
136
136
 
137
137
  # Returns the schema version of the database.
138
138
  def schema_version
139
- @schema_version ||= @db.execute("PRAGMA user_version").first[0]
139
+ @schema_version ||= @db.execute("PRAGMA user_version").first["user_version"]
140
140
  rescue SQLite3::SQLException
141
141
  @logger.warn "couldn't get schema version!" if @logger
142
142
  return nil
@@ -1,5 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.expand_path('helper', File.dirname(__FILE__))
3
+ require 'psych' if !defined?(YAML) && RUBY_VERSION == "1.9.2"
4
+ require 'yaml'
3
5
 
4
6
  class TestHTTPCookie < Test::Unit::TestCase
5
7
  def setup
@@ -1073,6 +1075,16 @@ class TestHTTPCookie < Test::Unit::TestCase
1073
1075
  }
1074
1076
  end
1075
1077
 
1078
+ if YAML.name == 'Psych' && Psych::VERSION >= '3.1'
1079
+ private def load_yaml(yaml)
1080
+ YAML.safe_load(yaml, :permitted_classes => %w[Time HTTP::Cookie Mechanize::Cookie DomainName], :aliases => true)
1081
+ end
1082
+ else
1083
+ private def load_yaml(yaml)
1084
+ YAML.load(yaml)
1085
+ end
1086
+ end
1087
+
1076
1088
  def test_yaml_expires
1077
1089
  require 'yaml'
1078
1090
  cookie = HTTP::Cookie.new(cookie_values)
@@ -1080,29 +1092,29 @@ class TestHTTPCookie < Test::Unit::TestCase
1080
1092
  assert_equal false, cookie.session?
1081
1093
  assert_equal nil, cookie.max_age
1082
1094
 
1083
- ycookie = YAML.load(cookie.to_yaml)
1095
+ ycookie = load_yaml(cookie.to_yaml)
1084
1096
  assert_equal false, ycookie.session?
1085
1097
  assert_equal nil, ycookie.max_age
1086
1098
  assert_in_delta cookie.expires, ycookie.expires, 1
1087
1099
 
1088
1100
  cookie.expires = nil
1089
- ycookie = YAML.load(cookie.to_yaml)
1101
+ ycookie = load_yaml(cookie.to_yaml)
1090
1102
  assert_equal true, ycookie.session?
1091
1103
  assert_equal nil, ycookie.max_age
1092
1104
 
1093
1105
  cookie.expires = Time.now + 3600
1094
- ycookie = YAML.load(cookie.to_yaml)
1106
+ ycookie = load_yaml(cookie.to_yaml)
1095
1107
  assert_equal false, ycookie.session?
1096
1108
  assert_equal nil, ycookie.max_age
1097
1109
  assert_in_delta cookie.expires, ycookie.expires, 1
1098
1110
 
1099
1111
  cookie.max_age = 3600
1100
- ycookie = YAML.load(cookie.to_yaml)
1112
+ ycookie = load_yaml(cookie.to_yaml)
1101
1113
  assert_equal false, ycookie.session?
1102
1114
  assert_in_delta cookie.created_at + 3600, ycookie.expires, 1
1103
1115
 
1104
1116
  cookie.max_age = nil
1105
- ycookie = YAML.load(cookie.to_yaml)
1117
+ ycookie = load_yaml(cookie.to_yaml)
1106
1118
  assert_equal true, ycookie.session?
1107
1119
  assert_equal nil, ycookie.expires
1108
1120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-cookie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-06-07 00:00:00.000000000 Z
14
+ date: 2022-05-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: domain_name
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: 1.3.3
36
+ version: '1.3'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: 1.3.3
43
+ version: '1.3'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: bundler
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -127,8 +127,8 @@ extra_rdoc_files:
127
127
  - README.md
128
128
  - LICENSE.txt
129
129
  files:
130
+ - ".github/workflows/ci.yml"
130
131
  - ".gitignore"
131
- - ".travis.yml"
132
132
  - CHANGELOG.md
133
133
  - Gemfile
134
134
  - LICENSE.txt
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []
174
- rubygems_version: 3.2.11
174
+ rubygems_version: 3.3.14
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: A Ruby library to handle HTTP Cookies based on RFC 6265
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 1.8.7
6
- - ree
7
- - 1.9.3
8
- - 2.0.0
9
- - 2.1
10
- - 2.2
11
- - 2.3.0
12
- - ruby-head
13
- - jruby-1.7
14
- - jruby-9
15
- - rbx-2
16
- matrix:
17
- allow_failures:
18
- - rvm: ruby-head
19
- - rvm: rbx-2
20
- before_install:
21
- - gem update bundler