h2 0.4.0 → 0.4.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: 59101b19f83a2994cc9186c11121c95645e5cdf4
4
- data.tar.gz: fd22e1173757e89c855641daf391e9b55de79204
2
+ SHA256:
3
+ metadata.gz: '09291052e9be6853fdbc3a57b31516e8a61b6a3a8a3e11e0d46215d4ec14cf7c'
4
+ data.tar.gz: a18029d8019099fa7908163981f4a03da9adff28c0a6c0851626fd852846c211
5
5
  SHA512:
6
- metadata.gz: 3431f613af4aea436ae44e2ef3e617408012553bf9d3b5ab36b6d4d0068d46d7485560b02037cb98b6eac7edaa8d07f3b79350e150c57330c4fe8f66c2d8a4be
7
- data.tar.gz: f8e98e3d6838005d1c83848a35f48166eeb76a06dc87b53b9cf03c7ea6543c7b339285626a9d8de9a4ce90e2d1859babd3b78cd4e2d51f0088541e91f84dcee1
6
+ metadata.gz: e0252b16b333e1218f0869a876f4687cb0513b0efe82af6fcc7ceedc140fa97dd5a30d7a22ca32d3d9894ce20669b6a34fb17fc56661e1d6676b421f7ca24a97
7
+ data.tar.gz: de69b22e572d2498ad4cc085ec821fab75043119dcaa219fe4fba48b9c2d5aac9552534274b39629d209a5aa6859e29b9562f6e193e54c9db435f97a8ad2f65a
@@ -2,9 +2,6 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.2.7
5
- - 2.3.4
6
- - 2.4.1
7
- - jruby-9.1.12.0
8
- matrix:
9
- allow_failures:
10
- - rvm: jruby-9.1.12.0
5
+ - 2.3.7
6
+ - 2.4.4
7
+ - 2.5.1
@@ -1,6 +1,12 @@
1
1
  h2 changelog
2
2
  ============
3
3
 
4
+ ### 0.4.1 16 jun 2017
5
+
6
+ * update .travis.yml for latest supported versions
7
+ * add CLI flags for threading model
8
+ * update for http-2-0.9.x (`:promise_headers`)
9
+
4
10
  ### 0.4.0 17 jun 2017
5
11
 
6
12
  * downgrade required ruby version to 2.2
data/Gemfile CHANGED
@@ -14,5 +14,5 @@ group :development, :test do
14
14
  gem 'awesome_print'
15
15
  gem 'guard-rake'
16
16
  gem 'pry-byebug', platforms: [:mri]
17
- gem 'reel', require: 'reel/h2', git: 'https://github.com/kenichi/reel', branch: 'rebase_h2'
17
+ gem 'reel', require: 'reel/h2', git: 'https://github.com/kenichi/reel', branch: 'h2'
18
18
  end
data/README.md CHANGED
@@ -75,6 +75,20 @@ For more info on using the CLI `h2` installed with this gem:
75
75
 
76
76
  `$ h2 --help`
77
77
 
78
+ ## TLS CA Certificates
79
+
80
+ If you're running on macOS and using Homebrew's openssl package, you may need to
81
+ specify the CA file in the TLS options:
82
+
83
+ ```ruby
84
+ client = H2::Client.new addr: 'example.com', port: 443, tls: { ca_file: '/usr/local/etc/openssl/cert.pem' }
85
+ ```
86
+
87
+ or when using the CLI:
88
+
89
+ `$ h2 --cafile /usr/local/etc/openssl/cert.pem https://example.com/`
90
+
91
+
78
92
  ## Alternate Concurrency Models
79
93
 
80
94
  Right now, h2 uses one new thread per connection. This is hardly ideal, so a
data/exe/h2 CHANGED
@@ -43,6 +43,14 @@ OptionParser.new do |o|
43
43
  options[:tls][:ca_file] = ca
44
44
  end
45
45
 
46
+ o.on '--celluloid', 'use celluloid actor pool' do
47
+ require 'h2/client/celluloid'
48
+ end
49
+
50
+ o.on '--concurrent', 'use concurrent-ruby thread pool' do
51
+ require 'h2/client/concurrent'
52
+ end
53
+
46
54
  o.on '-d', '--data [DATA]', String, 'post body data' do |d|
47
55
  options[:method] = :post if options[:method].nil?
48
56
  options[:body] = d
data/h2.gemspec CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.version = H2::VERSION
7
7
  spec.authors = ["Kenichi Nakamura"]
8
8
  spec.email = ["kenichi.nakamura@gmail.com"]
9
- spec.summary = 'an http/2 client based on http-2 and modern ruby'
10
- spec.description = 'a pure ruby http/2 client based on http-2 for ruby 2.2 and above'
9
+ spec.summary = 'an http/2 client based on http-2'
10
+ spec.description = 'a pure ruby http/2 client based on http-2'
11
11
  spec.homepage = 'https://github.com/kenichi/h2'
12
12
  spec.license = 'MIT'
13
13
  spec.bindir = 'exe'
@@ -29,5 +29,3 @@ module H2
29
29
  prepend H2::Client::Celluloid
30
30
  end
31
31
  end
32
-
33
-
@@ -7,10 +7,11 @@ module H2
7
7
 
8
8
  module ClassMethods
9
9
  def thread_pool
10
+ return @thread_pool if @thread_pool
10
11
  procs = ::Concurrent.processor_count
11
- @thread_pool ||= ::Concurrent::ThreadPoolExecutor.new min_threads: 0,
12
- max_threads: procs,
13
- max_queue: procs * 5
12
+ @thread_pool = ::Concurrent::ThreadPoolExecutor.new min_threads: 0,
13
+ max_threads: procs,
14
+ max_queue: procs * 5
14
15
  end
15
16
  end
16
17
 
@@ -31,4 +32,3 @@ module H2
31
32
  prepend H2::Client::Concurrent
32
33
  end
33
34
  end
34
-
@@ -77,11 +77,9 @@ module H2
77
77
  on :close
78
78
  end
79
79
 
80
- @stream.on(:headers) do |h|
81
- h = Hash[h]
82
- on :headers, h
83
- @headers.merge! h
84
- end
80
+ ah = method :add_headers
81
+ @stream.on :promise_headers, &ah
82
+ @stream.on :headers, &ah
85
83
 
86
84
  @stream.on(:data) do |d|
87
85
  on :data, d
@@ -89,6 +87,13 @@ module H2
89
87
  end
90
88
  end
91
89
 
90
+ def add_headers h
91
+ h = Hash[h]
92
+ on :headers, h
93
+ @headers.merge! h
94
+ @headers
95
+ end
96
+
92
97
  def to_h
93
98
  { headers: headers, body: body }
94
99
  end
@@ -1,5 +1,5 @@
1
1
  module H2
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
 
4
4
  class << self
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2
@@ -86,7 +86,7 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '5.0'
89
- description: a pure ruby http/2 client based on http-2 for ruby 2.2 and above
89
+ description: a pure ruby http/2 client based on http-2
90
90
  email:
91
91
  - kenichi.nakamura@gmail.com
92
92
  executables:
@@ -133,8 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.6.12
136
+ rubygems_version: 2.7.6
137
137
  signing_key:
138
138
  specification_version: 4
139
- summary: an http/2 client based on http-2 and modern ruby
139
+ summary: an http/2 client based on http-2
140
140
  test_files: []