open-remote 0.2 → 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 +4 -4
- data/lib/open-remote.rb +1 -1
- data/lib/or-browser.rb +27 -24
- data/lib/or-version.rb +1 -1
- data/man/open-remote.1 +1 -1
- data/readme.md +2 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b5b4d43a783ba2b60fccc14f04b666697f85516
|
4
|
+
data.tar.gz: fd08db390459979ff1d6e75d2955b6317a9b81ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4920c5242078683ce8a4410921ccfe08cbf2297e504a4bec8b2a51f587997c11f696287754b781328a465135bd458e9919447d7e355daecd80e9d7d5002376a0
|
7
|
+
data.tar.gz: 53b03f150e129304ecf8a156c5df1285e400f31df829b8920f9ff2e3113b64b2b09d4e05b601043b103d69fb4016886968ccab317be3ce576a0bd79942388b1a
|
data/lib/open-remote.rb
CHANGED
@@ -35,7 +35,7 @@ class OpenRemote
|
|
35
35
|
remote = remotes.find { |remote| remote.match search }
|
36
36
|
|
37
37
|
if remote.nil?
|
38
|
-
puts "No remotes found that match #{search.to_s}. All remotes:\n"
|
38
|
+
puts "No remotes found that match #{search.to_s.red}. All remotes:\n" +
|
39
39
|
remotes.join("\n")
|
40
40
|
exit 1
|
41
41
|
else
|
data/lib/or-browser.rb
CHANGED
@@ -2,28 +2,14 @@
|
|
2
2
|
#
|
3
3
|
module OpenRemote::OS
|
4
4
|
def os_name
|
5
|
-
if
|
5
|
+
if (/darwin/ =~ RUBY_PLATFORM) != nil
|
6
6
|
"mac"
|
7
|
-
elsif
|
7
|
+
elsif (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
8
8
|
"dos"
|
9
|
-
elsif nix?
|
10
|
-
"nix"
|
11
9
|
else
|
12
|
-
|
10
|
+
"nix"
|
13
11
|
end
|
14
12
|
end
|
15
|
-
|
16
|
-
def mac?
|
17
|
-
(/darwin/ =~ RUBY_PLATFORM) != nil
|
18
|
-
end
|
19
|
-
|
20
|
-
def dos?
|
21
|
-
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
22
|
-
end
|
23
|
-
|
24
|
-
def nix?
|
25
|
-
not (dos? || mac?)
|
26
|
-
end
|
27
13
|
end
|
28
14
|
|
29
15
|
|
@@ -69,7 +55,13 @@ class << OpenRemote::Browser
|
|
69
55
|
elsif /^https/.match(url) # is website, return w/o .git ending
|
70
56
|
url.sub(/\.git$/, "")
|
71
57
|
|
72
|
-
elsif /^git
|
58
|
+
elsif /^git@/.match(url) # git remote w/ @
|
59
|
+
git_at_to_https hb, url
|
60
|
+
|
61
|
+
elsif /^git:/.match(url) # git remote w/ :
|
62
|
+
git_colon_to_https hb, url
|
63
|
+
|
64
|
+
elsif /^ssh/.match(url) # is ssh link, change to website
|
73
65
|
ssh_to_https hb, url
|
74
66
|
|
75
67
|
else # unknown, return a generic link
|
@@ -77,9 +69,10 @@ class << OpenRemote::Browser
|
|
77
69
|
end
|
78
70
|
end
|
79
71
|
|
80
|
-
|
81
|
-
#
|
82
|
-
|
72
|
+
|
73
|
+
# Helper transformations
|
74
|
+
#
|
75
|
+
def git_at_to_https(base, url)
|
83
76
|
info = url.partition("@").last
|
84
77
|
host = info.partition(":").first
|
85
78
|
user_repo = info.partition(":").last
|
@@ -87,12 +80,22 @@ class << OpenRemote::Browser
|
|
87
80
|
"#{base}#{host}/#{user_repo}"
|
88
81
|
end
|
89
82
|
|
90
|
-
|
91
|
-
|
83
|
+
def git_colon_to_https(base, url)
|
84
|
+
info = url.partition("://").last
|
85
|
+
info.sub!(/\.git$/, "")
|
86
|
+
base << info
|
87
|
+
end
|
88
|
+
|
89
|
+
def ssh_to_https(base, url)
|
90
|
+
info = url.partition("@").last
|
91
|
+
info.sub!(/\.git$/, "")
|
92
|
+
base << info
|
93
|
+
end
|
94
|
+
|
92
95
|
def https_to_app(base, url)
|
93
96
|
app = url.partition(".com/").last
|
94
97
|
app.sub!(/\.git$/, "")
|
95
|
-
base
|
98
|
+
base << app
|
96
99
|
end
|
97
100
|
end
|
98
101
|
|
data/lib/or-version.rb
CHANGED
data/man/open-remote.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "
|
4
|
+
.TH "README20160122\-77355\-5W7R7V" "" "January 2016" "" ""
|
5
5
|
\fIhttps://badge\.fury\.io/rb/open\-remote\fR \fIhttps://travis\-ci\.org/jeremywrnr/open\-remote\fR \fIhttp://jeremywrnr\.com/mit\-license\fR
|
6
6
|
.
|
7
7
|
.P
|
data/readme.md
CHANGED
@@ -14,6 +14,8 @@ tested and works well for:
|
|
14
14
|
- github
|
15
15
|
- bitbucket
|
16
16
|
- heroku
|
17
|
+
- TODO: gems (from checking gemspec)
|
18
|
+
- TODO: travis (from checking .travis.yml)
|
17
19
|
|
18
20
|
if there are other git hosting websites that you would like to use this with,
|
19
21
|
either let me know or make a pull request with the augmentation for that host.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Warner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: open a git repo's web remote from your terminal.
|
69
|
+
description: open a git repo's web remote from your terminal, with 'git open'.
|
70
70
|
email: jeremywrnr@gmail.com
|
71
71
|
executables:
|
72
72
|
- open-remote
|
@@ -102,5 +102,6 @@ rubyforge_project:
|
|
102
102
|
rubygems_version: 2.5.1
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
|
-
summary: open a git repo's remote from your terminal.
|
105
|
+
summary: open a git repo's remote from your terminal (git open).
|
106
106
|
test_files: []
|
107
|
+
has_rdoc:
|