ruby_aem 1.0.18 → 1.0.19

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: e416e06b6a94132684f6ce55369671579b4312e2
4
- data.tar.gz: 23622d5f61323b8fe7abc10860a68344c3cc9efc
3
+ metadata.gz: b683ebcb4d5d0623b410102cc07623d0bc07ea6b
4
+ data.tar.gz: b0571ec2aa221353484b79247c6fc3e77d4be386
5
5
  SHA512:
6
- metadata.gz: e35b72adbfd99dd6d4dea0af11de29f2f2ea31d00ee04b440311230cfebbc80077ba4349320ec782cb946a37241cbf3b076bfec48a21075f7a5345ca3484b321
7
- data.tar.gz: 4fd4bf6e5856e9e3e7eef679dac78e65386fe26e8df30db659554f3494962ec5f3e6b94893008c49f2d060491eba743275adf4d71a04623ba6fd2459925819fa
6
+ metadata.gz: 9c27de523856d5ba67e28383b20a12d2eacdda5323f765b55196dacc8ea33fc5e063691ac550627b6d88e041af32e9fc0583ab5daba5eb4012b521607b6ce664
7
+ data.tar.gz: 1746e50ceff0c78e4a153ecad7e76adc12e6a2b399e5f392a33ae9ad7648f2a1729aa8df917ef3438cc4779314d46629e8ad776529f626cc1907bc08dc903459
@@ -493,7 +493,7 @@ configproperty:
493
493
  required:
494
494
  runmode: '%{run_mode}'
495
495
  optional:
496
- - alias
496
+ - _alias
497
497
  - alias_type_hint
498
498
  - dav_create_absolute_uri
499
499
  - dav_create_absolute_uri_type_hint
@@ -855,5 +855,5 @@ user:
855
855
  verify: '%{new_password}'
856
856
  responses:
857
857
  200:
858
- handler: simple
859
- message: 'Logged in user password changed'
858
+ handler: html_change_password
859
+ message: 'User %{user}''s password has been changed'
@@ -64,5 +64,28 @@ module RubyAem
64
64
  RubyAem::Result.new(message, response)
65
65
  end
66
66
 
67
+ # Check response body for indicator of change password failure.
68
+ #
69
+ # @param response HTTP response containing status_code, body, and headers
70
+ # @param response_spec response specification as configured in conf/spec.yaml
71
+ # @param call_params API call parameters
72
+ # @return RubyAem::Result
73
+ def Handlers.html_change_password(response, response_spec, call_params)
74
+
75
+ html = Nokogiri::HTML(response.body)
76
+ user = html.xpath('//body/div/table/tr/td/b/text()').to_s
77
+ desc = html.xpath('//body/div/table/tr/td/font/text()').to_s
78
+
79
+ if desc == 'Password successfully changed.'
80
+ call_params[:user] = user
81
+ message = response_spec['message'] % call_params
82
+ RubyAem::Result.new(message, response)
83
+ else
84
+ message = desc
85
+ result = RubyAem::Result.new(message, response)
86
+ raise RubyAem::Error.new(message, result)
87
+ end
88
+ end
89
+
67
90
  end
68
91
  end
@@ -44,11 +44,12 @@ module RubyAem
44
44
  def create(run_mode, config_node_name)
45
45
 
46
46
  name = RubyAem::Swagger.property_to_parameter(@call_params[:name])
47
+ type_hint_prefix = name.gsub(/^_/, '')
47
48
 
48
49
  @call_params[:run_mode] = run_mode
49
50
  @call_params[:config_node_name] = config_node_name
50
51
  @call_params["#{name}".to_sym] = @call_params[:value]
51
- @call_params["#{name}_type_hint".to_sym] = @call_params[:type]
52
+ @call_params["#{type_hint_prefix}_type_hint".to_sym] = @call_params[:type]
52
53
 
53
54
  config_name = Swagger.config_node_name_to_config_name(config_node_name)
54
55
  @client.call(self.class, __callee__.to_s.concat(config_name.downcase.gsub(/\s+/, '')), @call_params)
@@ -35,7 +35,11 @@ module RubyAem
35
35
  # @param property property name
36
36
  # @return swagger_aem parameter name
37
37
  def Swagger.property_to_parameter(property)
38
- property.gsub(/\./, '_')
38
+ if (['alias'].include? property)
39
+ "_#{property}"
40
+ else
41
+ property.gsub(/\./, '_').gsub(/-/, '_')
42
+ end
39
43
  end
40
44
 
41
45
  # Sanitise path value by removing leading and trailing slashes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-19 00:00:00.000000000 Z
12
+ date: 2017-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri