uri-ssh_git 0.1.1 → 0.1.2

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: 9facd61c5f6b68e85e35b2dd61020b9af938a50c
4
- data.tar.gz: cca70a7dd3fc346010500a4dd6c1c9750805bce6
3
+ metadata.gz: b1ae937932e3032acced4570e84110b5e6d91b01
4
+ data.tar.gz: a21a548f080ed6853cbf62b96c9235cff2a57636
5
5
  SHA512:
6
- metadata.gz: 0dbf5ad7bcd4fb6873b41907b5f2ef1355351369261fa65c9b81309b783583938ffab83c0d7c62dd3c0ff72ce7b58d1c7707f1bdc73951aa921dccd9322cfc3b
7
- data.tar.gz: f887deb4d55c63bb00495b712b3aa8ff8ddd628e282e63373ae5e2ddc64d4df08ffcc21b0e833c60ea46c184c89d0258e474f94713bde90487c60076c6f33cf2
6
+ metadata.gz: e718ee0423b176b4dd7e5a0809632857dee1cf60c523fc9c286e2b79c426a4fd4f39e68cb0ace4d523d962bd2fb708c1f106494b99d2ffeba5cb293f695ae77d
7
+ data.tar.gz: 2176ab180ede97531ee08ae4074b00a7a7739f8cfc62212d17721df05c10db2e667a09137475910d21fe11b1c053857b5b0c54eac934b5166febf0a7a9279c8f
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+ var execSync = require('child_process').execSync;
3
+ var URI = require('urijs');
4
+
5
+ var gemspec = JSON.parse(execSync('bundle exec parse-gemspec-cli uri-ssh_git.gemspec'));
6
+ var homepageUrl = gemspec.homepage;
7
+ var url = new URI(homepageUrl);
8
+ var host = url.protocol() + '://' + url.authority();
9
+ var owner = url.pathname().split('/')[1];
10
+ var repository = url.pathname().split('/')[2];
11
+
12
+ module.exports = {
13
+ version: gemspec.version,
14
+ host: host,
15
+ owner: owner,
16
+ repository: repository
17
+ };
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /node_modules
@@ -12,6 +12,3 @@ Metrics/LineLength:
12
12
  Style/FileName:
13
13
  Exclude:
14
14
  - exe/*
15
-
16
- Style/RegexpLiteral:
17
- MaxSlashes: 0
data/Gemfile CHANGED
@@ -2,5 +2,9 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in uri-ssh_git.gemspec
4
4
  gemspec
5
+
5
6
  gem 'byebug' if RUBY_VERSION >= '2.0.0'
7
+ gem 'parse_gemspec-cli'
6
8
  gem 'pry'
9
+ gem 'rubocop'
10
+ gem 'yard'
data/README.md CHANGED
@@ -3,7 +3,14 @@
3
3
  [![Gem Version](http://img.shields.io/gem/v/uri-ssh_git.svg?style=flat)](http://badge.fury.io/rb/uri-ssh_git)
4
4
  [![Build Status](http://img.shields.io/travis/packsaddle/ruby-uri-ssh_git/master.svg?style=flat)](https://travis-ci.org/packsaddle/ruby-uri-ssh_git)
5
5
 
6
+ > Parse and build git repository url via ssh protocol.
7
+
8
+ See: [Popular use case packsaddle/ruby-git_clone_url](https://github.com/packsaddle/ruby-git_clone_url)
9
+
10
+
6
11
  ```ruby
12
+ require 'uri/ssh_git'
13
+
7
14
  url = URI::SshGit.parse('git@github.com:packsaddle/ruby-uri-ssh_git.git')
8
15
  # => #<URI::SshGit::Generic git@github.com:packsaddle/ruby-uri-ssh_git.git>
9
16
 
@@ -21,7 +28,7 @@ url.opaque #=> nil
21
28
  url.query #=> nil
22
29
  url.fragment #=> nil
23
30
 
24
- URI::SshGit.build(
31
+ URI::SshGit::Generic.build(
25
32
  userinfo: 'git',
26
33
  host: 'github.com',
27
34
  path: '/packsaddle/ruby-uri-ssh_git.git'
@@ -48,6 +55,7 @@ url.user #=> nil
48
55
  url.port #=> nil
49
56
  ```
50
57
 
58
+
51
59
  ## Installation
52
60
 
53
61
  Add this line to your application's Gemfile:
data/Rakefile CHANGED
@@ -8,3 +8,12 @@ Rake::TestTask.new(:test) do |t|
8
8
  end
9
9
 
10
10
  task default: :test
11
+
12
+ require 'yard'
13
+ require 'yard/rake/yardoc_task'
14
+ DOC_FILES = ['lib/**/*.rb']
15
+ DOC_OPTIONS = ['--debug', '--verbose']
16
+ YARD::Rake::YardocTask.new(:doc) do |t|
17
+ t.files = DOC_FILES
18
+ t.options = DOC_OPTIONS if Rake.application.options.trace
19
+ end
@@ -0,0 +1,4 @@
1
+ <a name="0.1.2"></a>
2
+ ## [0.1.2](https://github.com/packsaddle/ruby-uri-ssh_git/compare/v0.1.1...v0.1.2) (2015-11-21)
3
+
4
+ * Add documentation.
@@ -4,7 +4,29 @@ require 'uri/ssh_git/generic'
4
4
  require 'uri/ssh_git/version'
5
5
 
6
6
  module URI
7
+ # Parse and build git repository url via ssh protocol.
7
8
  module SshGit
9
+ # @example
10
+ # url = URI::SshGit.parse('git@github.com:packsaddle/ruby-uri-ssh_git.git')
11
+ # #=> #<URI::SshGit::Generic git@github.com:packsaddle/ruby-uri-ssh_git.git>
12
+ #
13
+ # url.scheme #=> nil
14
+ # url.userinfo #=> 'git'
15
+ # url.user #=> 'git'
16
+ # url.password #=> nil
17
+ # url.host #=> 'github.com'
18
+ # url.port #=> nil
19
+ # url.registry #=> nil
20
+ # url.path #=> '/packsaddle/ruby-uri-ssh_git.git'
21
+ # url.opaque #=> nil
22
+ # url.query #=> nil
23
+ # url.fragment #=> nil
24
+ #
25
+ # @see http://docs.ruby-lang.org/en/2.2.0/URI/Generic.html
26
+ #
27
+ # @param url [String] git repository url via ssh protocol
28
+ #
29
+ # @return [Generic] parsed object
8
30
  def self.parse(uri_string)
9
31
  host_part, path_part = uri_string.split(':', 2)
10
32
  userinfo, host = host_part.split('@', 2)
@@ -1,6 +1,16 @@
1
1
  module URI
2
2
  module SshGit
3
+ # @see http://docs.ruby-lang.org/en/2.2.0/URI/Generic.html
3
4
  class Generic < ::URI::Generic
5
+ # @example
6
+ # Generic.build(
7
+ # userinfo: 'git',
8
+ # host: 'github.com',
9
+ # path: '/packsaddle/ruby-uri-ssh_git.git'
10
+ # ).to_s
11
+ # #=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'
12
+ #
13
+ # @return [String] git repository url via ssh protocol
4
14
  def to_s
5
15
  show_path = path.slice(1..-1) if path.start_with?('/')
6
16
  "#{user}@#{host}:#{show_path}"
@@ -1,5 +1,5 @@
1
1
  module URI
2
2
  module SshGit
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "conventional-changelog": "0.4.3",
4
+ "npm-check-updates": "^2.2.3",
5
+ "urijs": "^1.16.1"
6
+ },
7
+ "scripts": {
8
+ "changelog": "conventional-changelog -i changelog.md --overwrite --preset angular --context .conventional-changelog.context.js",
9
+ "ncu": "ncu -u"
10
+ }
11
+ }
@@ -16,20 +16,20 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.files = \
18
18
  `git ls-files -z`
19
- .split("\x0")
20
- .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- .reject do |f|
22
- [
23
- '.travis.yml',
24
- 'circle.yml',
25
- '.tachikoma.yml'
26
- ].include?(f)
27
- end
19
+ .split("\x0")
20
+ .reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ .reject do |f|
22
+ [
23
+ '.travis.yml',
24
+ 'circle.yml',
25
+ '.tachikoma.yml'
26
+ ].include?(f)
27
+ end
28
28
  spec.bindir = 'exe'
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ['lib']
31
31
 
32
- spec.add_development_dependency 'bundler', '~> 1.8'
33
- spec.add_development_dependency 'rake', '~> 10.0'
32
+ spec.add_development_dependency 'bundler'
33
+ spec.add_development_dependency 'rake'
34
34
  spec.add_development_dependency 'test-unit'
35
35
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-ssh_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-05 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '0'
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: '1.8'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
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: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".conventional-changelog.context.js"
62
63
  - ".gitignore"
63
64
  - ".rubocop.yml"
64
65
  - CODE_OF_CONDUCT.md
@@ -68,10 +69,12 @@ files:
68
69
  - Rakefile
69
70
  - bin/console
70
71
  - bin/setup
72
+ - changelog.md
71
73
  - example/simple.rb
72
74
  - lib/uri/ssh_git.rb
73
75
  - lib/uri/ssh_git/generic.rb
74
76
  - lib/uri/ssh_git/version.rb
77
+ - package.json
75
78
  - uri-ssh_git.gemspec
76
79
  homepage: https://github.com/packsaddle/ruby-uri-ssh_git
77
80
  licenses:
@@ -93,8 +96,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
96
  version: '0'
94
97
  requirements: []
95
98
  rubyforge_project:
96
- rubygems_version: 2.4.5
99
+ rubygems_version: 2.4.5.1
97
100
  signing_key:
98
101
  specification_version: 4
99
102
  summary: Parse and build ssh format url
100
103
  test_files: []
104
+ has_rdoc: