emmy-http-client 0.1.1 → 0.1.2

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: 86281196b689bfacc93edd0efd5e5eda62ce3b94
4
- data.tar.gz: 76c3b36665d52fd723016510c801eff6d9c9118a
3
+ metadata.gz: 52d1bbbfc9f210e48a6f7d8dd98631f3783e9202
4
+ data.tar.gz: 85c2d04387f9e94b8ec898f9c309e3521db19fe4
5
5
  SHA512:
6
- metadata.gz: b92fdf28537d363a6d4710b3fdd3b9bf40a5e7c7bfa9682dc41b1e173f71912c7606a61ffa34f5a393ffdf4641df7d5a49b06a78bed1372ea2befaf3d4ad3e62
7
- data.tar.gz: 5573fa6e087f9fb960cb325842fe201313c4fb1ae2ae251003764f04b3c08d7c01ca12a83d24c1f6d16d58e08e9a2c54bba09042a7e1fd9451b88ea04f8969bd
6
+ metadata.gz: 2a43d921938468c52fa7cfa850b5a42671831043a277f5207179e9bbb5f01905fba0bd30674337a9bc16b1e836153c333c38bdc132edb03a806f912df8401658
7
+ data.tar.gz: fb891ed56dc5f0a45622f9c88e460fe9c15a1a3bb77df63db70be8bcf182f7c6a49e79a63e8cb59193baff7e4c099ffb3be22a2b0179ba6f02e0e83819e1a109
data/README.md CHANGED
@@ -1,26 +1,20 @@
1
- # Emmy::Http::Client
1
+ # EmmyHttp::Client
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/emmy/http/client`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem is part of Emmy framework
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ > gem install emmy
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
7
+ ## Usage
10
8
 
11
9
  ```ruby
12
- gem 'emmy-http-client'
10
+ response = Emmy.request(url: "http://httpbin.org/get").sync
13
11
  ```
14
12
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install emmy-http-client
13
+ or,
22
14
 
23
- ## Usage
15
+ ```ruby
16
+ request = Emmy.request(url: "http://httpbin.org/post", form: {param: 'foo'}).post.sync
17
+ ```
24
18
 
25
19
  Long way,
26
20
 
@@ -30,27 +24,16 @@ operation = EmmyHttp::Operation.new(request, EmmyHttp::Client::Adapter)
30
24
  response = operation.sync
31
25
  ```
32
26
 
33
- Short way,
27
+ ### Asynchronous requests
34
28
 
35
29
  ```ruby
36
- response = Emmy.http_request(url: "http://google.com").sync
30
+ Emmy.run_block {
31
+ responses = {
32
+ get_request: Emmy.request!(url: "http://httpbin.org/get")
33
+ post_request: Emmy.request!(url: "http://httpbin.org/post", type: "POST", form: {param: 'foo'})
34
+ }.sync
35
+
36
+ p responses[:get_request]
37
+ p responses[:post_request]
38
+ }
37
39
  ```
38
-
39
-
40
- ```ruby
41
- request = Emmy.http.defauls(post: "http://google.com", body: {param: 'foo'})
42
- ```
43
-
44
- ## Development
45
-
46
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
47
-
48
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
49
-
50
- ## Contributing
51
-
52
- 1. Fork it ( https://github.com/inre/emmy-http-client/fork )
53
- 2. Create your feature branch (`git checkout -b my-new-feature`)
54
- 3. Commit your changes (`git commit -am 'Add some feature'`)
55
- 4. Push to the branch (`git push origin my-new-feature`)
56
- 5. Create a new Pull Request
@@ -37,6 +37,7 @@ module EmmyHttp
37
37
  conn.comm_inactivity_timeout = request.timeouts.inactivity
38
38
 
39
39
  conn.on :connect do
40
+ conn.start_tls(client.request.ssl ? client.request.ssl.serializable_hash : {}) if client.request.ssl?
40
41
  send_request
41
42
  change_state(:wait_response)
42
43
  end
@@ -1,5 +1,5 @@
1
1
  module EmmyHttp
2
2
  module Client
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emmy-http-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - inre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-19 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http_parser.rb
@@ -123,12 +123,9 @@ files:
123
123
  - README.md
124
124
  - Rakefile
125
125
  - TODO.md
126
- - bin/console
127
- - bin/setup
128
126
  - emmy-http-client.gemspec
129
127
  - lib/emmy_http/client.rb
130
128
  - lib/emmy_http/client/adapter.rb
131
- - lib/emmy_http/client/agent.rb
132
129
  - lib/emmy_http/client/client.rb
133
130
  - lib/emmy_http/client/cookie.rb
134
131
  - lib/emmy_http/client/encoding.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "emmy_http/client"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here
@@ -1,5 +0,0 @@
1
- module EmmyHttp
2
- class Client::Agent
3
-
4
- end
5
- end