leap_salesforce 1.0.2 → 1.0.3

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: '08942c56565447b0c7fa381bb9b853f1553b17683b53cf801be10ee777d6e4e0'
4
- data.tar.gz: 3f6ef92d1f1d198f4512dd452bed489246e598a3a838eb4dec503098d96ee61b
3
+ metadata.gz: 4be38bd8ce1f453e3bc8f3df55d5a1f40f865418c4adf644dab67201eb514fd3
4
+ data.tar.gz: ac32404fee3b6164b5ddf7abee76a55676a875076c794b6835d161bdefaf391e
5
5
  SHA512:
6
- metadata.gz: 2e28c9f6dda53de160fe0eab240a174ce92043662d089cfd329de54d0fc3a4fcc70c25edafa5ec2a5aeea1b2b25986b1df67c24dbff3189bfb7fed321905dfbe
7
- data.tar.gz: b57058beb487934fbc70ce50d9ac1467c0970d0fc14f82e9cb328e7cc3c0ba807599c58f8cdf75e2e269c6679c44c058d4e54e4da386319765e2b374833bb4e3
6
+ metadata.gz: f559edafcf8316958d80af27bf161e59bf334c205d02981ec5ca420e59c190a7addda14fd5367f05ffe67b8fc955148898c247afcff264666b70a326a98a75ef
7
+ data.tar.gz: 3ddc1fd2fd1fdb552978ae238bde821963c243f064e32f36e54b61382176506ae2bce3c26b746b6c3403c6de1a6bc546d9bf687a849ca5aa3169650e4f13504f
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 1.0.3
2
+ * Enhancement
3
+ * Allow templates to be sourced from external gems for generator
4
+
1
5
  Version 1.0.2
2
6
  * Enhancement
3
7
  * Only load sub folders of leap_salesforce.lib_folder that are needed by this gem, allowing room for UI
@@ -8,11 +8,20 @@ require 'colorize'
8
8
  module LeapSalesforce
9
9
  # Generators for creating code
10
10
  module Generator
11
+ # @param [String] filename Relative filename to this file
12
+ # @param [String] folder Folder where templates are stored (for external gems)
13
+ # @return [String] Location of template file
14
+ def template_loc(filename, folder: nil)
15
+ template_dir = folder || __dir__
16
+ File.join(template_dir, 'templates', filename)
17
+ end
18
+
11
19
  # @param [String] filename Relative filename to this file
12
20
  # @param [Binding] binding Binding object used for ERB variables
21
+ # @param [String] folder Folder where templates are stored (for external gems)
13
22
  # @return [String] Interpreted file after calculating ERB for template file passed
14
- def read_template(filename, binding)
15
- ERB.new(File.read(File.join(__dir__, 'templates', filename))).result(binding)
23
+ def read_template(filename, binding, folder: nil)
24
+ ERB.new(File.read(template_loc(filename, folder: folder))).result(binding)
16
25
  end
17
26
 
18
27
  # Generate file creating necessary folder if necessary
@@ -70,7 +70,7 @@ module LeapSalesforce
70
70
 
71
71
  # Clean up files generated for all picklists
72
72
  def cleanup_files_created
73
- `rubocop -a #{ENUM_FOLDER} --display-only-fail-level-offenses --enable-pending-cops`
73
+ `rubocop -A #{ENUM_FOLDER} --display-only-fail-level-offenses --enable-pending-cops`
74
74
  end
75
75
  end
76
76
  end
@@ -62,8 +62,8 @@ module LeapSalesforce
62
62
  generate_field_module
63
63
  generate_factory
64
64
  end
65
- `rubocop -a #{SOQL_OBJECT_FOLDER} --enable-pending-cops`
66
- `rubocop -a #{FACTORY_FOLDER} --enable-pending-cops`
65
+ `rubocop -A #{SOQL_OBJECT_FOLDER} --enable-pending-cops`
66
+ `rubocop -A #{FACTORY_FOLDER} --enable-pending-cops`
67
67
  end
68
68
 
69
69
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '1.0.2'
5
+ VERSION = '1.0.3'
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: 1.0.2
4
+ version: 1.0.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: 2021-01-29 00:00:00.000000000 Z
12
+ date: 2021-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler