master_to_main 0.0.2 → 0.0.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: 6a64928607b005c31d0d4ad4e01994c12733d5744bd75d72fcf9e3d58279be81
4
- data.tar.gz: 2b72700b70c3d2f07ca291e3b18e0d147fbf1e4ae5636ba124af0d522bed8db1
3
+ metadata.gz: 4fb2f41e4ae9e2f7ea6020cd1c6611aef54bea9a48c183007677a690accb06ae
4
+ data.tar.gz: cfc7140a1df1464f8f95f76ea21f015e8c7586a5bd669d50df73462ed1c1a434
5
5
  SHA512:
6
- metadata.gz: 76c82db75d6c0157219f6700bebdf6b81d48e3a0954da7ebde4e31c051282e463935e4d3c377a37dc2424ffd909a5e7757c1e106256ec4bf8bce87da1e229a46
7
- data.tar.gz: 6af1841e036951b0f8a2f8ed37e4477d7f8d9ffda9b99a93b121de43e215a32567f36488256f2d6696ca183ffac142278e59e7842817724fecc7330c1e3c29fd
6
+ metadata.gz: 0274dd4547324aeb997b5b3fd2d4ebbfbb36c04709b5577ae37a6523584b472f479ec9a7773a4413caa97d0163f4c4b963fe1f36c70174b5ae140286f4d8f597
7
+ data.tar.gz: 4d933a38ef6fbbf26b4ed8977f3dbc61f9b05641d6debe0d47d3710c1ebeedcababc00a09d1161f813726a18135b2442bdc1f54328c50e51224fabbdf00a959b
@@ -1,4 +1,11 @@
1
- # 0.0.1 - 2020-06-17
1
+ # 0.0.3 - 2020-06-17
2
+
3
+ - Only set api endpoint if not using "github.com"
4
+ - Bump rake version
5
+ - Typos
6
+ - Fetch before checking out main
7
+
8
+ # 0.0.2 - 2020-06-17
2
9
 
3
10
  Fix checkout of local branch, add local master branch deletion
4
11
 
@@ -18,7 +18,7 @@ GEM
18
18
  faraday (>= 0.9)
19
19
  sawyer (~> 0.8.0, >= 0.5.3)
20
20
  public_suffix (4.0.5)
21
- rake (10.5.0)
21
+ rake (13.0.1)
22
22
  rspec (3.9.0)
23
23
  rspec-core (~> 3.9.0)
24
24
  rspec-expectations (~> 3.9.0)
@@ -43,5 +43,5 @@ PLATFORMS
43
43
  DEPENDENCIES
44
44
  bundler (~> 1.17)
45
45
  master_to_main!
46
- rake (~> 10.0)
46
+ rake (~> 13.0)
47
47
  rspec (~> 3.0)
@@ -36,8 +36,10 @@ module MasterToMain
36
36
 
37
37
  no_commands do
38
38
  def create_client
39
- Octokit.configure do |c|
40
- c.api_endpoint = @repo.api_endpoint
39
+ if @repo.github != "github.com"
40
+ Octokit.configure do |c|
41
+ c.api_endpoint = @repo.api_endpoint
42
+ end
41
43
  end
42
44
  token = ask("What is your GitHub Personal Access Token?")
43
45
 
@@ -55,7 +57,7 @@ module MasterToMain
55
57
  {
56
58
  github: "github." + github_suffix,
57
59
  user: user,
58
- repo: repo.chomp,
60
+ repo: repo.gsub(/\.git/, "").chomp,
59
61
  }
60
62
  else
61
63
  {
@@ -70,7 +72,7 @@ module MasterToMain
70
72
  github_info = get_github_info
71
73
  github_url = ask("What is your github url?", default: github_info[:github]).gsub(/https:\/\//, "")
72
74
  user = ask("What is your github user?", default: github_info[:user])
73
- github_repo = ask("What is your github repo?", default: github_info[:repo])
75
+ github_repo = ask("What is your github repo?", default: github_info[:repo]).gsub(/\.git/, "")
74
76
  old_branch = ask("What is your current primary branch?", default: "master")
75
77
  new_branch = ask("What is your desired primary branch?", default: "main")
76
78
 
@@ -123,7 +125,7 @@ module MasterToMain
123
125
  end
124
126
 
125
127
  def rebase_pull_requests
126
- if yes?("Would you like to rebase all requests based on #{@repo.old_branch} to #{@repo.new_branch}?")
128
+ if yes?("Would you like to rebase all pull requests based on #{@repo.old_branch} to #{@repo.new_branch}?")
127
129
  prs = @client.pull_requests(@repo.name)
128
130
  prs.each do |pr|
129
131
  if pr[:base][:ref] == @repo.old_branch
@@ -141,6 +143,7 @@ module MasterToMain
141
143
 
142
144
  def change_origin
143
145
  if yes?("Would you like to change origin to point to #{@repo.new_branch}?")
146
+ `git fetch`
144
147
  `git checkout #{@repo.new_branch}`
145
148
  `git push -u origin #{@repo.new_branch}`
146
149
  else
@@ -1,3 +1,3 @@
1
1
  module MasterToMain
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.require_paths = ["lib"]
37
37
 
38
38
  spec.add_development_dependency "bundler", "~> 1.17"
39
- spec.add_development_dependency "rake", "~> 10.0"
39
+ spec.add_development_dependency "rake", "~> 13.0"
40
40
  spec.add_development_dependency "rspec", "~> 3.0"
41
41
 
42
42
  spec.add_dependency "thor", "~> 1.0.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_to_main
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John DeWyze
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement