Package: ruby-aws-sdk / 1.66.0-1

use-correct-path-for-bundled-files Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Description: Use the correct path to load the blunded files

Author: David Suárez <david.sephirot@gmail.com>
Last-Update: 2014-09-22

--- a/lib/aws/core.rb
+++ b/lib/aws/core.rb
@@ -151,6 +151,8 @@ module AWS
 
   SRC = ROOT #+ '/vendor_ruby/aws'
 
+  SHARE = '/usr/share/ruby-aws-sdk'
+
   autoload :Errors, "#{SRC}/errors"
   autoload :Record, "#{SRC}/record"
   autoload :VERSION, "#{SRC}/version"
@@ -655,7 +657,7 @@ module AWS
       @versions ||= begin
         # get a list of support services/apis from disk
         versions = {}
-        pattern = File.join(File.dirname(__FILE__), 'api_config', '*.yml')
+        pattern = File.join(AWS::SHARE, 'api_config', '*.yml')
         Dir.glob(pattern).each do |path|
           path.match(/(\w+)-(\d{4}-\d{2}-\d{2})/)
           svc = SERVICES[$1].full_name
--- a/lib/aws/core/client.rb
+++ b/lib/aws/core/client.rb
@@ -688,8 +688,8 @@ module AWS
         #   (e.g. '2012-01-05').
         # @return [Hash]
         def load_api_config api_version
-          lib = File.dirname(File.dirname(__FILE__))
-          path = "#{lib}/api_config/#{service_name}-#{api_version}.yml"
+          #lib = File.dirname(File.dirname(__FILE__))
+          path = File.join(AWS::SHARE, "api_config/#{service_name}-#{api_version}.yml")
           YAML.load(File.read(path))
         end
 
--- a/lib/aws/core/configuration.rb
+++ b/lib/aws/core/configuration.rb
@@ -509,7 +509,7 @@ module AWS
       add_option :ssl_verify_peer, true, :boolean => true
 
       add_option :ssl_ca_file,
-        File.expand_path(File.dirname(__FILE__) + "/../../../ca-bundle.crt")
+        File.join(AWS::SHARE, 'ca-bundle.crt')
 
       add_option :ssl_ca_path
 
--- a/lib/aws/core/endpoints.rb
+++ b/lib/aws/core/endpoints.rb
@@ -27,7 +27,7 @@ module AWS
 
       def endpoints
         @endpoints ||= begin
-          JSON.parse(File.read(File.join(AWS::ROOT, 'endpoints.json')))
+          JSON.parse(File.read(File.join(AWS::SHARE, 'endpoints.json')))
         end
       end
       module_function :endpoints