screenplay 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: 978d59ffaab5e6635ebfc55b85e964d9fd8d943d
4
- data.tar.gz: dd2f14e525c632d471439bc20a351533623b3de1
3
+ metadata.gz: 63bce83d0f98bb3b47361fe3e9fb1e3faf2f41c3
4
+ data.tar.gz: 119bf21f6e38ff112ba28e9a27be71508f933def
5
5
  SHA512:
6
- metadata.gz: 3b4be4150788dae292f0b701453970bad1fe1990d773a2aabf9b791982a7a2c86311c9b4221a786baeba1646cc20176cbd5410e8923723f8f33dcbc450db930b
7
- data.tar.gz: acb4d65ad157d9e742189bf02178005ef02a086728395eb7726eb9ad53bd253d1278dddaa58345cb56c9ae3e83baa4c9de453dbe3eb03198860ac6d2c2b34dae
6
+ metadata.gz: 5a887b644db3c1db7424c5e53f836688f0a4216273b2be93ccc782d3d0267adff931f67ba8fab5c6e5ef6d2d64826bcf95d3b5324032f1946e0243f5f7e52941
7
+ data.tar.gz: 85c1a1a3a264aa50eb481e3213d0eac55ca88df8120e4adc88e2fbb45bf6a7ad53a0792ceff56824a58b19edd073ae0999b833ff00abc484742d9516d1b91c01
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rest-client', '~> 1.7.2'
3
+ gem 'rest-client', '~> 1.7.3'
4
4
  gem 'highline', '~> 1.6.21'
5
5
 
6
6
 
@@ -16,7 +16,7 @@ module Screenplay
16
16
  def configure(config)
17
17
  @url = config[:url].to_s
18
18
  @url += '/' unless @url.end_with?('/')
19
- @request_headers = config[:request_headers] || {}
19
+ @headers = config[:headers] || {}
20
20
  @cookies = nil
21
21
  end
22
22
 
@@ -28,7 +28,7 @@ module Screenplay
28
28
  data = params[:data] || {} rescue {}
29
29
  data = input if (data.is_a?(String)) && (data == '$input')
30
30
  data.stringify_keys!
31
- headers = @request_headers
31
+ headers = @headers
32
32
  headers[:cookie] = @cookies unless @cookies.nil?
33
33
  url = @url + path.to_s.replace_vars(input)
34
34
  if ([:get, :head, :delete].include?(method))
@@ -36,6 +36,10 @@ module Screenplay
36
36
  data = {}
37
37
  end
38
38
 
39
+ if (headers['Content-Type'.to_sym] == 'application/json')
40
+ data = JSON.generate(data)
41
+ end
42
+
39
43
  begin
40
44
  response = RestClient::Request.execute({
41
45
  url: url,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: screenplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taco Jan Osinga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-02 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client