glib-web 0.5.1 → 0.5.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
  SHA256:
3
- metadata.gz: 92d880220ff29cbee352b8077c541e62b548796b4f1e7ef760f1f3b2967360be
4
- data.tar.gz: 8d2f3393a965980996dc0408859f130551d7c840a88bd11435ecb48ee64aba99
3
+ metadata.gz: 030e8fab91840b4a4337ebb8e867f56b9b658ec8932716afae41f1ebb84f93ee
4
+ data.tar.gz: 1dc8364b2e509891eeed48c55f4aa8f9d8c89c3b9dad8dc700720d14e2b55e15
5
5
  SHA512:
6
- metadata.gz: a75416c64751c7b4680104e9bcd199bfec7945bf34a4e7cdc58f4fb9deadc16aa1a79e54e0d50dd3f968e133f6583f39fa0ef4979f2bff0e952eabf4ebc65593
7
- data.tar.gz: f9024d9668c9e6198db90494237f7ca0f2a87199fbe5c1c17d2410f3382b1cd6600c8862aeb700171ab08172704b59bfa6a93359cda6ba57a11bea77f2aa93f3
6
+ metadata.gz: c94b19ff196e16ed430d973f295b64a4aa92e4a89f685e74731e5ecadb0a23a3ea39ab7aafe049e7bff46ffadb4d67f59d9a6b1791613cffcf63f66df611e806
7
+ data.tar.gz: 9175751c633b836d10cfc4aa67d4af2e4e7ea8b837a99dfc34bf6fe91efc3ddf932a1aa227d13097cfbdb5aaab63ca9ecdd14fd3410a114e926c2896e36c6df0
@@ -3,9 +3,9 @@ module Glib
3
3
  class NavInitiate < ActionCrawler
4
4
  def initialize(http, args, action)
5
5
  super(http)
6
-
6
+
7
7
  @http = http
8
- if (json = @http.get args['url'], action) && (left_drawer = json['leftDrawer'])
8
+ if (json = (@http.get args['url'], action, args.except('url'))) && (left_drawer = json['leftDrawer'])
9
9
  crawl left_drawer['header']&.[]('childViews')
10
10
  crawl left_drawer['rows']
11
11
  end
@@ -4,7 +4,7 @@ module Glib
4
4
  def initialize(http, args, action)
5
5
  @http = http
6
6
  if (url = args['url'])
7
- json = @http.get url, action
7
+ json = @http.get(url, action, args.except('url'))
8
8
 
9
9
  unless json.nil?
10
10
  crawl json['header']&.[]('childViews')
@@ -20,8 +20,8 @@ module Glib
20
20
  @router = router
21
21
  end
22
22
 
23
- def get(url, action, inspect_result = true)
24
- fetch(:get, url, action, {}, inspect_result)
23
+ def get(url, action, params = {}, inspect_result = true)
24
+ fetch(:get, url, action, params, inspect_result)
25
25
  end
26
26
 
27
27
  def post(url, action, params)
@@ -65,6 +65,7 @@ module Glib
65
65
  'Client-Version' => user[:version],
66
66
  'X-CSRF-Token' => user[:token]
67
67
  }
68
+ http_header.merge!(params[:headers]) if params[:headers].present?
68
69
 
69
70
  params.each do |name, value|
70
71
  params[name] = '' if value.is_a?(Array) && value.size == 0
@@ -99,7 +100,7 @@ module Glib
99
100
  if (code = response.code) == 302
100
101
  redirect_uri = URI(response.headers['Location'])
101
102
  redirect_uri.query = [redirect_uri.query, 'format=json'].compact.join('&')
102
- get redirect_uri.to_s, action
103
+ get redirect_uri.to_s, action, params
103
104
  else
104
105
  response_times << response.headers['X-Runtime'].to_f
105
106
  @context.assert_includes VALID_RESPONSE_CODES, code, "Expected a valid response but was [#{response.code}] #{Rack::Utils::HTTP_STATUS_CODES[response.code.to_i]}:\n#{url}"
@@ -69,7 +69,7 @@ module Glib
69
69
  @depth += 1
70
70
  target_router.read_only_actions.each do |crawler_action|
71
71
  action, url = crawler_action
72
- http.get url, action, false
72
+ http.get(url, action, {}, false)
73
73
  end
74
74
  end
75
75
 
@@ -13,7 +13,7 @@ module Glib
13
13
 
14
14
  def __log_dir
15
15
  if @__log_dir.nil?
16
- @__log_dir = File.expand_path("controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
16
+ @__log_dir = File.expand_path("#{Rails.root}/test/controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
17
17
  unless File.directory?(@__log_dir)
18
18
  FileUtils.mkdir_p(@__log_dir)
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''