vpr 2.2.1 → 2.3.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: f4392e553d246cbcdc5eae1a5f1489adf327b487ff6bbc9804cfbe2c84ee69bb
4
- data.tar.gz: a855bdaf9bc749e169b8c088d64de873749bf0ba6012f24f4a57965d5cdad303
3
+ metadata.gz: 2934f2f3b5f9177c458baf126b8d78ab6e40429c0f4bd1675d45a723cba5fee4
4
+ data.tar.gz: 23d5de4b78bb7328dcb778ee708b71ca183fa166164f36e18e23897921c0031e
5
5
  SHA512:
6
- metadata.gz: 553418872ac7f362acfafa88f54a5674c9bcade97e7e1315a7914cb4fb9322789e3aa48404fb0196b7506468cc4dddbf70cda558c9daabcf494df65667d72901
7
- data.tar.gz: 7ca2e72a8062ee6c3ba139c35c5f8538052e1301d1b3d1e7b1f1b5706922111f7186d541552ae754a12d7c2748343db7ff8e67c451bd2156acb4d851cabfec6e
6
+ metadata.gz: edd580a332a72c4e2af867b7188148ba3bf385f82b36745f11d98238ec288994aefb663d7589b072f8c0f1007d03e4101634733bc3aba8d08669f4539615e21a
7
+ data.tar.gz: 9fa8906b17e0b21f2b3f59bd4b15acfeb8857c96e5879f2ac5ece7f17813d024e224feef85bb52e75fd8abf6f0c68d36d82b2d6226c462c05aa869ac4ac6dac9
data/CHANGELOG.md CHANGED
@@ -1,7 +1,105 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- ## [2.0.0](https://github.com/JuanCrg90/vpr/tree/2.0.0) (2019-11-09)
4
- [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v1.0.0...2.0.0)
3
+ ## [v2.3.3](https://github.com/JuanCrg90/vpr/tree/v2.3.3) (2021-11-06)
4
+
5
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.3.2...v2.3.3)
6
+
7
+ **Closed issues:**
8
+
9
+ - Improve the Readme [\#34](https://github.com/JuanCrg90/vpr/issues/34)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Add support for repos with url name [\#51](https://github.com/JuanCrg90/vpr/pull/51) ([JuanCrg90](https://github.com/JuanCrg90))
14
+ - Bump addressable from 2.6.0 to 2.8.0 [\#50](https://github.com/JuanCrg90/vpr/pull/50) ([dependabot[bot]](https://github.com/apps/dependabot))
15
+
16
+ ## [v2.3.2](https://github.com/JuanCrg90/vpr/tree/v2.3.2) (2021-05-04)
17
+
18
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.3.1...v2.3.2)
19
+
20
+ **Merged pull requests:**
21
+
22
+ - Improve Readme [\#49](https://github.com/JuanCrg90/vpr/pull/49) ([JuanCrg90](https://github.com/JuanCrg90))
23
+ - Ability to specify branch in pull command [\#48](https://github.com/JuanCrg90/vpr/pull/48) ([EduardoGHdez](https://github.com/EduardoGHdez))
24
+
25
+ ## [v2.3.1](https://github.com/JuanCrg90/vpr/tree/v2.3.1) (2020-10-28)
26
+
27
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.3.0...v2.3.1)
28
+
29
+ **Closed issues:**
30
+
31
+ - Add support vpr branch in gitlab [\#41](https://github.com/JuanCrg90/vpr/issues/41)
32
+ - Add support vpr pulls in gitlab [\#40](https://github.com/JuanCrg90/vpr/issues/40)
33
+ - Add support vpr pull in gitlab [\#39](https://github.com/JuanCrg90/vpr/issues/39)
34
+ - vpr pull fails on renamed repos [\#35](https://github.com/JuanCrg90/vpr/issues/35)
35
+
36
+ **Merged pull requests:**
37
+
38
+ - Error message when there is no repository [\#47](https://github.com/JuanCrg90/vpr/pull/47) ([EduardoGHdez](https://github.com/EduardoGHdez))
39
+ - Update changelog [\#46](https://github.com/JuanCrg90/vpr/pull/46) ([JuanCrg90](https://github.com/JuanCrg90))
40
+
41
+ ## [v2.3.0](https://github.com/JuanCrg90/vpr/tree/v2.3.0) (2020-10-03)
42
+
43
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.2.1...v2.3.0)
44
+
45
+ **Merged pull requests:**
46
+
47
+ - Support gitlab service [\#45](https://github.com/JuanCrg90/vpr/pull/45) ([Snick555](https://github.com/Snick555))
48
+
49
+ ## [v2.2.1](https://github.com/JuanCrg90/vpr/tree/v2.2.1) (2020-10-02)
50
+
51
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.2.0...v2.2.1)
52
+
53
+ **Merged pull requests:**
54
+
55
+ - Upgrade Git Gem to version 1.7 [\#44](https://github.com/JuanCrg90/vpr/pull/44) ([JuanCrg90](https://github.com/JuanCrg90))
56
+ - Remove Circle CI [\#43](https://github.com/JuanCrg90/vpr/pull/43) ([JuanCrg90](https://github.com/JuanCrg90))
57
+ - Use Github actions for CI [\#42](https://github.com/JuanCrg90/vpr/pull/42) ([JuanCrg90](https://github.com/JuanCrg90))
58
+ - Bump activesupport from 5.2.3 to 6.0.3.1 [\#38](https://github.com/JuanCrg90/vpr/pull/38) ([dependabot[bot]](https://github.com/apps/dependabot))
59
+
60
+ ## [v2.2.0](https://github.com/JuanCrg90/vpr/tree/v2.2.0) (2020-03-16)
61
+
62
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.1.0...v2.2.0)
63
+
64
+ **Merged pull requests:**
65
+
66
+ - Add support for number slash branches [\#37](https://github.com/JuanCrg90/vpr/pull/37) ([JuanCrg90](https://github.com/JuanCrg90))
67
+ - Update rake requirement from ~\> 10.0 to ~\> 13.0 [\#36](https://github.com/JuanCrg90/vpr/pull/36) ([dependabot[bot]](https://github.com/apps/dependabot))
68
+
69
+ ## [v2.1.0](https://github.com/JuanCrg90/vpr/tree/v2.1.0) (2019-12-16)
70
+
71
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.0.1...v2.1.0)
72
+
73
+ **Merged pull requests:**
74
+
75
+ - Separate each git service in its own class [\#33](https://github.com/JuanCrg90/vpr/pull/33) ([JuanCrg90](https://github.com/JuanCrg90))
76
+
77
+ ## [v2.0.1](https://github.com/JuanCrg90/vpr/tree/v2.0.1) (2019-12-04)
78
+
79
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.0.0...v2.0.1)
80
+
81
+ **Merged pull requests:**
82
+
83
+ - Fix vpr --version [\#32](https://github.com/JuanCrg90/vpr/pull/32) ([JuanCrg90](https://github.com/JuanCrg90))
84
+ - Add Version 2.0.0 changelog [\#29](https://github.com/JuanCrg90/vpr/pull/29) ([JuanCrg90](https://github.com/JuanCrg90))
85
+
86
+ ## [v2.0.0](https://github.com/JuanCrg90/vpr/tree/v2.0.0) (2019-11-09)
87
+
88
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v1.0.0...v2.0.0)
89
+
90
+ **Implemented enhancements:**
91
+
92
+ - Allow to use vpr even if you are not in the root directory [\#17](https://github.com/JuanCrg90/vpr/issues/17)
93
+
94
+ **Closed issues:**
95
+
96
+ - Add support vpr search in bitbucket [\#20](https://github.com/JuanCrg90/vpr/issues/20)
97
+ - Add support vpr pulls in bitbucket [\#19](https://github.com/JuanCrg90/vpr/issues/19)
98
+ - Add support vpr branch in bitbucket [\#18](https://github.com/JuanCrg90/vpr/issues/18)
99
+ - Add linter/formatter GitHub action [\#12](https://github.com/JuanCrg90/vpr/issues/12)
100
+ - Add vpr --version command [\#10](https://github.com/JuanCrg90/vpr/issues/10)
101
+ - Add support vpr pull in bitbucket [\#9](https://github.com/JuanCrg90/vpr/issues/9)
102
+ - Add support to select remote branch to visit [\#8](https://github.com/JuanCrg90/vpr/issues/8)
5
103
 
6
104
  **Merged pull requests:**
7
105
 
@@ -25,6 +123,7 @@
25
123
  - Add support for bitbucket in visit method [\#5](https://github.com/JuanCrg90/vpr/pull/5) ([JuanCrg90](https://github.com/JuanCrg90))
26
124
 
27
125
  ## [v1.0.0](https://github.com/JuanCrg90/vpr/tree/v1.0.0) (2019-07-12)
126
+
28
127
  [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.2.0...v1.0.0)
29
128
 
30
129
  **Merged pull requests:**
@@ -34,6 +133,7 @@
34
133
  - Add regular GitHub project actions [\#2](https://github.com/JuanCrg90/vpr/pull/2) ([JuanCrg90](https://github.com/JuanCrg90))
35
134
 
36
135
  ## [v0.2.0](https://github.com/JuanCrg90/vpr/tree/v0.2.0) (2019-07-10)
136
+
37
137
  [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.1.1...v0.2.0)
38
138
 
39
139
  **Merged pull requests:**
@@ -41,11 +141,9 @@
41
141
  - add Launchy dependency [\#1](https://github.com/JuanCrg90/vpr/pull/1) ([JuanCrg90](https://github.com/JuanCrg90))
42
142
 
43
143
  ## [v0.1.1](https://github.com/JuanCrg90/vpr/tree/v0.1.1) (2019-07-05)
44
- [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.1.0...v0.1.1)
45
144
 
46
- ## [v0.1.0](https://github.com/JuanCrg90/vpr/tree/v0.1.0) (2019-07-05)
47
- [Full Changelog](https://github.com/JuanCrg90/vpr/compare/0.1.0...v0.1.0)
145
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.1.0...v0.1.1)
48
146
 
49
147
 
50
148
 
51
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
149
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vpr (2.2.1)
4
+ vpr (2.3.3)
5
5
  git (~> 1.7)
6
6
  launchy (~> 2.4)
7
7
  thor (~> 0.20)
@@ -9,49 +9,96 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.0.3.1)
12
+ activesupport (6.1.4.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 0.7, < 2)
15
- minitest (~> 5.1)
16
- tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2, >= 2.2.2)
18
- addressable (2.6.0)
19
- public_suffix (>= 2.0.2, < 4.0)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ zeitwerk (~> 2.3)
18
+ addressable (2.8.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
20
20
  ast (2.4.0)
21
- concurrent-ruby (1.1.6)
21
+ async (1.30.1)
22
+ console (~> 1.10)
23
+ nio4r (~> 2.3)
24
+ timers (~> 4.1)
25
+ async-http (0.56.5)
26
+ async (>= 1.25)
27
+ async-io (>= 1.28)
28
+ async-pool (>= 0.2)
29
+ protocol-http (~> 0.22.0)
30
+ protocol-http1 (~> 0.14.0)
31
+ protocol-http2 (~> 0.14.0)
32
+ async-http-faraday (0.11.0)
33
+ async-http (~> 0.42)
34
+ faraday
35
+ async-io (1.32.2)
36
+ async
37
+ async-pool (0.3.9)
38
+ async (>= 1.25)
39
+ concurrent-ruby (1.1.9)
40
+ console (1.13.1)
41
+ fiber-local
22
42
  diff-lcs (1.3)
23
- faraday (0.15.4)
43
+ faraday (1.8.0)
44
+ faraday-em_http (~> 1.0)
45
+ faraday-em_synchrony (~> 1.0)
46
+ faraday-excon (~> 1.1)
47
+ faraday-httpclient (~> 1.0.1)
48
+ faraday-net_http (~> 1.0)
49
+ faraday-net_http_persistent (~> 1.1)
50
+ faraday-patron (~> 1.0)
51
+ faraday-rack (~> 1.0)
24
52
  multipart-post (>= 1.2, < 3)
25
- faraday-http-cache (2.0.0)
26
- faraday (~> 0.8)
27
- git (1.7.0)
53
+ ruby2_keywords (>= 0.0.4)
54
+ faraday-em_http (1.0.0)
55
+ faraday-em_synchrony (1.0.0)
56
+ faraday-excon (1.1.0)
57
+ faraday-http-cache (2.2.0)
58
+ faraday (>= 0.8)
59
+ faraday-httpclient (1.0.1)
60
+ faraday-net_http (1.0.1)
61
+ faraday-net_http_persistent (1.2.0)
62
+ faraday-patron (1.0.0)
63
+ faraday-rack (1.0.0)
64
+ fiber-local (1.0.0)
65
+ git (1.9.1)
28
66
  rchardet (~> 1.8)
29
- github_changelog_generator (1.14.3)
67
+ github_changelog_generator (1.16.4)
30
68
  activesupport
69
+ async (>= 1.25.0)
70
+ async-http-faraday
31
71
  faraday-http-cache
32
72
  multi_json
33
73
  octokit (~> 4.6)
34
- rainbow (>= 2.1)
74
+ rainbow (>= 2.2.1)
35
75
  rake (>= 10.0)
36
- retriable (~> 2.1)
37
- i18n (1.8.2)
76
+ i18n (1.8.11)
38
77
  concurrent-ruby (~> 1.0)
39
78
  jaro_winkler (1.5.3)
40
- launchy (2.4.3)
41
- addressable (~> 2.3)
42
- minitest (5.14.1)
43
- multi_json (1.13.1)
79
+ launchy (2.5.0)
80
+ addressable (~> 2.7)
81
+ minitest (5.14.4)
82
+ multi_json (1.15.0)
44
83
  multipart-post (2.1.1)
45
- octokit (4.14.0)
84
+ nio4r (2.5.8)
85
+ octokit (4.21.0)
86
+ faraday (>= 0.9)
46
87
  sawyer (~> 0.8.0, >= 0.5.3)
47
88
  parallel (1.17.0)
48
89
  parser (2.6.5.0)
49
90
  ast (~> 2.4.0)
50
- public_suffix (3.1.1)
91
+ protocol-hpack (1.4.2)
92
+ protocol-http (0.22.5)
93
+ protocol-http1 (0.14.2)
94
+ protocol-http (~> 0.22)
95
+ protocol-http2 (0.14.2)
96
+ protocol-hpack (~> 1.4)
97
+ protocol-http (~> 0.18)
98
+ public_suffix (4.0.6)
51
99
  rainbow (3.0.0)
52
100
  rake (13.0.1)
53
101
  rchardet (1.8.0)
54
- retriable (2.1.0)
55
102
  rspec (3.8.0)
56
103
  rspec-core (~> 3.8.0)
57
104
  rspec-expectations (~> 3.8.0)
@@ -77,6 +124,7 @@ GEM
77
124
  rubocop-performance (1.4.1)
78
125
  rubocop (>= 0.71.0)
79
126
  ruby-progressbar (1.10.1)
127
+ ruby2_keywords (0.0.5)
80
128
  sawyer (0.8.2)
81
129
  addressable (>= 2.3.5)
82
130
  faraday (> 0.8, < 2.0)
@@ -84,18 +132,18 @@ GEM
84
132
  rubocop (~> 0.72.0)
85
133
  rubocop-performance (~> 1.4.0)
86
134
  thor (0.20.3)
87
- thread_safe (0.3.6)
88
- tzinfo (1.2.7)
89
- thread_safe (~> 0.1)
135
+ timers (4.3.3)
136
+ tzinfo (2.0.4)
137
+ concurrent-ruby (~> 1.0)
90
138
  unicode-display_width (1.6.0)
91
- zeitwerk (2.3.0)
139
+ zeitwerk (2.5.1)
92
140
 
93
141
  PLATFORMS
94
142
  ruby
95
143
 
96
144
  DEPENDENCIES
97
- bundler (~> 2.1)
98
- github_changelog_generator (~> 1.14)
145
+ bundler (~> 2.2.30)
146
+ github_changelog_generator (~> 1.16)
99
147
  rake (~> 13.0)
100
148
  rspec (~> 3.0)
101
149
  rspec_junit_formatter (~> 0.4)
@@ -103,4 +151,4 @@ DEPENDENCIES
103
151
  vpr!
104
152
 
105
153
  BUNDLED WITH
106
- 2.1.4
154
+ 2.2.30
data/README.md CHANGED
@@ -1,55 +1,57 @@
1
+ # vpr
2
+
1
3
  ![StandardRB](https://github.com/JuanCrg90/vpr/workflows/StandardRB/badge.svg)
2
4
  ![CI](https://github.com/JuanCrg90/vpr/workflows/CI/badge.svg)
3
5
 
4
- # vpr
5
6
 
6
- A CLI to visit quickly github project sections
7
+ VPR is a CLI that helps you to quickly manage your project in GitHub/GitLab/Bitbucket.
8
+ You can visit with ease different project sections, like the issues page, a specific commit,
9
+ create pull requests (merge requests for GitLab),
10
+ and more, also is configurable for other platforms PRs are open.
11
+
12
+ ![vpr pull](https://res.cloudinary.com/juancrg90/image/upload/v1562970242/vpr/vpr_pull.gif)
7
13
 
8
14
  ## Installation
9
- ```
15
+
16
+ ```bash
10
17
  $ gem install vpr
11
18
  ```
19
+
12
20
  ## Usage
13
21
 
14
- ```
15
- $ vpr home # visit the project page in github
16
- ```
17
- ![vpr home](https://res.cloudinary.com/juancrg90/image/upload/v1562969660/vpr/vpr_home.gif)
22
+ All the commands use the URL set as `origin` in your git remote to perform the web request,
23
+ you can use the flag `--remote=REMOTE` to specify which service you want to visit if you have your project stored in more than one platform.
18
24
 
19
- ```
20
- $ vpr pulls # visit the project pull requests page in github
21
- ```
22
- ![vpr pulls](https://res.cloudinary.com/juancrg90/image/upload/v1562969866/vpr/vpr_pulls.gif)
25
+ ### `vpr branch`
26
+ Open in your browser your current branch.
23
27
 
24
- ```
25
- $ vpr issues # visit the project issues page in github
26
- ```
27
- ![vpr issues](https://res.cloudinary.com/juancrg90/image/upload/v1562969959/vpr/vpr_issues.gif)
28
+ ### `vpr branches`
29
+ Open the page that shows the uploaded branch list.
28
30
 
29
- ```
30
- $ vpr branches # visit the project branches page in github
31
- ```
32
- ![vpr branches](https://res.cloudinary.com/juancrg90/image/upload/v1562970055/vpr/vpr_branches.gif)
31
+ ### `vpr help`
32
+ Show the likst of available `vpr` commands, you can pass an specific command to get more details.
33
33
 
34
- ```
35
- $ vpr branch # 'visit the current branch in github'
36
- ```
37
- ![vpr branch](https://res.cloudinary.com/juancrg90/image/upload/v1562970153/vpr/vpr_branch.gif)
34
+ ### `vpr home`
35
+ Open in your browser the project page.
38
36
 
39
- ```
40
- $ vpr pull # 'visit the pull request for the current branch (if exist) in github'
41
- ```
42
- ![vpr pull](https://res.cloudinary.com/juancrg90/image/upload/v1562970242/vpr/vpr_pull.gif)
37
+ ### `vpr issues`
38
+ Open the in your browser issues list page.
43
39
 
44
- ```
45
- $ vpr visit <commit> # visit the commit in github
46
- ```
47
- ![vpr visit](https://res.cloudinary.com/juancrg90/image/upload/v1562970485/vpr/vpr_visit.gif)
40
+ ### `vpr pull`
41
+ Create a new pull request or visit an existing one for the current branch.
48
42
 
49
- ```
50
- $ vpr search <commit> # search the commit in github
51
- ```
52
- ![vpr search](https://res.cloudinary.com/juancrg90/image/upload/v1562970606/vpr/vpr_search.gif)
43
+ ### `vpr pulls`
44
+ Open the pull requests list page.
45
+
46
+ ### `vpr search COMMIT`
47
+ Search a given commit in the project page. the behavior of this command depends of the plaftorm, for example
48
+ GitHub search in code, issues an PRs.
49
+
50
+ ### `vpr visit COMMIT`
51
+ Open in the browser the page with the commit passed as an argument.
52
+
53
+ ### `vpr version`
54
+ Show the current `vpr` version
53
55
 
54
56
  ## Development
55
57
 
data/Rakefile CHANGED
@@ -10,6 +10,6 @@ task default: [:standard, :spec]
10
10
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
11
11
  config.user = "JuanCrg90"
12
12
  config.project = "vpr"
13
- config.since_tag = "0.1.0"
14
- config.future_release = "2.0.0"
13
+ config.since_tag = "v0.1.0"
14
+ config.future_release = "v2.3.3"
15
15
  end
data/lib/vpr/cli.rb CHANGED
@@ -40,9 +40,15 @@ module Vpr
40
40
  Launchy.open(url.branch_url)
41
41
  end
42
42
 
43
- desc "pull", "visit the pull request for the current branch (if exist) in github"
44
- def pull
45
- Launchy.open(url.pull_url)
43
+ desc "pull [BRANCH]", "visit the pull request for the BRANCH in any of the supported hosts"
44
+ long_desc <<-DESC
45
+ It visits the pull request for the BRANCH in any of the supported hosts
46
+
47
+ Since the branch is an optional arg, it uses the current branch by default
48
+ DESC
49
+
50
+ def pull(branch = nil)
51
+ Launchy.open(url.pull_url(branch))
46
52
  end
47
53
 
48
54
  desc "visit COMMIT", "visit the commit in github"
@@ -10,7 +10,7 @@ module Vpr
10
10
  [/:]
11
11
  (?<owner>[^/]+)
12
12
  /
13
- (?<repo>[^/.]+)
13
+ (?<repo>[^\/]+[^(.git)])
14
14
  }x.freeze
15
15
 
16
16
  class << self
@@ -47,7 +47,9 @@ module Vpr
47
47
  return dir if File.directory?(File.join(dir, ".git"))
48
48
 
49
49
  parent = File.dirname(dir)
50
- return dir if parent == dir # we're at the root
50
+
51
+ # NOTE: Raising an error because at this point it is at the root dir
52
+ raise Thor::Error.new("There is no repository in current directory") if parent == dir
51
53
 
52
54
  dir = parent
53
55
  end
@@ -23,8 +23,9 @@ module Vpr
23
23
  "#{GitParser.repo_url}/branch/#{GitParser.current_branch}"
24
24
  end
25
25
 
26
- def self.pull_url
27
- "#{GitParser.repo_url}/pull-requests/new?source=#{GitParser.current_branch}"
26
+ def self.pull_url(branch = nil)
27
+ branch ||= GitParser.current_branch
28
+ "#{GitParser.repo_url}/pull-requests/new?source=#{branch}"
28
29
  end
29
30
 
30
31
  def self.commit_url(commit)
@@ -23,13 +23,13 @@ module Vpr
23
23
  "#{GitParser.repo_url}/tree/#{GitParser.current_branch}"
24
24
  end
25
25
 
26
- def self.pull_url
26
+ def self.pull_url(branch = nil)
27
+ branch ||= GitParser.current_branch
27
28
  base_url = "#{GitParser.repo_url}/pull"
28
- current_branch = GitParser.current_branch
29
29
 
30
- base_url.concat("/new") if current_branch.match?(/\d+\/.+/)
30
+ base_url.concat("/new") if branch.match?(/\d+\/.+/)
31
31
 
32
- "#{base_url}/#{current_branch}"
32
+ "#{base_url}/#{branch}"
33
33
  end
34
34
 
35
35
  def self.commit_url(commit)
@@ -0,0 +1,40 @@
1
+ require "vpr/git_parser"
2
+
3
+ module Vpr
4
+ module Services
5
+ class GitLab
6
+ def self.home_url
7
+ GitParser.repo_url
8
+ end
9
+
10
+ def self.pulls_url
11
+ "#{GitParser.repo_url}/-/merge_requests"
12
+ end
13
+
14
+ def self.issues_url
15
+ "#{GitParser.repo_url}/-/issues"
16
+ end
17
+
18
+ def self.branches_url
19
+ "#{GitParser.repo_url}/-/branches"
20
+ end
21
+
22
+ def self.branch_url
23
+ "#{GitParser.repo_url}/-/tree/#{GitParser.current_branch}"
24
+ end
25
+
26
+ def self.pull_url(branch = nil)
27
+ branch ||= GitParser.current_branch
28
+ "#{GitParser.repo_url}/-/merge_requests/#{branch}"
29
+ end
30
+
31
+ def self.commit_url(commit)
32
+ "#{GitParser.repo_url}/-/commit/#{commit}"
33
+ end
34
+
35
+ def self.search_url(commit)
36
+ "#{GitParser.host}/search?search=#{commit}"
37
+ end
38
+ end
39
+ end
40
+ end
data/lib/vpr/services.rb CHANGED
@@ -2,5 +2,6 @@ module Vpr
2
2
  module Services
3
3
  autoload :GitHub, "vpr/services/github"
4
4
  autoload :Bitbucket, "vpr/services/bitbucket"
5
+ autoload :GitLab, "vpr/services/gitlab"
5
6
  end
6
7
  end
data/lib/vpr/url.rb CHANGED
@@ -27,8 +27,8 @@ module Vpr
27
27
  service.branch_url
28
28
  end
29
29
 
30
- def pull_url
31
- service.pull_url
30
+ def pull_url(branch = nil)
31
+ service.pull_url(branch)
32
32
  end
33
33
 
34
34
  def commit_url(commit)
@@ -45,6 +45,7 @@ module Vpr
45
45
  {
46
46
  'github.com': Vpr::Services::GitHub,
47
47
  'bitbucket.org': Vpr::Services::Bitbucket,
48
+ 'gitlab.com': Vpr::Services::GitLab,
48
49
  }
49
50
  end
50
51
 
data/lib/vpr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vpr
2
- VERSION = "2.2.1"
2
+ VERSION = "2.3.3"
3
3
  end
data/vpr.gemspec CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler", "~> 2.1"
27
- spec.add_development_dependency "github_changelog_generator", "~> 1.14"
26
+ spec.add_development_dependency "bundler", "~> 2.2.30"
27
+ spec.add_development_dependency "github_changelog_generator", "~> 1.16"
28
28
  spec.add_development_dependency "rake", "~> 13.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
30
30
  spec.add_development_dependency "rspec_junit_formatter", "~> 0.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpr
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Carlos Ruiz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2021-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.1'
19
+ version: 2.2.30
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.1'
26
+ version: 2.2.30
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: github_changelog_generator
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.14'
33
+ version: '1.16'
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: '1.14'
40
+ version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -165,6 +165,7 @@ files:
165
165
  - lib/vpr/services.rb
166
166
  - lib/vpr/services/bitbucket.rb
167
167
  - lib/vpr/services/github.rb
168
+ - lib/vpr/services/gitlab.rb
168
169
  - lib/vpr/url.rb
169
170
  - lib/vpr/version.rb
170
171
  - vpr.gemspec
@@ -172,7 +173,7 @@ homepage: https://github.com/JuanCrg90/vpr
172
173
  licenses:
173
174
  - MIT
174
175
  metadata: {}
175
- post_install_message:
176
+ post_install_message:
176
177
  rdoc_options: []
177
178
  require_paths:
178
179
  - lib
@@ -187,8 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
188
  - !ruby/object:Gem::Version
188
189
  version: '0'
189
190
  requirements: []
190
- rubygems_version: 3.0.3
191
- signing_key:
191
+ rubygems_version: 3.2.30
192
+ signing_key:
192
193
  specification_version: 4
193
194
  summary: A CLI to visit quickly commits in github
194
195
  test_files: []