databasedotcom 1.0.2 → 1.0.3

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.
@@ -64,17 +64,16 @@ module Databasedotcom
64
64
  self.client_secret = url_options[:oauth_secret]
65
65
  self.username = url_options[:user]
66
66
  self.password = url_options[:password]
67
- self.sobject_module = "Databasedotcom::Sobject"
68
67
  else
69
68
  self.client_id = ENV['DATABASEDOTCOM_CLIENT_ID'] || @options[:client_id]
70
69
  self.client_secret = ENV['DATABASEDOTCOM_CLIENT_SECRET'] || @options[:client_secret]
71
70
  self.host = ENV['DATABASEDOTCOM_HOST'] || @options[:host] || "login.salesforce.com"
72
- self.debugging = ENV['DATABASEDOTCOM_DEBUGGING'] || @options[:debugging]
73
- self.version = ENV['DATABASEDOTCOM_VERSION'] || @options[:version]
74
- self.version = self.version.to_s if self.version
75
- self.sobject_module = ENV['DATABASEDOTCOM_SOBJECT_MODULE'] || (@options && @options[:sobject_module])
76
71
  end
77
- end
72
+ self.debugging = ENV['DATABASEDOTCOM_DEBUGGING'] || @options[:debugging]
73
+ self.version = ENV['DATABASEDOTCOM_VERSION'] || @options[:version]
74
+ self.version = self.version.to_s if self.version
75
+ self.sobject_module = ENV['DATABASEDOTCOM_SOBJECT_MODULE'] || @options[:sobject_module]
76
+ end
78
77
 
79
78
  # Authenticate to the Force.com API. _options_ is a Hash, interpreted as follows:
80
79
  #
@@ -355,7 +354,7 @@ module Databasedotcom
355
354
  end
356
355
 
357
356
  def module_namespace
358
- self.sobject_module || Object
357
+ (self.sobject_module && self.sobject_module.constantize) || Object
359
358
  end
360
359
 
361
360
  def collection_from(response)
@@ -5,4 +5,12 @@ class String
5
5
  def resourcerize
6
6
  self.gsub(/([a-z])([A-Z])/, '\1-\2').downcase
7
7
  end
8
- end
8
+
9
+ def constantize
10
+ unless /\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/ =~ self
11
+ raise NameError, "#{self.inspect} is not a valid constant name!"
12
+ end
13
+ Object.module_eval("::#{$1}", __FILE__, __LINE__)
14
+ end
15
+
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Databasedotcom
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: databasedotcom
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Glenn Gillen, Danny Burkes & Richard Zhao