pr-with-params 1.2.1 → 1.3.0

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: c782747263091187d47cf06777699c11fea56d9fb74d1fd137c4cde86216a911
4
- data.tar.gz: f8217fa6768ed3ed8f81d553a496ab84e7008e8c493f5cac3232dc8606a35fa5
3
+ metadata.gz: e73e0d7cdcfe3e16d632105a2a54564b94e04b0fe523a7faa3449e11e6ad7edb
4
+ data.tar.gz: 3260ff8eec71435baf10bbce8ba8633b37077e8d8e26dad28c6ee729a23e6783
5
5
  SHA512:
6
- metadata.gz: e5b569b26a32a57e47323544eaef3b56f538afce354cb3c2d33cb3d23f096b2070f0855fbc9c0111c46412627585c94493b12898569d7ca93c3c33785439d141
7
- data.tar.gz: 5fbf9e79107c81f09337f11f2fa0c91423df37bfc51b5dd759e77c07815a1d99053bb5e0d6f0ae930082bea9564837a28973ffefc56115138446389f20f95d08
6
+ metadata.gz: 4039bc9e0d935d8355899f6b71c34b958d7900c447e710c6fccfe12dea0e4172279207cd8bd559226da2e4e33c1cd90961f9d1221d21ddc2349a6748aae457e5
7
+ data.tar.gz: 0ead5bf501b295bf8892600773872c9132a8857de609d78146636de50d4447cdf37e0ad746b0f81d765b4c2b5e859ece057d74d310defb3859decd6c85a2c3ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pr-with-params (1.2.1)
4
+ pr-with-params (1.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/pr-with-params CHANGED
@@ -90,12 +90,11 @@ begin
90
90
  `sleep 1`
91
91
  PR::With::Params.open(host: uri_host, path: uri_path, query: options)
92
92
  rescue StandardError => e
93
- error_message = {
94
- message: 'An error occurred while building or opening your custom pull request URL',
95
- reason: e.message,
96
- backtrace: e.backtrace&.last(10)
97
- }.to_json
93
+ message = "\e[31mERROR\e[0m: An error occurred while building or opening your custom pull request URL"
94
+ reason = "reason: #{e.message}"
95
+ backtrace = "backtrace: #{e.backtrace&.last(10)&.join("\n")}"
96
+ error_message = [message, reason, backtrace, "\n\n"].join("\n")
98
97
 
99
- warn "\e[31mERROR\e[0m: " + error_message + "\n"
98
+ warn error_message
100
99
  exit 1
101
100
  end
@@ -25,7 +25,7 @@ module PR
25
25
  end
26
26
 
27
27
  class ConventionalCommitValidator
28
- CONVENTIONAL_COMMIT_REGEX = /^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?(!)?(: (.*\s*)*))|(^Merge (.*\s*)*)|(^Initial commit$)/.freeze
28
+ CONVENTIONAL_COMMIT_REGEX = /^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(!)?(: (.*\s*)*))|(^Merge (.*\s*)*)|(^Initial commit$)/.freeze
29
29
 
30
30
  def initialize(options)
31
31
  @commit_message = options[:title]
@@ -3,7 +3,7 @@
3
3
  module PR
4
4
  module With
5
5
  module Params
6
- VERSION = "1.2.1"
6
+ VERSION = "1.3.0"
7
7
  end
8
8
  end
9
9
  end
@@ -21,15 +21,16 @@ module PR
21
21
  end
22
22
 
23
23
  def parse_config(file_path, scope)
24
+ ConfigParser.new(config_file_path: file_path, scope: scope).parse!
25
+
24
26
  file_path.empty? ? {} : ConfigParser.new(config_file_path: file_path, scope: scope).parse!
25
27
  rescue StandardError => e
26
- error_message = {
27
- message: "Error parsing config file. Using defaults",
28
- reason: e.message,
29
- backtrace: e.backtrace&.last(10)
30
- }.to_json
28
+ message = "\e[35mWARNING\e[0m: Error parsing config file. Using defaults"
29
+ reason = "reason: #{e.message}"
30
+ backtrace = "backtrace: #{e.backtrace&.last(10)&.join("\n")}"
31
+ error_message = [message, reason, backtrace, "\n\n"].join("\n")
31
32
 
32
- warn "\e[35mWARNING\e[0m: " + error_message + "\n"
33
+ warn error_message
33
34
 
34
35
  {}
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pr-with-params
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2k-joker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: