ruby_aem 4.1.0 → 4.2.0

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: 364f15252d0e15d5109deb5162c2e68a064436f754fda9839ad0bee7d69a4dbd
4
- data.tar.gz: bb40460d828167a6b44b3bb921a3cc79621ca063f498a180a9a5b269cc243031
3
+ metadata.gz: ecce097e3cae4a4d5077d30e7f92596bf253e82dfa423b13dd2c6894cdf757ab
4
+ data.tar.gz: 5b7694a28a97e0e1cb233ae8f57c81be72c32fe4a3651d1ead294c8f2d9a2e7c
5
5
  SHA512:
6
- metadata.gz: dfab4aa798fbed53e5fe4b705324db3ba770b1d7b673b6e9508c59d7481fe59d2493ea22c49b6dfd17959062491d6c7693722de6f333f382ac38f833f0847d0c
7
- data.tar.gz: 394b101dad00b640afb6d207ef0d5e6666b72fc9f1c891b30a2fccdd2a39603b41e3011640eaf3cc872ed61becd07c4dc9eb5f2e9b7f80a1a31e3dcdbf5fbc1e
6
+ metadata.gz: 7c33633aa9abcbefe8787fa14350c365895556fa8875f5c3465da2d19a800171a22fbe017b04a467da5339742d52ce958ef03c39c878b5eaaa39bc78b19e4d15
7
+ data.tar.gz: d01309ca35d02122fb0f88aca354cd3acbb5cce233f896f6cbf9c89853e1c913c07aff075f5426ff5e93620a2d08a795736fa6f7dd70c61b57d735e680e74944
data/conf/gem.yaml CHANGED
@@ -1,2 +1,2 @@
1
1
  ---
2
- version: 4.1.0
2
+ version: 4.2.0
@@ -30,10 +30,12 @@ module RubyAem
30
30
  #
31
31
  # @param apis a hash of Swagger AEM client's API instances
32
32
  # @param spec ruby_aem specification
33
+ # @param follow_location if true, then HTTP redirects will be followed, default: false
33
34
  # @return new RubyAem::Client instance
34
- def initialize(apis, spec)
35
+ def initialize(apis, spec, follow_location: false)
35
36
  @apis = apis
36
37
  @spec = spec
38
+ @follow_location = follow_location
37
39
  end
38
40
 
39
41
  # Make an API call using the relevant Swagger AEM API client.
@@ -59,7 +61,8 @@ module RubyAem
59
61
  required_params.each_value { |value|
60
62
  params.push(value % call_params)
61
63
  }
62
- params.push({})
64
+ # Swagger AEM API clients take follow_location as a per-call option, not a configuration value
65
+ params.push({ follow_location: @follow_location })
63
66
  optional_params = action_spec['params']['optional'] || {}
64
67
  optional_params.each { |key, value|
65
68
  add_optional_param(key, value, params, call_params)
data/lib/ruby_aem.rb CHANGED
@@ -50,6 +50,7 @@ module RubyAem
50
50
  # - port: AEM instance port, default: 4502
51
51
  # - timeout: connection timeout in seconds, default: 300 seconds
52
52
  # - debug: if true, then additional debug messages will be included, default: false
53
+ # - follow_location: if true, then HTTP redirects will be followed, default: false
53
54
  # @return new RubyAem::Aem instance
54
55
  def initialize(conf = {})
55
56
  sanitise_conf(conf)
@@ -94,7 +95,7 @@ module RubyAem
94
95
 
95
96
  spec = YAML.load_file(File.expand_path('../../conf/spec.yaml', __FILE__))
96
97
 
97
- @client = RubyAem::Client.new(apis, spec)
98
+ @client = RubyAem::Client.new(apis, spec, follow_location: conf[:follow_location])
98
99
  end
99
100
 
100
101
  # Set default configuration values and handle numeric/boolean String values
@@ -107,12 +108,15 @@ module RubyAem
107
108
  conf[:host] ||= 'localhost'
108
109
  conf[:port] ||= 4502
109
110
  conf[:timeout] ||= 300
111
+ # don't follow redirects by default, ruby_aem relies on getting 302 responses back
112
+ conf[:follow_location] ||= false
110
113
  # handle custom configuration value being passed as a String
111
114
  # e.g. when the values are passed via environment variables
112
115
  conf[:port] = conf[:port].to_i
113
116
  conf[:timeout] = conf[:timeout].to_i
114
117
  conf[:verify_ssl] = conf[:verify_ssl] == 'true' if conf[:verify_ssl].is_a? String
115
118
  conf[:debug] = conf[:debug] == 'true' if conf[:debug].is_a? String
119
+ conf[:follow_location] = conf[:follow_location] == 'true' if conf[:follow_location].is_a? String
116
120
  end
117
121
 
118
122
  # Create an AEM instance.
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: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.0.0
47
+ version: 4.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.0.0
54
+ version: 4.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: swagger_aem_osgi
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0
61
+ version: 2.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0
68
+ version: 2.1.0
69
69
  description: ruby_aem is a Ruby client for Adobe Experience Manager (AEM) API, written
70
70
  on top of swagger_aem
71
71
  email: