ehsso 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: 16742fa33f79490044c2ab677c3f20956458577a
4
- data.tar.gz: a91ffe95f7a5c167b751fdbeea1ec01393e93713
3
+ metadata.gz: 5c3e47fde436c74f25ffcda42ee528aec4390bad
4
+ data.tar.gz: 77d43af5c6ee632e331464196d689752d62be8ef
5
5
  SHA512:
6
- metadata.gz: e677c3b519529f3af47800e19b07fb1a4b9a46d4a5341eb3a8618d646f2db5f329e2bfec1c855d249729b821455cd40976bc37dbca4f6ec92f27cefce5af98b5
7
- data.tar.gz: 567fc4952153ac81af3ba67f368fcda477ea4d3f9722fdc3af0f3aad3884468df7114f4bcf2b1bdc99b1c6dafe806c31483b4eadba80be7e666359aa3aa2ae5a
6
+ metadata.gz: c2c20aea3eb75cc8936be04a6426d9219ff9a8a60c624b5a0fc569dc6757d83abfa4395a7552f1101a7d90cd12e56659e5c4441560be87688ebeb6fd09157346
7
+ data.tar.gz: c4d1e4b4ec242792695691dc5195106c537ca716ec741d766514a6e47a7ef7e387e530bc9f066e91e3816bc5e39ed8f9636d485bfeca9a90138739c2b096be7e
@@ -54,18 +54,11 @@ module Ehsso
54
54
  end
55
55
 
56
56
  def fetch
57
- url = [Ehsso.configuration.base_url, 'people'].join('/')
58
- userpwd = Ehsso.configuration.username_and_password
59
- response = Typhoeus.post(url, body: payload(action: 'people.modules.roles'), userpwd: userpwd)
60
- handle_response(response)
57
+ handle_service_call(action: 'people.modules.roles')
61
58
  end
62
59
 
63
-
64
60
  def fetch_or_create
65
- url = [Ehsso.configuration.base_url, 'people'].join('/')
66
- userpwd = Ehsso.configuration.username_and_password
67
- response = Typhoeus.post(url, body: payload(action: 'people_with_guest_registration_if_missing.modules.roles'), userpwd: userpwd)
68
- handle_response(response)
61
+ handle_service_call(action: 'people_with_guest_registration_if_missing.modules.roles')
69
62
  end
70
63
 
71
64
  private
@@ -90,6 +83,13 @@ module Ehsso
90
83
  }
91
84
  end
92
85
 
86
+ def handle_service_call(args={})
87
+ url = [Ehsso.configuration.base_url, 'people'].join('/')
88
+ userpwd = Ehsso.configuration.username_and_password
89
+ response = Typhoeus.post(url, body: payload(action: args[:action]), userpwd: userpwd)
90
+ handle_response(response)
91
+ end
92
+
93
93
  def handle_response(response)
94
94
  if response.code == 200
95
95
  begin
@@ -1,3 +1,3 @@
1
1
  module Ehsso
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehsso
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
  - Thomas Steiner