odata-model 0.5.6 → 0.5.7

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: d2351d81fece6206c02a00af4072b5f4248cb17b
4
- data.tar.gz: 1e9e79bee92d5571c1b2ad5c2c71241a66fc178d
3
+ metadata.gz: f56aecd8c5071ce9f3b9acf1eca239c80bcfa9d8
4
+ data.tar.gz: 216c750f323face4dd7313632dc6fed744c019d0
5
5
  SHA512:
6
- metadata.gz: 5138578765cece54d80e2fa6d613592442c90e6c060fd94a126152ae718ed27e8c90c9275f17b43a9505dbe54692b138f09ff828ca0c0cb36ef5559967720747
7
- data.tar.gz: 52986ccf4a115e76a56b71336156941b9ef0984ca022eac11080b184eb542f2ec21ce943287bbeee4b1bcc68eac504bb08d125ee3f28a9398a879bd271611695
6
+ metadata.gz: 7674f7f9dd1d8827ce6e3c3f23e9cf263d6ab15dc77634ae4dc13db2720b6101dc5f1e54443133c6d8ccdeb56903bbb397b2628f614cd452774abbc9f38a1a05
7
+ data.tar.gz: 19ecc7169b74298563c8824a5d789d12c53171d8a091a398ce5c631bf96af6bb719f42e0784a6585602beb2d514b401badb3e0f41b8674a9c4f38645eb878e1a
@@ -5,32 +5,24 @@ module OData
5
5
  class Railtie < ::Rails::Railtie
6
6
  attr_accessor :configuration
7
7
 
8
- config.odata = ActiveSupport::OrderedOptions.new
9
-
10
8
  initializer('odata.load-config') do
11
- parse_configuration
12
- process_configuration
13
- end
14
-
15
- private
9
+ config_file = Rails.root.join('config', 'odata.yml').read
16
10
 
17
- def parse_configuration
18
- config_file = Rails.root.join('config', 'mongoid.yml')
19
11
  if config_file.file?
20
- parsed_config = YAML.load(config_file.read)
12
+ parsed_config = YAML.load(config_file)
21
13
  self.configuration = parsed_config.with_indifferent_access
22
- end
23
- end
24
14
 
25
- def process_configuration
26
- configuration[Rails.env].each do |service_name, service_details|
27
- url = service_details[:url]
28
- options = generate_options(service_name, service_details)
29
- OData::Service.open(url, options)
30
- validate_service_setup(service_name)
15
+ configuration[Rails.env].each do |service_name, service_details|
16
+ url = service_details[:url]
17
+ options = generate_options(service_name, service_details)
18
+ OData::Service.open(url, options)
19
+ validate_service_setup(service_name)
20
+ end
31
21
  end
32
22
  end
33
23
 
24
+ private
25
+
34
26
  def generate_options(service_name, service_details)
35
27
  options = { name: service_name }
36
28
  if service_details[:username] && service_details[:password]
@@ -1,5 +1,5 @@
1
1
  module OData
2
2
  module Model
3
- VERSION = '0.5.6'
3
+ VERSION = '0.5.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odata-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Thompson