leap_salesforce 0.2.23 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/ChangeLog +5 -0
- data/config/environments/prod.rb +2 -0
- data/config/general.rb +1 -1
- data/exe/leap_salesforce +1 -1
- data/lib/leap_salesforce/ext/string.rb +9 -2
- data/lib/leap_salesforce/leaps.rb +3 -1
- data/lib/leap_salesforce/soql_data/soql_global_object_data.rb +6 -0
- data/lib/leap_salesforce/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b9311c1afc5593fb4b3428de805b3a2a9c5a6e8331d827dd40b9d5b60e09d8d
|
4
|
+
data.tar.gz: 9532ceffad0924438eb87b97378faeadd6729e27bc396439a4934f2ee71f71e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c81db35151f84596e6d0b80815bebfdcf3f582be9ee2457eb46fe90b06bf989af780be6e9333dbf1de5bae3797193605849f54d87c7652f352ed741ceeb0cfc
|
7
|
+
data.tar.gz: a8998c522c93ed383524758d91dceac18fd6fdf8af41f5db8db3f9898a3be93e6e6f03cb63dd0277bd9a4e404403ebe5929636278c3b92878df89c081be4ac5a
|
data/.rubocop.yml
CHANGED
data/ChangeLog
CHANGED
data/config/environments/prod.rb
CHANGED
data/config/general.rb
CHANGED
data/exe/leap_salesforce
CHANGED
@@ -6,14 +6,21 @@ require 'active_support/core_ext/string'
|
|
6
6
|
require 'date'
|
7
7
|
require 'json'
|
8
8
|
|
9
|
+
class MockHandler < Soaspec::RestHandler
|
10
|
+
base_url 'mock_url'
|
11
|
+
end
|
12
|
+
|
9
13
|
# Override string object to provide convenience methods for Strings
|
10
14
|
class String
|
11
15
|
# @return [Array] List of keywords reserved for FactoryBot
|
12
|
-
FACTORY_WORDS = ['sequence']
|
16
|
+
FACTORY_WORDS = ['sequence'].freeze
|
13
17
|
# @return [Array] List of ruby keywords. Some words are only key to FactoryBot like 'sequence'
|
14
18
|
KEYWORDS = %w[BEGIN END __ENCODING__ __END__ __FILE__ __LINE__ alias and begin break case class def defined?
|
15
19
|
do else elsif end ensure false for if in module next nil not or redo rescue retry return
|
16
20
|
self super then true undef unless until when while yield private].freeze
|
21
|
+
Soaspec.api_handler = MockHandler.new
|
22
|
+
SOQLDATA_METHODS = Exchange.new.public_methods.collect(&:to_s)
|
23
|
+
|
17
24
|
# @note This removes '?' which is allowed in a method but is not desired for automatic creation of their names
|
18
25
|
# in the way that is being used here
|
19
26
|
# @return [String] Convert string to something that would be friendly to use as in Ruby
|
@@ -112,6 +119,6 @@ class String
|
|
112
119
|
|
113
120
|
# @return [Boolean] Whether string is a Ruby keyword
|
114
121
|
def keyword?
|
115
|
-
KEYWORDS.include?(self) || FACTORY_WORDS.include?(self)
|
122
|
+
KEYWORDS.include?(self) || FACTORY_WORDS.include?(self) || SOQLDATA_METHODS.include?(self)
|
116
123
|
end
|
117
124
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Create a Leaps alias to LeapSalesforce as it's faster to type.
|
2
4
|
# This will not be automatically required in case as 'Leaps' may be defined elsewhere
|
3
5
|
|
4
6
|
require 'leap_salesforce'
|
5
|
-
Leaps = LeapSalesforce
|
7
|
+
Leaps = LeapSalesforce
|
@@ -154,6 +154,12 @@ module SoqlGlobalObjectData
|
|
154
154
|
# @param [Symbol, String] name Name of accessor to refer to field/element with
|
155
155
|
# @param [String] backend_name Name of Salesforce field
|
156
156
|
def soql_element(name, backend_name)
|
157
|
+
if String::SOQLDATA_METHODS.include?(name.to_s)
|
158
|
+
LeapSalesforce.logger.warn "Cannot create metadata for '#{name}' (defined at #{caller_locations[0]})" \
|
159
|
+
' as method already defined in SoqlData'
|
160
|
+
return
|
161
|
+
end
|
162
|
+
|
157
163
|
# Either set the element (if creating a new record) or update the object
|
158
164
|
# @param [String] new_value Value to update record to
|
159
165
|
define_method("#{name}=") do |new_value|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-03-
|
12
|
+
date: 2020-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|