pr-with-params 1.3.0 → 1.3.1

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: e73e0d7cdcfe3e16d632105a2a54564b94e04b0fe523a7faa3449e11e6ad7edb
4
- data.tar.gz: 3260ff8eec71435baf10bbce8ba8633b37077e8d8e26dad28c6ee729a23e6783
3
+ metadata.gz: 4374906553024e9cff3a612ac9baa8aed678fe6a025f6a7ad15c060b145a11c8
4
+ data.tar.gz: 2f0b0cc426dbbd284a19e74ae1ee197a12941957ae1bf95cbcd13517e0578dcc
5
5
  SHA512:
6
- metadata.gz: 4039bc9e0d935d8355899f6b71c34b958d7900c447e710c6fccfe12dea0e4172279207cd8bd559226da2e4e33c1cd90961f9d1221d21ddc2349a6748aae457e5
7
- data.tar.gz: 0ead5bf501b295bf8892600773872c9132a8857de609d78146636de50d4447cdf37e0ad746b0f81d765b4c2b5e859ece057d74d310defb3859decd6c85a2c3ed
6
+ metadata.gz: 0cfa3f9578b19dfcd1ba614cfa4dfc7b8b7001f057f00e3678ba3f42e2d3345c0d7a85886adb6e5891f622c5d35de10b9ab565643df973c30d10e5e58341e9ee
7
+ data.tar.gz: b92649ee79ff701cd40c20a78ecdf869700a6aa13f38dbb1fadc1628be66a7dc94248a8e7fc05ff1dd27f838c237e7d935378a275f4c1112d0aafddf45441e9e
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ # All Cops
2
+ AllCops:
3
+ TargetRubyVersion: 3.1.2
1
4
  # Style
2
5
  Style/StringLiterals:
3
6
  Enabled: false
data/Gemfile CHANGED
@@ -8,4 +8,3 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
  gem "minitest", "~> 5.0"
10
10
  gem "rubocop", "~> 0.80"
11
- gem "launchy"
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pr-with-params (1.3.0)
4
+ pr-with-params (1.3.1)
5
+ launchy (~> 2.5)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
- addressable (2.8.0)
10
- public_suffix (>= 2.0.2, < 5.0)
10
+ addressable (2.8.1)
11
+ public_suffix (>= 2.0.2, < 6.0)
11
12
  ast (2.4.2)
12
13
  launchy (2.5.0)
13
14
  addressable (~> 2.7)
@@ -15,7 +16,7 @@ GEM
15
16
  parallel (1.22.1)
16
17
  parser (3.1.2.0)
17
18
  ast (~> 2.4.1)
18
- public_suffix (4.0.7)
19
+ public_suffix (5.0.1)
19
20
  rainbow (3.1.1)
20
21
  rake (13.0.6)
21
22
  regexp_parser (2.5.0)
@@ -38,7 +39,6 @@ PLATFORMS
38
39
  arm64-darwin-21
39
40
 
40
41
  DEPENDENCIES
41
- launchy
42
42
  minitest (~> 5.0)
43
43
  pr-with-params!
44
44
  rake (~> 13.0)
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # PR::With::Params [![Gem Version](https://badge.fury.io/rb/pr-with-params.svg)](https://badge.fury.io/rb/pr-with-params)
2
- A lightweight gem that pushes current local branch to remote with upstream at origin/[local-branch-name]. It also opens a new pull request browser window at a URL with customized query params, based on specified options, which pre-populates certain fields in the pull request. This is especially useful when supporting multiple PR templates within a code base.
2
+ A lightweight ruby gem that pushes current local branch to remote with upstream at origin/[local-branch-name]. It also opens a new pull request browser window at a URL with customized query params, based on specified options, which pre-populates certain fields in the pull request. This is especially useful when supporting multiple PR templates within a code base.
3
3
 
4
4
  Inspired by GitHub's documentation on [using query params to create pull requets](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/using-query-parameters-to-create-a-pull-request)
5
5
 
6
+ ## Prerequisites
7
+ This gem currently uses the [launchy gem](https://github.com/copiousfreetime/launchy) to open URLs. Ensure your code base satisfies launchy's dependencies.
8
+
6
9
  ## Installation
7
10
 
8
11
  Add this line to your application's Gemfile:
data/exe/pr-with-params CHANGED
@@ -23,6 +23,13 @@ parser = OptionParser.new do |opt|
23
23
 
24
24
  opt.separator ''
25
25
 
26
+ opt.on('-v', '--version', 'Returns your current local gem version') do |_h|
27
+ puts 'pr-with-params ' + PR::With::Params::VERSION
28
+ exit
29
+ end
30
+
31
+ opt.separator ''
32
+
26
33
  opt.on('--conf FILE_PATH', 'Path to yaml file where options are defined. NOTE that relative paths are not supported.') do |conf_file|
27
34
  stdout, _stderr, _status = Open3.capture3("echo #{conf_file}")
28
35
  config_file_path = stdout.chomp
@@ -32,7 +39,7 @@ parser = OptionParser.new do |opt|
32
39
  config_scope = scope
33
40
  end
34
41
 
35
- opt.on('--base-branch BRANCH', "Specify the base branch for your PR (e.g: 'develop'). Will use default branch otherwise.") do |pr_base_branch|
42
+ opt.on('-b', '--base-branch BRANCH', "Specify the base branch for your PR (e.g: 'develop'). Will use default branch otherwise.") do |pr_base_branch|
36
43
  options[:base_branch] = pr_base_branch
37
44
  end
38
45
 
@@ -70,7 +77,7 @@ begin
70
77
  default_title = `git show-branch --no-name $(git log #{base_branch}..#{branch_name} --pretty=format:"%h" | tail -1)`.chomp
71
78
  options[:title] ||= default_title
72
79
 
73
- PR::With::Params.validate_options(options)
80
+ PR::With::Params.validate_options!(options)
74
81
 
75
82
  remote_git_uri = `git config --get remote.origin.url`.sub('git@github.com:', '').sub('.git', '').chomp
76
83
  uri_host = 'www.github.com'
@@ -3,7 +3,7 @@
3
3
  module PR
4
4
  module With
5
5
  module Params
6
- VERSION = "1.3.0"
6
+ VERSION = "1.3.1"
7
7
  end
8
8
  end
9
9
  end
@@ -21,8 +21,6 @@ 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
-
26
24
  file_path.empty? ? {} : ConfigParser.new(config_file_path: file_path, scope: scope).parse!
27
25
  rescue StandardError => e
28
26
  message = "\e[35mWARNING\e[0m: Error parsing config file. Using defaults"
@@ -35,7 +33,7 @@ module PR
35
33
  {}
36
34
  end
37
35
 
38
- def validate_options(options)
36
+ def validate_options!(options)
39
37
  validators = options.delete(:validators)
40
38
  OptionsValidator.validate!(options, validators: validators)
41
39
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "Pushes current local branch to remote with upstream at origin/[local-branch-name]. It also opens a new pull request browser window at a URL with customized query params, based on specified options, which pre-populates certain fields in the pull request. This is especially useful when supporting multiple PR templates within a code base."
12
12
  spec.homepage = "https://github.com/2k-joker/pr-with-params"
13
13
  spec.licenses = ["MIT"]
14
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
 
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  # Uncomment to register a new dependency of your gem
28
- # spec.add_dependency "example-gem", "~> 1.0"
28
+ spec.add_dependency "launchy", "~> 2.5"
29
29
 
30
30
  # For more information and examples about making a new gem, checkout our
31
31
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pr-with-params
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
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-10-10 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-12-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: launchy
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
13
27
  description:
14
28
  email:
15
29
  - kum.vanjunior@gmail.com
@@ -48,14 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
62
  requirements:
49
63
  - - ">="
50
64
  - !ruby/object:Gem::Version
51
- version: 2.3.0
65
+ version: 3.1.0
52
66
  required_rubygems_version: !ruby/object:Gem::Requirement
53
67
  requirements:
54
68
  - - ">="
55
69
  - !ruby/object:Gem::Version
56
70
  version: '0'
57
71
  requirements: []
58
- rubygems_version: 3.2.3
72
+ rubygems_version: 3.3.26
59
73
  signing_key:
60
74
  specification_version: 4
61
75
  summary: Pushes current local branch to remote with upstream at origin/[local-branch-name].