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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69e8213e3c549f071e45176cfc12a1afbe0b9e8ce33f762cf7afc29100f92e50
4
- data.tar.gz: 5429ba30864fa6c0627ca2ee93def140f563edf9f74575434dddc244b80e1aa8
3
+ metadata.gz: c881f656d66f33e7114b3c35d66171657310ed97696c7b0fd66ed81ba3f6462c
4
+ data.tar.gz: 590ff727c864eae8c3cedfdd819e442fd86a3b4e988b371c86bce92c2de484c6
5
5
  SHA512:
6
- metadata.gz: e595bfdf19c9c9deff83ef5c705c692922d83448fa1816e3b4da3541e3ec00ae0251269297f99a665f9a4a4d5dc44b658d86865c26f5b5cc90b779018abe5b77
7
- data.tar.gz: f7e3d35252748f0f4e8763a9087fe3e5dca91ed27da54d25d33147b61fba91bade06fbe9cb9fb98a9efe28095dd63cc1b151ce8421e73b8274f4e4bf947cdc84
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.5
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
@@ -1,3 +1,7 @@
1
+ Version 0.2.3
2
+ * Enhancement
3
+ * Get sfdx init working with `leap_salesforce init sfdx=true`
4
+
1
5
  Version 0.2.2
2
6
  * Bug fix
3
7
  * Ids were being interpreted as DateTimes by `type_of_time?`. Made check
data/Rakefile CHANGED
@@ -33,4 +33,4 @@ YARD::Doctest::RakeTask.new do |task|
33
33
  # task.pattern = 'lib/**/*.rb'
34
34
  # TODO: Get all examples working in this way
35
35
  task.pattern = 'lib/leap_salesforce/ext/string.rb'
36
- end
36
+ end
@@ -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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'erb'
3
4
  require 'fileutils'
4
5
  require_relative 'exe_helpers'
@@ -3,4 +3,5 @@ config/credentials/ # Confidential files stored
3
3
 
4
4
  # sfdx
5
5
  /JWT/
6
- /scripts/setup_env.sh
6
+ /scripts/setup_env.sh
7
+ */server.csr
@@ -23,4 +23,4 @@ module LeapSalesforce
23
23
  end
24
24
  end
25
25
  end
26
- end
26
+ 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' folder for details of what was sent"
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("Tooling sobjects",
7
- method: :get, suburl: "tooling/sobjects")
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
- suburl: 'tooling/runTestsAsynchronous/')
14
+ suburl: 'tooling/runTestsAsynchronous/')
13
15
  end
14
16
  end
15
- end
17
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.3'
6
6
  end
@@ -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
- specific_environment_file = File.join(config_folder_path, 'environments',
43
- environment)
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.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-05 00:00:00.000000000 Z
12
+ date: 2019-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler