open-remote 0.2 → 0.2.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 +4 -4
- data/lib/or-browser.rb +16 -18
- data/lib/or-version.rb +1 -1
- data/man/open-remote.1 +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8fc6892217a28d051137b16b169ea777ed1bee2
|
4
|
+
data.tar.gz: aec5f08c4d28780a50b36fea06e85332335c83aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac8af8e1020ba7e3c621c41a8d90619c5c10b07995cf1902e4113b65dafc7a34f178fe70ac29b0637bc65f38aee7b32ae4cdbc62152d04b9ebee20ecf55e1445
|
7
|
+
data.tar.gz: 21b1c144948a1619f98bd90046b23e1b36aa4a7047d8fc7fd2aa2d2392abe0c6214f0f2722151b2caa4d15a25650eaaaf093de29ad1535200485b3d847de7769
|
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
|
|
@@ -70,6 +56,9 @@ class << OpenRemote::Browser
|
|
70
56
|
url.sub(/\.git$/, "")
|
71
57
|
|
72
58
|
elsif /^git/.match(url) # is ssh link, change to website
|
59
|
+
git_to_https hb, url
|
60
|
+
|
61
|
+
elsif /^ssh/.match(url) # is ssh link, change to website
|
73
62
|
ssh_to_https hb, url
|
74
63
|
|
75
64
|
else # unknown, return a generic link
|
@@ -77,9 +66,10 @@ class << OpenRemote::Browser
|
|
77
66
|
end
|
78
67
|
end
|
79
68
|
|
69
|
+
|
80
70
|
# url: git@host:user/repo.git
|
81
71
|
# out: https://host/user/repo
|
82
|
-
def
|
72
|
+
def git_to_https(base, url)
|
83
73
|
info = url.partition("@").last
|
84
74
|
host = info.partition(":").first
|
85
75
|
user_repo = info.partition(":").last
|
@@ -87,6 +77,14 @@ class << OpenRemote::Browser
|
|
87
77
|
"#{base}#{host}/#{user_repo}"
|
88
78
|
end
|
89
79
|
|
80
|
+
# url: ssh://git@host/user/repo.git
|
81
|
+
# out: https://host/user/repo
|
82
|
+
def ssh_to_https(base, url)
|
83
|
+
info = url.partition("@").last
|
84
|
+
info.sub!(/\.git$/, "")
|
85
|
+
base + info
|
86
|
+
end
|
87
|
+
|
90
88
|
# url: https://git.heroku.com/app.git
|
91
89
|
# out: https://dashboard.heroku.com/apps/<app>
|
92
90
|
def https_to_app(base, url)
|
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
|
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:
|
4
|
+
version: 0.2.1
|
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-22 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, a la 'git open'.
|
70
70
|
email: jeremywrnr@gmail.com
|
71
71
|
executables:
|
72
72
|
- open-remote
|
@@ -102,5 +102,5 @@ 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: []
|