tshield 0.5.0.0 → 0.5.2.0

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: c15994b0d6cea84e0824244ca19af59979d86c9c
4
- data.tar.gz: 817db85984cf5232403906946a8517ce75b99c64
3
+ metadata.gz: b0b94c2d88dce848c777da771bf9998367c34614
4
+ data.tar.gz: 7bf66c15f1956234c3f50237ea151eadc9248637
5
5
  SHA512:
6
- metadata.gz: 9d9ba567624376a28c9ecf0a9aaf325b8a1bf58131725de83fa397a770b7fbd4a3de3f0c898b5e57258305e4eee079416f588f1778364c3e3e010e18b1f32d04
7
- data.tar.gz: c122877b72ed242c29f901c7f2e27b4c2a5b85e0a51ab4cd00ea5d903837c43456b233b70353af11785e98f27cb6a5c722068aad6fc61f4b87cf2fa78e8163d5
6
+ metadata.gz: f22f267fe74d698b0f26648f41422bb500db7f3aae9691e66f5a35025d27c424bcca5d94381e238b029747208aef31494dbca806a2edde5da9e76c2b644e0df0
7
+ data.tar.gz: 8ba0e3ccbd325d415564b9f0d77424ecfdc781427caecb904053a78a61d5e44a2e3d2d12cfe7f6732268b0b8533ebc2fa1c13ed0409c19cda46730b413f02260
@@ -3,6 +3,7 @@ require 'yaml'
3
3
  module TShield
4
4
  class Configuration
5
5
 
6
+ attr_accessor :request
6
7
  attr_accessor :domains
7
8
  attr_writer :session_path
8
9
 
@@ -27,6 +28,10 @@ module TShield
27
28
  domains[domain]['headers'] || {}
28
29
  end
29
30
 
31
+ def get_name(domain)
32
+ domains[domain]['name'] || domain.gsub(/.*:\/\//, '')
33
+ end
34
+
30
35
  def get_excluded_headers(domain)
31
36
  domains[domain]['excluded_headers'] || []
32
37
  end
@@ -38,6 +38,10 @@ module TShield
38
38
  app.head (PATHP) do
39
39
  treat(params, request, response)
40
40
  end
41
+
42
+ app.delete (PATHP) do
43
+ treat(params, request, response)
44
+ end
41
45
  end
42
46
 
43
47
  module Helpers
@@ -19,6 +19,7 @@ module TShield
19
19
  @path = path
20
20
  @options = options
21
21
  @configuration = TShield::Configuration.singleton
22
+ @options[:timeout] = @configuration.request['timeout']
22
23
  request
23
24
  end
24
25
 
@@ -47,6 +48,10 @@ module TShield
47
48
  @domain ||= @configuration.get_domain_for(@path)
48
49
  end
49
50
 
51
+ def name
52
+ @name ||= @configuration.get_name(domain)
53
+ end
54
+
50
55
  def method
51
56
  @options[:method].downcase
52
57
  end
@@ -103,10 +108,10 @@ module TShield
103
108
  Dir.mkdir(request_path) unless File.exists?(request_path)
104
109
  end
105
110
 
106
- domain_path = File.join(request_path, domain.gsub(/.*:\/\//, ''))
107
- Dir.mkdir(domain_path) unless File.exists?(domain_path)
111
+ name_path = File.join(request_path, name)
112
+ Dir.mkdir(name_path) unless File.exists?(name_path)
108
113
 
109
- path_path = File.join(domain_path, safe_dir(@path))
114
+ path_path = File.join(name_path, safe_dir(@path))
110
115
  Dir.mkdir(path_path) unless File.exists?(path_path)
111
116
 
112
117
  method_path = File.join(path_path, method)
@@ -2,7 +2,7 @@ module TShield
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 2
6
6
  PRE = 0
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tshield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.0
4
+ version: 0.5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Rubin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-28 00:00:00.000000000 Z
11
+ date: 2016-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty