ree_lib 1.0.46 → 1.0.47

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: c891f66e5e8dfeb011588bb1cdfebebd2d1ca88552a2e623eeb573d72b43fd47
4
- data.tar.gz: 3c9885f0abfb06dc1cde8d9fcdcb7a5901c859dbb629c61d7939caf1eb74b242
3
+ metadata.gz: c74ce073851aa0f44a9d5ef2d7df9000bd595e1208300a257269cdec28de15e8
4
+ data.tar.gz: eb2cc59a1ae7da783c6950236288e7be4a5d6a1c42f5216fd0c7cac5728941bd
5
5
  SHA512:
6
- metadata.gz: '0726859940ca7bc5e7f32a1995ad40f42670cc41a3c829d5211b37712ef65092efb5a643cd0b000d55f1497fd4db2fa37eee991cb7e5f27185515d6f3f996cc7'
7
- data.tar.gz: fed4151d293502fbf5eb73236acf2e944f3ceade748d7e73da38bbf3cf906df1153388789db47c11469c005a06fb7a79eca8736e55e0d496f1a2df252bde6047
6
+ metadata.gz: 6ae3e653b7ee36a1ce7574cfe1ec091532420744b5b87e33aa121b4c01929ff989f5e5800414dc10a59e9752daf2e02bd6b51f656a6f449db2ee5c89a3242c72
7
+ data.tar.gz: 6a09a450be8d91aced2a457248e30b6c810ceb9857e391ccb73574e4ee546fc96345cc4dcc0ad3618c3304fe808b78ad45a1a8f69150d95625ce38bd86237151
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.46)
4
+ ree_lib (1.0.47)
5
5
  binding_of_caller (~> 1.0.0)
6
6
  i18n (~> 1.12.0)
7
7
  loofah (~> 2.18.0)
@@ -4,10 +4,8 @@ class ReeHttp::BuildRequest
4
4
  include Ree::FnDSL
5
5
 
6
6
  fn :build_request do
7
- link :to_json, from: :ree_json
8
- link :slice, from: :ree_hash
9
7
  link :not_blank, from: :ree_object
10
-
8
+ link :to_json, from: :ree_json
11
9
  link 'ree_http/constants', -> {
12
10
  HTTPS & HTTP & HTTPS_PORT & HTTP_PORT & DEFAULT_FORCE_SSL
13
11
  }
@@ -84,8 +82,8 @@ class ReeHttp::BuildRequest
84
82
 
85
83
  unless opts[:body].nil?
86
84
  request.body =
87
- case request[:body]
88
- when Hash then to_json[opts[:body]]
85
+ case opts[:body]
86
+ when Hash then to_json(opts[:body])
89
87
  when File then opts[:body].read
90
88
  else
91
89
  opts[:body]
@@ -41,14 +41,6 @@
41
41
 
42
42
  ]
43
43
  },
44
- {
45
- "target": "slice",
46
- "package_name": "ree_hash",
47
- "as": "slice",
48
- "imports": [
49
-
50
- ]
51
- },
52
44
  {
53
45
  "target": "to_json",
54
46
  "package_name": "ree_json",
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require 'webmock/rspec'
3
+ require "tempfile"
3
4
 
4
5
  RSpec.describe :http_post do
5
6
  link :http_post, from: :ree_http
@@ -70,6 +71,26 @@ RSpec.describe :http_post do
70
71
  body: "abc"
71
72
  )
72
73
 
74
+ http_post(
75
+ host,
76
+ body: { foo: "bar" }
77
+ )
78
+ expect(WebMock).to have_requested(:post, host).with(body: "{\"foo\":\"bar\"}")
79
+
80
+ begin
81
+ tempfile = Tempfile.new
82
+ tempfile.write("hello world")
83
+ tempfile.rewind
84
+
85
+ http_post(
86
+ host,
87
+ body: File.open(tempfile.path)
88
+ )
89
+ expect(WebMock).to have_requested(:post, host).with(body: "hello world")
90
+ ensure
91
+ tempfile&.close!
92
+ end
93
+
73
94
  # works !
74
95
  # response = http_post(
75
96
  # 'http://127.0.0.1:8085/end',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.46"
4
+ VERSION = "1.0.47"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.46
4
+ version: 1.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov