leap_salesforce 0.2.2 → 0.2.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.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.gitlab-ci.yml +2 -2
- data/ChangeLog +4 -0
- data/Rakefile +1 -1
- data/lib/leap_salesforce/auth.rb +2 -1
- data/lib/leap_salesforce/error.rb +3 -1
- data/lib/leap_salesforce/generator/exe_helpers.rb +4 -4
- data/lib/leap_salesforce/generator/generator.rb +1 -0
- data/lib/leap_salesforce/generator/templates/.gitignore.erb +2 -1
- data/lib/leap_salesforce/loader.rb +1 -1
- data/lib/leap_salesforce/parameters.rb +4 -2
- data/lib/leap_salesforce/soql_data/tooling.rb +6 -4
- data/lib/leap_salesforce/version.rb +1 -1
- data/lib/leap_salesforce.rb +5 -3
- 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: c881f656d66f33e7114b3c35d66171657310ed97696c7b0fd66ed81ba3f6462c
|
4
|
+
data.tar.gz: 590ff727c864eae8c3cedfdd819e442fd86a3b4e988b371c86bce92c2de484c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 804633946e5efadfea7657a7725f57d8f3b08fa1e4dfeb4ce826e30bd8435bc058e0ac07d6fde6ce62e8417309c2f6effd30c028bccbaef31a4a9244c5cc1844
|
7
|
+
data.tar.gz: 52d08e6d6dc453e1bc934c2ff2f5ef310e01593a5ebf3eed4f51f84fd8e4e92bf649e83c6ee0329c02f0baaf6b1bb18209765d67fe261eb2788b3001cad5d566
|
data/.gitignore
CHANGED
@@ -9,8 +9,10 @@
|
|
9
9
|
Gemfile.lock
|
10
10
|
logs/
|
11
11
|
stub/
|
12
|
+
*/server.csr
|
12
13
|
.idea/workspace.xml
|
13
14
|
.idea/.rakeTasks
|
15
|
+
stub_log
|
14
16
|
|
15
17
|
# Generated files for now
|
16
18
|
spec/support/
|
@@ -23,4 +25,5 @@ config/credentials/
|
|
23
25
|
|
24
26
|
# sfdx
|
25
27
|
/JWT/
|
26
|
-
/scripts/setup_env.sh
|
28
|
+
/scripts/setup_env.sh
|
29
|
+
sf_log.log
|
data/.gitlab-ci.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
include:
|
2
2
|
- template: Code-Quality.gitlab-ci.yml
|
3
3
|
|
4
|
-
image: ruby:2.
|
4
|
+
image: ruby:2.6
|
5
5
|
|
6
6
|
stages:
|
7
7
|
- test
|
@@ -11,7 +11,7 @@ variables:
|
|
11
11
|
client_id: $client_id
|
12
12
|
client_secret: $client_secret
|
13
13
|
SERVER_KEY_PASSWORD: $SERVER_KEY_PASSWORD
|
14
|
-
|
14
|
+
LANG: 'UTF-8'
|
15
15
|
|
16
16
|
.sfdx_helpers: &sfdx_helpers |
|
17
17
|
|
data/ChangeLog
CHANGED
data/Rakefile
CHANGED
data/lib/leap_salesforce/auth.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_relative 'error'
|
3
4
|
|
4
5
|
module LeapSalesforce
|
@@ -47,7 +48,7 @@ module LeapSalesforce
|
|
47
48
|
def jwt_file?
|
48
49
|
ENV['JWT_FOLDER'] ||= Dir.exist?('JWT') ? 'JWT' : 'assets'
|
49
50
|
unless File.exist?(File.join(ENV['JWT_FOLDER'], 'server.key'))
|
50
|
-
raise LeapSalesforce::SetupError 'Please create JWT file in ' \
|
51
|
+
raise LeapSalesforce::SetupError, 'Please create JWT file in ' \
|
51
52
|
" '#{ENV['JWT_FOLDER']}/server.key' following #{SETUP_JWT_LINK}"
|
52
53
|
end
|
53
54
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LeapSalesforce
|
2
4
|
# Any error specific to LeapSalesforce
|
3
5
|
class Error < StandardError; end
|
@@ -9,4 +11,4 @@ module LeapSalesforce
|
|
9
11
|
class SetupError < Error; end
|
10
12
|
# Error related to Test Users
|
11
13
|
class UserError < Error; end
|
12
|
-
end
|
14
|
+
end
|
@@ -35,12 +35,12 @@ module LeapSalesforce
|
|
35
35
|
unless LeapSalesforce.sfdx
|
36
36
|
LeapSalesforce.client_id = options[:client_id] || input_for('Client id (Customer Id)')
|
37
37
|
LeapSalesforce.client_secret = options[:client_secret] || STDIN.getpass('Client secret (Consumer Secret)')
|
38
|
-
LeapSalesforce.api_user = ERB.new(options[:username] || input_for('Salesforce username. It is ideal to start with a System admin' \
|
39
|
-
' so that any necessary metadata can be read. More users can be added later. You can use ERB to make name' \
|
40
|
-
' vary according to environment (e.g., test.user@<%= LeapSalesforce.environment %>.my.company.com)')).result(binding)
|
41
38
|
LeapSalesforce.password = options[:password] || STDIN.getpass('Password (Recommendation is that 1 password' \
|
42
39
|
' be shared across all test users to be easier to manage):')
|
43
40
|
end
|
41
|
+
LeapSalesforce.api_user = ERB.new(options[:username] || input_for('Salesforce username. It is ideal to start with a System admin' \
|
42
|
+
' so that any necessary metadata can be read. More users can be added later. You can use ERB to make name' \
|
43
|
+
' vary according to environment (e.g., test.user@<%= LeapSalesforce.environment %>.my.company.com)')).result(binding)
|
44
44
|
LeapSalesforce.oauth_working?
|
45
45
|
end
|
46
46
|
|
@@ -53,4 +53,4 @@ module LeapSalesforce
|
|
53
53
|
@user_key = options[:user_key] || input_for('Enter a key to refer to this user (This will be stored as a Symbol)')
|
54
54
|
end
|
55
55
|
end
|
56
|
-
end
|
56
|
+
end
|
@@ -49,8 +49,10 @@ module LeapSalesforce
|
|
49
49
|
Soaspec::OAuth2.debug_oauth = true
|
50
50
|
Soaspec::OAuth2.new(LeapSalesforce.oauth_settings).access_token
|
51
51
|
end
|
52
|
-
rescue StandardError
|
53
|
-
raise LeapSalesforce::SetupError, "Cannot perform OAuth. See 'logs'
|
52
|
+
rescue StandardError => e
|
53
|
+
raise LeapSalesforce::SetupError, "Cannot perform OAuth. See 'logs'" \
|
54
|
+
' folder for details of what was sent. ' \
|
55
|
+
"Error caused by #{e.message} from #{e.backtrace}"
|
54
56
|
else
|
55
57
|
puts "\u2713 OAuth successful".colorize :green
|
56
58
|
Soaspec::OAuth2.debug_oauth = false
|
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LeapSalesforce
|
2
4
|
# Methods to interact with tooling API.
|
3
5
|
# See https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resources.htm
|
4
6
|
module Tooling
|
5
7
|
def tooling_objects
|
6
|
-
new(
|
7
|
-
method: :get, suburl:
|
8
|
+
new('Tooling sobjects',
|
9
|
+
method: :get, suburl: 'tooling/sobjects')
|
8
10
|
end
|
9
11
|
|
10
12
|
def run_test_asynchronous
|
11
13
|
new('Test run async', method: :post,
|
12
|
-
|
14
|
+
suburl: 'tooling/runTestsAsynchronous/')
|
13
15
|
end
|
14
16
|
end
|
15
|
-
end
|
17
|
+
end
|
data/lib/leap_salesforce.rb
CHANGED
@@ -39,10 +39,12 @@ module LeapSalesforce
|
|
39
39
|
|
40
40
|
config_folder_path = File.join(Dir.pwd, config_folder)
|
41
41
|
general_file = File.join(config_folder_path, 'general')
|
42
|
-
|
43
|
-
|
42
|
+
if environment
|
43
|
+
specific_environment_file = File.join(config_folder_path, 'environments',
|
44
|
+
environment)
|
45
|
+
require specific_environment_file if File.exist? "#{specific_environment_file}.rb"
|
46
|
+
end
|
44
47
|
require general_file if File.exist? "#{general_file}.rb"
|
45
|
-
require specific_environment_file if File.exist? "#{specific_environment_file}.rb"
|
46
48
|
|
47
49
|
if sfdx
|
48
50
|
# Assume authentication already made through 'sfdx force:auth:jwt:grant'
|
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.3
|
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: 2019-09-
|
12
|
+
date: 2019-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|