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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da79723306cce1184458cea71bcd195548c701f48fa3de87961d2d95becc99d4
4
- data.tar.gz: 587308a13bfd4164e27638c82ee8adc59a833165aaeb3561b26b17e944ab455e
3
+ metadata.gz: 5b9311c1afc5593fb4b3428de805b3a2a9c5a6e8331d827dd40b9d5b60e09d8d
4
+ data.tar.gz: 9532ceffad0924438eb87b97378faeadd6729e27bc396439a4934f2ee71f71e7
5
5
  SHA512:
6
- metadata.gz: eeb1dfacd0c1812b5637c7709d34303a7e852e308f87d8c789e6993aecf9ab3261a3c90df42cdde17d49ed337b14ac5c0a00998de639fc8bd98b2617150a2a9e
7
- data.tar.gz: 0d5ca787cdebd092f3a21c1489d57b56f0236272740fe1129e945729cda776eea007f66b2e1b021a5b217db9c28f6c696fa7836f9df841cb89cdb4049239449d
6
+ metadata.gz: 1c81db35151f84596e6d0b80815bebfdcf3f582be9ee2457eb46fe90b06bf989af780be6e9333dbf1de5bae3797193605849f54d87c7652f352ed741ceeb0cfc
7
+ data.tar.gz: a8998c522c93ed383524758d91dceac18fd6fdf8af41f5db8db3f9898a3be93e6e6f03cb63dd0277bd9a4e404403ebe5929636278c3b92878df89c081be4ac5a
data/.rubocop.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  # Modifies RuboCop (Static analysis tool)
2
- Layout/LineLength:
2
+ Metrics/LineLength:
3
3
  Max: 160
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.2.24
2
+ * Bug fix
3
+ * Handle metadata label name that is the same name as a method on SoqlData (which one would not want overwriting)
4
+ such as 'status_code'
5
+
1
6
  Version 0.2.23
2
7
  * Enhancement
3
8
  * Raise better error when could not find record using query
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Files with the format 'env.rb' should be used if
2
4
 
3
5
  Soaspec::OAuth2.debug_oauth = false # Turn this true if you need debug authentication
data/config/general.rb CHANGED
@@ -7,4 +7,4 @@ module LeapSalesforce
7
7
  Users.add User.new :cet, 'test.cet@brave-otter-ttxype.com'
8
8
  end
9
9
 
10
- ENV['SF_USERNAME'] = 'samuel.garratt@brave-otter-ttxype.com'
10
+ ENV['SF_USERNAME'] = 'samuel.garratt@brave-otter-ttxype.com'
data/exe/leap_salesforce CHANGED
@@ -56,4 +56,4 @@ module LeapSalesforce
56
56
  end
57
57
  end
58
58
 
59
- LeapSalesforce::Exe.start(ARGV)
59
+ LeapSalesforce::Exe.start(ARGV)
@@ -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|
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '0.2.23'
5
+ VERSION = '0.2.24'
6
6
  end
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.23
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-14 00:00:00.000000000 Z
12
+ date: 2020-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler