uri-ssh_git 1.0.0 → 2.0.0.pre.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
  SHA1:
3
- metadata.gz: a58a6bccca401b5159ec06127adfcd314afe0e93
4
- data.tar.gz: 1f16771fe51e246d935e61a89212c019cd9f641e
3
+ metadata.gz: 3ff89aadc304b95f24c9f50b5204a96120b6c166
4
+ data.tar.gz: 55602842eca5700427fe3d72c1a9db844cd70824
5
5
  SHA512:
6
- metadata.gz: 41970a0b36d5940391edfd89fa2c6c080130834b7bd30556c042e6ba62c4df0a39453812bfe1bfa2fab5d24b8e8182490fe1dd083bcef83e94e930b91b7f7d36
7
- data.tar.gz: bee976dc4a6efdd6fbac82ddaa5f4f9286d11af40045d192a0f99b62f740f1cf88a9384c2f814e2c67de9377f55702b17a550fc2b3958bae4ac41c5df6c6151d
6
+ metadata.gz: 71e0df02fe4c6bf84e80404781a29a6c6c815705d21aec7471666e1f9dc95fb841a88bacb027498d7d39e6a0dd605ef3ca72bf4130a3e3eaade76647550eb35e
7
+ data.tar.gz: 93e11ecd6413296fb38db38770338156020e9eeca09c30f1e7841fd9ce1016498d96b069bda1162ab1c1d27c297db6264a11cb8606b884614193a5c1032c7b2b
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /node_modules
11
+ .byebug_history
data/README.md CHANGED
@@ -22,7 +22,7 @@ url.password #=> nil
22
22
  url.host #=> 'github.com'
23
23
  url.port #=> nil
24
24
  url.registry #=> nil
25
- url.path #=> '/packsaddle/ruby-uri-ssh_git.git'
25
+ url.path #=> 'packsaddle/ruby-uri-ssh_git.git'
26
26
  url.opaque #=> nil
27
27
  url.query #=> nil
28
28
  url.fragment #=> nil
@@ -30,7 +30,7 @@ url.fragment #=> nil
30
30
  URI::SshGit::Generic.build(
31
31
  userinfo: 'git',
32
32
  host: 'github.com',
33
- path: '/packsaddle/ruby-uri-ssh_git.git'
33
+ path: 'packsaddle/ruby-uri-ssh_git.git'
34
34
  ).to_s
35
35
  #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
36
36
  ```
data/changelog.md CHANGED
@@ -1,3 +1,28 @@
1
+ <a name="2.0.0.pre.1"></a>
2
+ # [2.0.0.pre.1](https://github.com/packsaddle/ruby-uri-ssh_git/compare/v1.0.0...v2.0.0.pre.1) (2015-12-03)
3
+
4
+ ## Breaking changes
5
+
6
+ * **fix:** do not mangle path in Generic's to_s by stripping leading slashes ([59a1bf2](https://github.com/packsaddle/ruby-uri-ssh_git/commit/59a1bf2))
7
+
8
+
9
+ ### v1 behavior
10
+
11
+ `#parse` always returns path which start with '/'.
12
+ `Generic#to_s` always returns path's first '/' stripped.
13
+
14
+ ### v2 behavior
15
+
16
+ `#parse` returns path which depends on input (absolute path or relative path).
17
+
18
+ See: [Breaking change about path #14](https://github.com/packsaddle/ruby-uri-ssh_git/issues/14)
19
+
20
+
21
+ ## Feature
22
+
23
+ * **feat:** support user-less URI ([b6abd20](https://github.com/packsaddle/ruby-uri-ssh_git/commit/b6abd20))
24
+
25
+
1
26
  <a name="1.0.0"></a>
2
27
  # [1.0.0](https://github.com/packsaddle/ruby-uri-ssh_git/compare/v0.1.2...v1.0.0) (2015-11-21)
3
28
 
data/example/simple.rb CHANGED
@@ -12,7 +12,7 @@ url.password #=> nil
12
12
  url.host #=> 'github.com'
13
13
  url.port #=> nil
14
14
  url.registry #=> nil
15
- url.path #=> '/packsaddle/ruby-uri-ssh_git.git'
15
+ url.path #=> 'packsaddle/ruby-uri-ssh_git.git'
16
16
  url.opaque #=> nil
17
17
  url.query #=> nil
18
18
  url.fragment #=> nil
@@ -20,6 +20,6 @@ url.fragment #=> nil
20
20
  URI::SshGit.build(
21
21
  userinfo: 'git',
22
22
  host: 'github.com',
23
- path: '/packsaddle/ruby-uri-ssh_git.git'
23
+ path: 'packsaddle/ruby-uri-ssh_git.git'
24
24
  ).to_s
25
25
  #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
data/lib/uri/ssh_git.rb CHANGED
@@ -17,7 +17,7 @@ module URI
17
17
  # url.host #=> 'github.com'
18
18
  # url.port #=> nil
19
19
  # url.registry #=> nil
20
- # url.path #=> '/packsaddle/ruby-uri-ssh_git.git'
20
+ # url.path #=> 'packsaddle/ruby-uri-ssh_git.git'
21
21
  # url.opaque #=> nil
22
22
  # url.query #=> nil
23
23
  # url.fragment #=> nil
@@ -29,8 +29,9 @@ module URI
29
29
  # @return [Generic] parsed object
30
30
  def self.parse(uri_string)
31
31
  host_part, path_part = uri_string.split(':', 2)
32
- userinfo, host = host_part.split('@', 2)
33
- path_part = '/' + path_part unless path_part.start_with?('/')
32
+ # There may be no user, so reverse the split to make sure host always
33
+ # is !nil if host_part was !nil.
34
+ host, userinfo = host_part.split('@', 2).reverse
34
35
  Generic.build(userinfo: userinfo, host: host, path: path_part)
35
36
  end
36
37
  end
@@ -6,14 +6,15 @@ module URI
6
6
  # Generic.build(
7
7
  # userinfo: 'git',
8
8
  # host: 'github.com',
9
- # path: '/packsaddle/ruby-uri-ssh_git.git'
9
+ # path: 'packsaddle/ruby-uri-ssh_git.git'
10
10
  # ).to_s
11
11
  # #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
12
12
  #
13
13
  # @return [String] git repository url via ssh protocol
14
14
  def to_s
15
- show_path = path.slice(1..-1) if path.start_with?('/')
16
- "#{user}@#{host}:#{show_path}"
15
+ str = ''
16
+ str << "#{user}@" if user && !user.empty?
17
+ str << "#{host}:#{path}"
17
18
  end
18
19
  end
19
20
  end
@@ -1,5 +1,5 @@
1
1
  module URI
2
2
  module SshGit
3
- VERSION = '1.0.0'
3
+ VERSION = '2.0.0.pre.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: 1.0.0
4
+ version: 2.0.0.pre.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-11-21 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,9 +91,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ">"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.3.1
97
97
  requirements: []
98
98
  rubyforge_project:
99
99
  rubygems_version: 2.4.5.1