yank 1.0.2 → 1.1.0

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: f4e19f467d2a157eae64c56d434b57c2df96c4ed
4
- data.tar.gz: 8ae3689f3b7d38db285b89dd5771e40832040db1
3
+ metadata.gz: a02d3ff6764d5ba75c7bd9d3a2de992740c38168
4
+ data.tar.gz: 5e82cbe8073a8b16a3d9adab39a9a7a64e1ae130
5
5
  SHA512:
6
- metadata.gz: ee40b2c9fe2aa88fafff2e378ebe84bcf54bc50cd805d3a47e03770c535db5cbfba64682820e9171532d19f69292eb6a81effa5e1504687e01a0c26164e9b5d2
7
- data.tar.gz: c78b0ebf65c0a3cbd2fcfa0e0752f2930d395ea712283286a977a70f5b3c4b330fc7bc8ee5fb3befe68b5a0910ad00b2ca6e7eff00db58f81c72f23896152bc0
6
+ metadata.gz: e581b7801bb7a8e3989756e39ddec42baa9cb302260df257b685ec8f75effe9d2bf6568ead005e97a5651ba7f0255517879e0c6fa766f386d48d3de78bdeac9e
7
+ data.tar.gz: d408cab735a53bcf8ec7ef467d8e712672cb544f2828ea70de88a3ec95c0b48b82642e9601655ca75996eca0b107e2d135e468b8d2361d68b844a6766ea3eab8
@@ -3,7 +3,7 @@ require_relative '../logging'
3
3
 
4
4
  module Yank
5
5
  class Git
6
- attr_reader :repo_name
6
+ attr_reader :name
7
7
 
8
8
  include ::Yank::Logging
9
9
 
@@ -14,22 +14,22 @@ module Yank
14
14
  end
15
15
 
16
16
  @repo = repo
17
- @repo_name = repo_name || @repo.split(".git")[0].split("/").last
17
+ @name = repo_name || @repo.split(".git")[0].split("/").last
18
18
  @version = version
19
19
 
20
20
  logger.debug("git repo: #{@repo}")
21
- logger.debug("git repo name: #{@repo_name}")
21
+ logger.debug("git repo name: #{@name}")
22
22
  logger.debug("git repo version: #{@version}")
23
23
  end
24
24
 
25
25
  def install(dir)
26
26
  logger.debug("Cloning into #{@repo}...")
27
- logger.debug(Open3.capture3("git clone --recursive #{@repo} #{dir}/#{@repo_name}"))
27
+ logger.debug(Open3.capture3("git clone --recursive #{@repo} #{dir}/#{@name}"))
28
28
 
29
29
  case @version["type"]
30
30
  when "branch", "tag", "commit"
31
31
  logger.debug("Checking out #{@version["value"]}...")
32
- logger.debug(Open3.capture3("cd #{dir}/#{@repo_name} && git checkout #{@version["value"]}"))
32
+ logger.debug(Open3.capture3("cd #{dir}/#{@name} && git checkout #{@version["value"]}"))
33
33
  end
34
34
  end
35
35
  end
@@ -0,0 +1,31 @@
1
+ require 'nexus_client'
2
+ require_relative '../logging'
3
+
4
+ module Yank
5
+ class Nexus
6
+ attr_reader :name
7
+
8
+ include ::Yank::Logging
9
+
10
+ def initialize(artifact_name, repo, version)
11
+ @name = artifact_name
12
+ @repo = repo
13
+ @version = version
14
+
15
+ logger.debug("nexus repo: #{@repo}")
16
+ logger.debug("nexus artifact name: #{@name}")
17
+ logger.debug("nexus artifact version: #{@version}")
18
+ end
19
+
20
+ def install(dir)
21
+ logger.debug("Preparing nexus client download from #{@repo}...")
22
+ client = ::Nexus::Client.new(@repo, nil, false, false, logger)
23
+
24
+ if @version["type"] == "gav"
25
+ client.download_gav("#{dir}/#{@name}", "#{@version["value"]}")
26
+ else
27
+ raise ::Yank::YankException.new("gav must be the version type with nexus specified.")
28
+ end
29
+ end
30
+ end
31
+ end
@@ -20,6 +20,7 @@ mapping:
20
20
  type: str
21
21
  enum:
22
22
  - git
23
+ - nexus
23
24
  required: true
24
25
  "repo":
25
26
  type: str
@@ -35,6 +36,7 @@ mapping:
35
36
  - tag
36
37
  - branch
37
38
  - commit
39
+ - gav
38
40
  "value":
39
41
  type: str
40
42
  required: true
@@ -1,5 +1,4 @@
1
1
  require 'kwalify'
2
- require_relative 'vcs/git'
3
2
  require_relative 'yank_exception'
4
3
  require_relative 'logging'
5
4
 
@@ -12,7 +11,7 @@ module Yank
12
11
  logger.debug("verifying yank: #{yank}")
13
12
  vcs = get_vcs(yank)
14
13
 
15
- if ::Yank.yank_exists?(yank["alias"].nil?? vcs.repo_name: yank["alias"], target)
14
+ if ::Yank.yank_exists?(yank["alias"].nil?? vcs.name: yank["alias"], target)
16
15
  logger.debug("yank already installed, skipping")
17
16
  next
18
17
  end
@@ -21,7 +20,7 @@ module Yank
21
20
  vcs.install(target)
22
21
 
23
22
  if yank["recurse"]
24
- yank_file = ::Yank.get_yanks_file(target, yank["alias"].nil?? vcs.repo_name: yank["alias"])
23
+ yank_file = ::Yank.get_yanks_file(target, yank["alias"].nil?? vcs.name: yank["alias"])
25
24
 
26
25
  return if yank_file.nil?
27
26
 
@@ -37,7 +36,11 @@ module Yank
37
36
 
38
37
  case yank["vcs"]
39
38
  when 'git'
39
+ require_relative 'vcs/git'
40
40
  vcs = ::Yank::Git.new(yank["alias"], yank["repo"], yank["version"])
41
+ when 'nexus'
42
+ require_relative 'vcs/nexus'
43
+ vcs = ::Yank::Nexus.new(yank["alias"], yank["repo"], yank["version"])
41
44
  end
42
45
 
43
46
  if vcs.nil?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yank
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Lathrop
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-24 00:00:00.000000000 Z
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kwalify
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.7.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: nexus_client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.0
27
41
  description: Dependency manager
28
42
  email: jelathrop@gmail.com
29
43
  executables:
@@ -34,6 +48,7 @@ files:
34
48
  - bin/yank
35
49
  - lib/logging.rb
36
50
  - lib/vcs/git.rb
51
+ - lib/vcs/nexus.rb
37
52
  - lib/yank.kwalify
38
53
  - lib/yank.rb
39
54
  - lib/yank_exception.rb