uri-ssh_git 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf15234171b7d56ec1ad9aa16c3f84b8105f3835
4
- data.tar.gz: 4136f25e2bbdb61a3425c8a02683985e3ab97df1
3
+ metadata.gz: 9facd61c5f6b68e85e35b2dd61020b9af938a50c
4
+ data.tar.gz: cca70a7dd3fc346010500a4dd6c1c9750805bce6
5
5
  SHA512:
6
- metadata.gz: b01aa99f01f4ab2fec262e28f4cf5aba37134e698a7b59d8fb09fbe77ab9acf763c26fcfc364e5a3994f05911b93b20e4d7511b64ca3e9764ad436d842bef4db
7
- data.tar.gz: 12d17d7a7c69c4664a66f0e8c73e265cf0eac6955c1466764363aed88370ce3314ece084d2b040d281562eaca2841d6bfb428b6abb594029052b5938c3472016
6
+ metadata.gz: 0dbf5ad7bcd4fb6873b41907b5f2ef1355351369261fa65c9b81309b783583938ffab83c0d7c62dd3c0ff72ce7b58d1c7707f1bdc73951aa921dccd9322cfc3b
7
+ data.tar.gz: f887deb4d55c63bb00495b712b3aa8ff8ddd628e282e63373ae5e2ddc64d4df08ffcc21b0e833c60ea46c184c89d0258e474f94713bde90487c60076c6f33cf2
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in uri-ssh_git.gemspec
4
4
  gemspec
5
+ gem 'byebug' if RUBY_VERSION >= '2.0.0'
6
+ gem 'pry'
data/README.md CHANGED
@@ -27,25 +27,25 @@ URI::SshGit.build(
27
27
  path: '/packsaddle/ruby-uri-ssh_git.git'
28
28
  ).to_s
29
29
  #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
30
+ ```
31
+
32
+ ## VS.
30
33
 
31
- # Utility method
32
- ssh_protocol = 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
33
- git_protocol = 'git://github.com/packsaddle/ruby-uri-ssh_git.git'
34
-
35
- ::URI::SshGit.ssh_protocol?(ssh_protocol) #=> true
36
- ::URI::SshGit.git_protocol?(ssh_protocol) #=> false
37
- ::URI::SshGit.ssh_protocol?(git_protocol) #=> false
38
- ::URI::SshGit.git_protocol?(git_protocol) #=> true
39
-
40
- # Usage
41
- git_clone_url = '...'
42
- if ::URI::SshGit.ssh_protocol?(git_clone_url)
43
- parsed = URI::SshGit.parse(git_clone_url)
44
- else
45
- parsed = URI.passe(git_clone_url)
46
- end
47
- parsed.host
48
- parsed.path
34
+ ```ruby
35
+ # URI
36
+ url = URI.parse('git@github.com:schacon/ticgit.git')
37
+ URI::InvalidURIError: bad URI(is not URI?): git@github.com:schacon/ticgit.git
38
+
39
+ # Addressable
40
+ url = Addressable::URI.parse('git@github.com:schacon/ticgit.git')
41
+ #=> #<Addressable::URI:0x3fedf48fb430 URI:git@github.com:schacon/ticgit.git>
42
+ url.path #=> "schacon/ticgit.git"
43
+ url.scheme #=> "git@github.com"
44
+
45
+ url.host #=> nil
46
+ url.userinfo #=> nil
47
+ url.user #=> nil
48
+ url.port #=> nil
49
49
  ```
50
50
 
51
51
  ## Installation
@@ -23,22 +23,3 @@ URI::SshGit.build(
23
23
  path: '/packsaddle/ruby-uri-ssh_git.git'
24
24
  ).to_s
25
25
  #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
26
-
27
- # Utility method
28
- ssh_protocol = 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
29
- git_protocol = 'git://github.com/packsaddle/ruby-uri-ssh_git.git'
30
-
31
- ::URI::SshGit.ssh_protocol?(ssh_protocol) #=> true
32
- ::URI::SshGit.git_protocol?(ssh_protocol) #=> false
33
- ::URI::SshGit.ssh_protocol?(git_protocol) #=> false
34
- ::URI::SshGit.git_protocol?(git_protocol) #=> true
35
-
36
- # Usage
37
- git_clone_url = '...'
38
- if ::URI::SshGit.ssh_protocol?(git_clone_url)
39
- parsed = URI::SshGit.parse(git_clone_url)
40
- else
41
- parsed = URI.passe(git_clone_url)
42
- end
43
- parsed.host
44
- parsed.path
@@ -11,13 +11,5 @@ module URI
11
11
  path_part = '/' + path_part unless path_part.start_with?('/')
12
12
  Generic.build(userinfo: userinfo, host: host, path: path_part)
13
13
  end
14
-
15
- def self.ssh_protocol?(url_string)
16
- url_string.include?('@')
17
- end
18
-
19
- def self.git_protocol?(url_string)
20
- !ssh_protocol?(url_string)
21
- end
22
14
  end
23
15
  end
@@ -1,5 +1,5 @@
1
1
  module URI
2
2
  module SshGit
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-ssh_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler