vpr 2.0.1 → 2.3.1

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: 5ed95c7f4431bf7413b0b3009ca6783be6d0d4b4c67dedeccf0656c32faa5b31
4
- data.tar.gz: 4211affce4e144a15898517e99d8462ffb69e3b22517629c045c611229f4ce5e
3
+ metadata.gz: b7cbb605e13043c2455046ab956e5ce594d4728bee3f7741ccd8bfbcd79b4237
4
+ data.tar.gz: e22d596c37d45f42ebf086254c002cdd28413919759f8c6f08dd96bc6e6b6351
5
5
  SHA512:
6
- metadata.gz: 6acefb0c142308f56d058d9a5927d9e7c44243a3b8c58105afe3f3b660ccf6100cfd67312dd13a9f06cae2c9a11c47a28c93fb4fb78e25ea2ac8f910274719bc
7
- data.tar.gz: e08fe20d7870122a41382ddb72bfc15ebb63c28db7abd9c8cf72824355a2d51e8b012a483b602ceb18ed1b0be3dc18b41165f584f6ac6ab7a8c2225250926088
6
+ metadata.gz: c3fcd95ba7d916fb23b98a90441e3f46756031e955894959b6686baf0dcd4e883bec081779c07f6d6c20f90a921c7b4b43314a042780ffe946f916ba86810176
7
+ data.tar.gz: 2244a11cd7666fc4be1cbc5318bbb1442e9dd9c00d09094ecd52f6bd8439327ac331ae03480691e01ef103743eeef1c46b95037053a97a2d603bacb2d885dca1
@@ -0,0 +1,32 @@
1
+ name: CI
2
+ on:
3
+ pull_request:
4
+ branches: [ master ]
5
+ push:
6
+ branches: [ master ]
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ ruby_version: [ '2.5', '2.6', '2.7' ]
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v2
16
+ - name: Setup ruby ${{ matrix.ruby_version }}
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby_version }}
20
+ - name: Setup cache key and directory for gems cache
21
+ uses: actions/cache@v1
22
+ with:
23
+ path: vendor/bundle
24
+ key: ${{ runner.os }}-gem-use-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/Gemfile.lock') }}
25
+ - name: Bundle install
26
+ run: |
27
+ gem install bundler
28
+ bundle config path vendor/bundle
29
+ bundle install --jobs 4 --retry 3
30
+ - name: Run tests
31
+ run: |
32
+ bundle exec rspec --format progress
@@ -1,7 +1,83 @@
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.1](https://github.com/JuanCrg90/vpr/tree/v2.3.1) (2020-10-28)
4
+
5
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.3.0...v2.3.1)
6
+
7
+ **Closed issues:**
8
+
9
+ - Add support vpr branch in gitlab [\#41](https://github.com/JuanCrg90/vpr/issues/41)
10
+ - Add support vpr pulls in gitlab [\#40](https://github.com/JuanCrg90/vpr/issues/40)
11
+ - Add support vpr pull in gitlab [\#39](https://github.com/JuanCrg90/vpr/issues/39)
12
+ - vpr pull fails on renamed repos [\#35](https://github.com/JuanCrg90/vpr/issues/35)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - Error message when there is no repository [\#47](https://github.com/JuanCrg90/vpr/pull/47) ([EduardoGHdez](https://github.com/EduardoGHdez))
17
+ - Update changelog [\#46](https://github.com/JuanCrg90/vpr/pull/46) ([JuanCrg90](https://github.com/JuanCrg90))
18
+
19
+ ## [v2.3.0](https://github.com/JuanCrg90/vpr/tree/v2.3.0) (2020-10-03)
20
+
21
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.2.1...v2.3.0)
22
+
23
+ **Merged pull requests:**
24
+
25
+ - Support gitlab service [\#45](https://github.com/JuanCrg90/vpr/pull/45) ([Snick555](https://github.com/Snick555))
26
+
27
+ ## [v2.2.1](https://github.com/JuanCrg90/vpr/tree/v2.2.1) (2020-10-02)
28
+
29
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.2.0...v2.2.1)
30
+
31
+ **Merged pull requests:**
32
+
33
+ - Upgrade Git Gem to version 1.7 [\#44](https://github.com/JuanCrg90/vpr/pull/44) ([JuanCrg90](https://github.com/JuanCrg90))
34
+ - Remove Circle CI [\#43](https://github.com/JuanCrg90/vpr/pull/43) ([JuanCrg90](https://github.com/JuanCrg90))
35
+ - Use Github actions for CI [\#42](https://github.com/JuanCrg90/vpr/pull/42) ([JuanCrg90](https://github.com/JuanCrg90))
36
+ - 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))
37
+
38
+ ## [v2.2.0](https://github.com/JuanCrg90/vpr/tree/v2.2.0) (2020-03-16)
39
+
40
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.1.0...v2.2.0)
41
+
42
+ **Merged pull requests:**
43
+
44
+ - Add support for number slash branches [\#37](https://github.com/JuanCrg90/vpr/pull/37) ([JuanCrg90](https://github.com/JuanCrg90))
45
+ - Update rake requirement from ~\> 10.0 to ~\> 13.0 [\#36](https://github.com/JuanCrg90/vpr/pull/36) ([dependabot[bot]](https://github.com/apps/dependabot))
46
+
47
+ ## [v2.1.0](https://github.com/JuanCrg90/vpr/tree/v2.1.0) (2019-12-16)
48
+
49
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.0.1...v2.1.0)
50
+
51
+ **Merged pull requests:**
52
+
53
+ - Separate each git service in its own class [\#33](https://github.com/JuanCrg90/vpr/pull/33) ([JuanCrg90](https://github.com/JuanCrg90))
54
+
55
+ ## [v2.0.1](https://github.com/JuanCrg90/vpr/tree/v2.0.1) (2019-12-04)
56
+
57
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v2.0.0...v2.0.1)
58
+
59
+ **Merged pull requests:**
60
+
61
+ - Fix vpr --version [\#32](https://github.com/JuanCrg90/vpr/pull/32) ([JuanCrg90](https://github.com/JuanCrg90))
62
+ - Add Version 2.0.0 changelog [\#29](https://github.com/JuanCrg90/vpr/pull/29) ([JuanCrg90](https://github.com/JuanCrg90))
63
+
64
+ ## [v2.0.0](https://github.com/JuanCrg90/vpr/tree/v2.0.0) (2019-11-09)
65
+
66
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v1.0.0...v2.0.0)
67
+
68
+ **Implemented enhancements:**
69
+
70
+ - Allow to use vpr even if you are not in the root directory [\#17](https://github.com/JuanCrg90/vpr/issues/17)
71
+
72
+ **Closed issues:**
73
+
74
+ - Add support vpr search in bitbucket [\#20](https://github.com/JuanCrg90/vpr/issues/20)
75
+ - Add support vpr pulls in bitbucket [\#19](https://github.com/JuanCrg90/vpr/issues/19)
76
+ - Add support vpr branch in bitbucket [\#18](https://github.com/JuanCrg90/vpr/issues/18)
77
+ - Add linter/formatter GitHub action [\#12](https://github.com/JuanCrg90/vpr/issues/12)
78
+ - Add vpr --version command [\#10](https://github.com/JuanCrg90/vpr/issues/10)
79
+ - Add support vpr pull in bitbucket [\#9](https://github.com/JuanCrg90/vpr/issues/9)
80
+ - Add support to select remote branch to visit [\#8](https://github.com/JuanCrg90/vpr/issues/8)
5
81
 
6
82
  **Merged pull requests:**
7
83
 
@@ -22,18 +98,20 @@
22
98
  - Add vpr --version command [\#11](https://github.com/JuanCrg90/vpr/pull/11) ([andrewmcodes](https://github.com/andrewmcodes))
23
99
  - Update circle ci config [\#7](https://github.com/JuanCrg90/vpr/pull/7) ([JuanCrg90](https://github.com/JuanCrg90))
24
100
  - Add basic circle ci configuration [\#6](https://github.com/JuanCrg90/vpr/pull/6) ([JuanCrg90](https://github.com/JuanCrg90))
25
- - Add support for bitbucket in visit method [\#5](https://github.com/JuanCrg90/vpr/pull/5) ([JuanCrg90](https://github.com/JuanCrg90))
26
101
 
27
102
  ## [v1.0.0](https://github.com/JuanCrg90/vpr/tree/v1.0.0) (2019-07-12)
103
+
28
104
  [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.2.0...v1.0.0)
29
105
 
30
106
  **Merged pull requests:**
31
107
 
108
+ - Add support for bitbucket in visit method [\#5](https://github.com/JuanCrg90/vpr/pull/5) ([JuanCrg90](https://github.com/JuanCrg90))
32
109
  - Bump version 1.0.0 [\#4](https://github.com/JuanCrg90/vpr/pull/4) ([JuanCrg90](https://github.com/JuanCrg90))
33
110
  - Add changelog [\#3](https://github.com/JuanCrg90/vpr/pull/3) ([JuanCrg90](https://github.com/JuanCrg90))
34
111
  - Add regular GitHub project actions [\#2](https://github.com/JuanCrg90/vpr/pull/2) ([JuanCrg90](https://github.com/JuanCrg90))
35
112
 
36
113
  ## [v0.2.0](https://github.com/JuanCrg90/vpr/tree/v0.2.0) (2019-07-10)
114
+
37
115
  [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.1.1...v0.2.0)
38
116
 
39
117
  **Merged pull requests:**
@@ -41,11 +119,9 @@
41
119
  - add Launchy dependency [\#1](https://github.com/JuanCrg90/vpr/pull/1) ([JuanCrg90](https://github.com/JuanCrg90))
42
120
 
43
121
  ## [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
122
 
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)
123
+ [Full Changelog](https://github.com/JuanCrg90/vpr/compare/v0.1.0...v0.1.1)
48
124
 
49
125
 
50
126
 
51
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
127
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -1,54 +1,58 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vpr (2.0.1)
5
- git (~> 1.5)
4
+ vpr (2.3.1)
5
+ git (~> 1.7)
6
6
  launchy (~> 2.4)
7
7
  thor (~> 0.20)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.2.3)
12
+ activesupport (6.0.3.4)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
+ zeitwerk (~> 2.2, >= 2.2.2)
17
18
  addressable (2.6.0)
18
19
  public_suffix (>= 2.0.2, < 4.0)
19
20
  ast (2.4.0)
20
- concurrent-ruby (1.1.5)
21
+ concurrent-ruby (1.1.7)
21
22
  diff-lcs (1.3)
22
- faraday (0.15.4)
23
+ faraday (1.0.1)
23
24
  multipart-post (>= 1.2, < 3)
24
- faraday-http-cache (2.0.0)
25
- faraday (~> 0.8)
26
- git (1.5.0)
27
- github_changelog_generator (1.14.3)
25
+ faraday-http-cache (2.2.0)
26
+ faraday (>= 0.8)
27
+ git (1.7.0)
28
+ rchardet (~> 1.8)
29
+ github_changelog_generator (1.15.2)
28
30
  activesupport
29
31
  faraday-http-cache
30
32
  multi_json
31
33
  octokit (~> 4.6)
32
- rainbow (>= 2.1)
34
+ rainbow (>= 2.2.1)
33
35
  rake (>= 10.0)
34
- retriable (~> 2.1)
35
- i18n (1.6.0)
36
+ retriable (~> 3.0)
37
+ i18n (1.8.5)
36
38
  concurrent-ruby (~> 1.0)
37
39
  jaro_winkler (1.5.3)
38
40
  launchy (2.4.3)
39
41
  addressable (~> 2.3)
40
- minitest (5.11.3)
41
- multi_json (1.13.1)
42
+ minitest (5.14.2)
43
+ multi_json (1.15.0)
42
44
  multipart-post (2.1.1)
43
- octokit (4.14.0)
45
+ octokit (4.18.0)
46
+ faraday (>= 0.9)
44
47
  sawyer (~> 0.8.0, >= 0.5.3)
45
48
  parallel (1.17.0)
46
49
  parser (2.6.5.0)
47
50
  ast (~> 2.4.0)
48
51
  public_suffix (3.1.1)
49
52
  rainbow (3.0.0)
50
- rake (10.5.0)
51
- retriable (2.1.0)
53
+ rake (13.0.1)
54
+ rchardet (1.8.0)
55
+ retriable (3.1.2)
52
56
  rspec (3.8.0)
53
57
  rspec-core (~> 3.8.0)
54
58
  rspec-expectations (~> 3.8.0)
@@ -82,21 +86,22 @@ GEM
82
86
  rubocop-performance (~> 1.4.0)
83
87
  thor (0.20.3)
84
88
  thread_safe (0.3.6)
85
- tzinfo (1.2.5)
89
+ tzinfo (1.2.7)
86
90
  thread_safe (~> 0.1)
87
91
  unicode-display_width (1.6.0)
92
+ zeitwerk (2.4.0)
88
93
 
89
94
  PLATFORMS
90
95
  ruby
91
96
 
92
97
  DEPENDENCIES
93
- bundler (~> 2.0)
94
- github_changelog_generator (~> 1.14)
95
- rake (~> 10.0)
98
+ bundler (~> 2.1)
99
+ github_changelog_generator (~> 1.15)
100
+ rake (~> 13.0)
96
101
  rspec (~> 3.0)
97
102
  rspec_junit_formatter (~> 0.4)
98
103
  standard
99
104
  vpr!
100
105
 
101
106
  BUNDLED WITH
102
- 2.0.2
107
+ 2.1.4
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ![StandardRB](https://github.com/JuanCrg90/vpr/workflows/StandardRB/badge.svg)
2
- [![CircleCI](https://circleci.com/gh/JuanCrg90/vpr.svg?style=svg)](https://circleci.com/gh/JuanCrg90/vpr)
2
+ ![CI](https://github.com/JuanCrg90/vpr/workflows/CI/badge.svg)
3
3
 
4
4
  # vpr
5
5
 
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.1"
15
15
  end
data/lib/vpr.rb CHANGED
@@ -5,4 +5,5 @@ module Vpr
5
5
  autoload :GitParser, "vpr/git_parser"
6
6
  autoload :Url, "vpr/url"
7
7
  autoload :CLI, "vpr/cli"
8
+ autoload :Services, "vpr/services"
8
9
  end
@@ -9,6 +9,7 @@ module Vpr
9
9
  def initialize(args = [], local_options = {}, config = {})
10
10
  super
11
11
  select_remote
12
+ @url = Url.new
12
13
  end
13
14
 
14
15
  map "--version" => :version
@@ -16,42 +17,42 @@ module Vpr
16
17
 
17
18
  desc "home", "visit the project page in github"
18
19
  def home
19
- Launchy.open(Url.home_url)
20
+ Launchy.open(url.home_url)
20
21
  end
21
22
 
22
23
  desc "pulls", "visit the project pull requests page in github"
23
24
  def pulls
24
- Launchy.open(Url.pulls_url)
25
+ Launchy.open(url.pulls_url)
25
26
  end
26
27
 
27
28
  desc "issues", "visit the project issues page in github"
28
29
  def issues
29
- Launchy.open(Url.issues_url)
30
+ Launchy.open(url.issues_url)
30
31
  end
31
32
 
32
33
  desc "branches", "visit the project branches page in github"
33
34
  def branches
34
- Launchy.open(Url.branches_url)
35
+ Launchy.open(url.branches_url)
35
36
  end
36
37
 
37
38
  desc "branch", "visit the current branch in github"
38
39
  def branch
39
- Launchy.open(Url.branch_url)
40
+ Launchy.open(url.branch_url)
40
41
  end
41
42
 
42
43
  desc "pull", "visit the pull request for the current branch (if exist) in github"
43
44
  def pull
44
- Launchy.open(Url.pull_url)
45
+ Launchy.open(url.pull_url)
45
46
  end
46
47
 
47
48
  desc "visit COMMIT", "visit the commit in github"
48
49
  def visit(commit)
49
- Launchy.open(Url.commit_url(commit))
50
+ Launchy.open(url.commit_url(commit))
50
51
  end
51
52
 
52
53
  desc "search COMMIT", "search the commit in github"
53
54
  def search(commit)
54
- Launchy.open(Url.search_url(commit))
55
+ Launchy.open(url.search_url(commit))
55
56
  end
56
57
 
57
58
  desc "version", "show the gem version"
@@ -64,5 +65,7 @@ module Vpr
64
65
  def select_remote
65
66
  Configuration.remote = options[:remote].to_sym
66
67
  end
68
+
69
+ attr_reader :url
67
70
  end
68
71
  end
@@ -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
@@ -0,0 +1,7 @@
1
+ module Vpr
2
+ module Services
3
+ autoload :GitHub, "vpr/services/github"
4
+ autoload :Bitbucket, "vpr/services/bitbucket"
5
+ autoload :GitLab, "vpr/services/gitlab"
6
+ end
7
+ end
@@ -0,0 +1,39 @@
1
+ require "vpr/git_parser"
2
+
3
+ module Vpr
4
+ module Services
5
+ class Bitbucket
6
+ def self.home_url
7
+ GitParser.repo_url
8
+ end
9
+
10
+ def self.pulls_url
11
+ "#{GitParser.repo_url}/pull-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}/branch/#{GitParser.current_branch}"
24
+ end
25
+
26
+ def self.pull_url
27
+ "#{GitParser.repo_url}/pull-requests/new?source=#{GitParser.current_branch}"
28
+ end
29
+
30
+ def self.commit_url(commit)
31
+ "#{GitParser.repo_url}/commits/#{commit}"
32
+ end
33
+
34
+ def self.search_url(commit)
35
+ "#{GitParser.repo_url}/commits/all?search=#{commit}"
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,44 @@
1
+ require "vpr/git_parser"
2
+
3
+ module Vpr
4
+ module Services
5
+ class GitHub
6
+ def self.home_url
7
+ GitParser.repo_url
8
+ end
9
+
10
+ def self.pulls_url
11
+ "#{GitParser.repo_url}/pulls"
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
27
+ base_url = "#{GitParser.repo_url}/pull"
28
+ current_branch = GitParser.current_branch
29
+
30
+ base_url.concat("/new") if current_branch.match?(/\d+\/.+/)
31
+
32
+ "#{base_url}/#{current_branch}"
33
+ end
34
+
35
+ def self.commit_url(commit)
36
+ "#{GitParser.repo_url}/commit/#{commit}"
37
+ end
38
+
39
+ def self.search_url(commit)
40
+ "#{GitParser.repo_url}/search?q=#{commit}"
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,39 @@
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
27
+ "#{GitParser.repo_url}/-/merge_requests/#{GitParser.current_branch}"
28
+ end
29
+
30
+ def self.commit_url(commit)
31
+ "#{GitParser.repo_url}/-/commit/#{commit}"
32
+ end
33
+
34
+ def self.search_url(commit)
35
+ "#{GitParser.host}/search?search=#{commit}"
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,60 +1,54 @@
1
1
  require "vpr/git_parser"
2
+ require "vpr/services"
2
3
 
3
4
  module Vpr
4
5
  class Url
5
- def self.home_url
6
- GitParser.repo_url
6
+ def initialize
7
+ @service = services[GitParser.host.to_sym]
7
8
  end
8
9
 
9
- def self.pulls_url
10
- path = {
11
- 'github.com': "pulls",
12
- 'bitbucket.org': "pull-requests",
13
- }
14
-
15
- "#{GitParser.repo_url}/#{path[GitParser.host.to_sym]}"
10
+ def home_url
11
+ service.home_url
16
12
  end
17
13
 
18
- def self.issues_url
19
- "#{GitParser.repo_url}/issues"
14
+ def pulls_url
15
+ service.pulls_url
20
16
  end
21
17
 
22
- def self.branches_url
23
- "#{GitParser.repo_url}/branches"
18
+ def issues_url
19
+ service.issues_url
24
20
  end
25
21
 
26
- def self.branch_url
27
- path = {
28
- 'github.com': "tree",
29
- 'bitbucket.org': "branch",
30
- }
31
- "#{GitParser.repo_url}/#{path[GitParser.host.to_sym]}/#{GitParser.current_branch}"
22
+ def branches_url
23
+ service.branches_url
32
24
  end
33
25
 
34
- def self.pull_url
35
- path = {
36
- 'github.com': "pull/#{GitParser.current_branch}",
37
- 'bitbucket.org': "pull-requests/new?source=#{GitParser.current_branch}",
38
- }
26
+ def branch_url
27
+ service.branch_url
28
+ end
39
29
 
40
- "#{GitParser.repo_url}/#{path[GitParser.host.to_sym]}"
30
+ def pull_url
31
+ service.pull_url
41
32
  end
42
33
 
43
- def self.commit_url(commit)
44
- path = {
45
- 'github.com': "commit",
46
- 'bitbucket.org': "commits",
47
- }
34
+ def commit_url(commit)
35
+ service.commit_url(commit)
36
+ end
48
37
 
49
- "#{GitParser.repo_url}/#{path[GitParser.host.to_sym]}/#{commit}"
38
+ def search_url(commit)
39
+ service.search_url(commit)
50
40
  end
51
41
 
52
- def self.search_url(commit)
53
- path = {
54
- 'github.com': "search?q=",
55
- 'bitbucket.org': "commits/all?search=",
42
+ private
43
+
44
+ def services
45
+ {
46
+ 'github.com': Vpr::Services::GitHub,
47
+ 'bitbucket.org': Vpr::Services::Bitbucket,
48
+ 'gitlab.com': Vpr::Services::GitLab,
56
49
  }
57
- "#{GitParser.repo_url}/#{path[GitParser.host.to_sym]}#{commit}"
58
50
  end
51
+
52
+ attr_reader :service
59
53
  end
60
54
  end
@@ -1,3 +1,3 @@
1
1
  module Vpr
2
- VERSION = "2.0.1"
2
+ VERSION = "2.3.1"
3
3
  end
@@ -23,14 +23,14 @@ 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.0"
27
- spec.add_development_dependency "github_changelog_generator", "~> 1.14"
28
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "bundler", "~> 2.1"
27
+ spec.add_development_dependency "github_changelog_generator", "~> 1.15"
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"
31
31
  spec.add_development_dependency "standard"
32
32
 
33
- spec.add_runtime_dependency "git", "~> 1.5"
33
+ spec.add_runtime_dependency "git", "~> 1.7"
34
34
  spec.add_runtime_dependency "launchy", "~> 2.4"
35
35
  spec.add_runtime_dependency "thor", "~> 0.20"
36
36
  end
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.0.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Carlos Ruiz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.1'
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.0'
26
+ version: '2.1'
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.15'
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.15'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.5'
103
+ version: '1.7'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.5'
110
+ version: '1.7'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: launchy
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - ".circleci/config.yml"
147
+ - ".github/workflows/ci.yml"
148
148
  - ".github/workflows/standardrb.yml"
149
149
  - ".gitignore"
150
150
  - ".rspec"
@@ -162,6 +162,10 @@ files:
162
162
  - lib/vpr/cli.rb
163
163
  - lib/vpr/configuration.rb
164
164
  - lib/vpr/git_parser.rb
165
+ - lib/vpr/services.rb
166
+ - lib/vpr/services/bitbucket.rb
167
+ - lib/vpr/services/github.rb
168
+ - lib/vpr/services/gitlab.rb
165
169
  - lib/vpr/url.rb
166
170
  - lib/vpr/version.rb
167
171
  - vpr.gemspec
@@ -184,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
188
  - !ruby/object:Gem::Version
185
189
  version: '0'
186
190
  requirements: []
187
- rubygems_version: 3.0.3
191
+ rubygems_version: 3.1.2
188
192
  signing_key:
189
193
  specification_version: 4
190
194
  summary: A CLI to visit quickly commits in github
@@ -1,54 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.6.4
11
-
12
- working_directory: ~/repo
13
-
14
- steps:
15
- - checkout
16
-
17
- # Download and cache dependencies
18
- - restore_cache:
19
- keys:
20
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
21
- # fallback to using the latest cache if no exact match is found
22
- - v1-dependencies-
23
-
24
- - run:
25
- name: install dependencies
26
- command: |
27
- gem install bundler
28
- bundle install --jobs=4 --retry=3 --path vendor/bundle
29
-
30
- - save_cache:
31
- paths:
32
- - ./vendor/bundle
33
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
34
-
35
- # run tests!
36
- - run:
37
- name: run tests
38
- command: |
39
- mkdir /tmp/test-results
40
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb")"
41
-
42
- bundle exec rspec \
43
- --format progress \
44
- --format RspecJunitFormatter \
45
- --out /tmp/test-results/rspec.xml \
46
- --format progress \
47
- $TEST_FILES
48
-
49
- # collect reports
50
- - store_test_results:
51
- path: /tmp/test-results
52
- - store_artifacts:
53
- path: /tmp/test-results
54
- destination: test-results