dandelion 0.5.2 → 0.6.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
- SHA1:
3
- metadata.gz: 9b380cba965412c94b9fb15e2358c6fe6083e335
4
- data.tar.gz: 05d509be4f049bffaa751cbac830ec7415ea3ead
2
+ SHA256:
3
+ metadata.gz: 6ff4ba37b8419deac5f0853252d57e9bcd6a8b07f532b0429f83c92b5e1a40d5
4
+ data.tar.gz: e62ebf5a1502e45400a7a71c1c937ade7d660ac0ef1b99628e909a4eed2011e5
5
5
  SHA512:
6
- metadata.gz: 9c2be58a38b4681db98fc8ba2d9d79614c7b9236412cd8c5a3e0a06b17bb25c9b64aaebf1e3939f8e8dcb87d8af7ed06c2bda830f12db1ff69be194f93ae3a19
7
- data.tar.gz: 1f63aecd879d84d059094bafb51eb21228da5a7ab195ec958ce8f6f6ea954fe20edabc68bbb07d2ca08e3136863a2a4b9ba9a287da555e0bc243b13425fd57e5
6
+ metadata.gz: 382c28b517ec058ba9862549e586f62e3415a2518ee8c72438b5ccd55479aa06208eda9359e94dc940cc8009cf69b832b66f76f6f302ff6f9e5ee4356f8e95ba
7
+ data.tar.gz: a3259adefc5282f38301df1f558356a14e3bdfde7f2eeb5ae1d8601c8349c38f34c2f5ddd9529d37321700353c9f2e79c0394c0a4d2bac704025e256e9fb0040
data/README.md CHANGED
@@ -2,7 +2,6 @@ Dandelion
2
2
  =========
3
3
  [![Gem Version](https://badge.fury.io/rb/dandelion.png)](http://badge.fury.io/rb/dandelion)
4
4
  [![Build Status](https://travis-ci.org/scttnlsn/dandelion.png)](https://travis-ci.org/scttnlsn/dandelion)
5
- [![Dependency Status](https://gemnasium.com/scttnlsn/dandelion.png)](https://gemnasium.com/scttnlsn/dandelion)
6
5
  [![Code Climate](https://codeclimate.com/github/scttnlsn/dandelion.png)](https://codeclimate.com/github/scttnlsn/dandelion)
7
6
 
8
7
  Incremental Git repository deployment.
@@ -22,6 +21,8 @@ or
22
21
 
23
22
  $ apt-get install pkg-config cmake
24
23
 
24
+ You may also need to install the Ruby headers if you're using a version of Ruby installed by your OS package manager (`ruby-dev` on Debian, `ruby-all-dev` on Ubuntu).
25
+
25
26
  Config
26
27
  ------
27
28
 
@@ -107,7 +108,7 @@ Optional:
107
108
  * `port` (defaults to 21)
108
109
  * `passive` (defaults to false)
109
110
 
110
- **FTPS**: `adapter: ftps` (ftp over TLS, based on [DoubleBagFTPS](https://github.com/bnix/double-bag-ftps) and Dandelions native FTP adapter)
111
+ **FTPS**: `adapter: ftps`
111
112
 
112
113
  Required: (same as FTP)
113
114
 
@@ -119,7 +120,6 @@ Optional: (in addition to options for FTP)
119
120
 
120
121
  * `port`
121
122
  * `passive`
122
- * `auth_tls` (default false)
123
123
  * `ftps_implicit` (default false: explicit TLS)
124
124
  * `insecure` (default false, true to allow self-signed certificates)
125
125
 
data/dandelion.gemspec CHANGED
@@ -25,5 +25,5 @@ Gem::Specification.new do |s|
25
25
  ! additional gems need to be installed.
26
26
  MSG
27
27
 
28
- s.add_dependency 'rugged', '0.26.0'
28
+ s.add_dependency 'rugged', '0.27.7'
29
29
  end
@@ -19,7 +19,7 @@ module Dandelion
19
19
 
20
20
  def read(file)
21
21
  begin
22
- @ftp.getbinaryfile(path(file), nil)
22
+ @ftp.get(path(file), nil)
23
23
  rescue Net::FTPPermError => e
24
24
  nil
25
25
  end
@@ -28,11 +28,11 @@ module Dandelion
28
28
  def write(file, data)
29
29
  temp(file, data) do |temp|
30
30
  begin
31
- @ftp.putbinaryfile(temp, path(file))
31
+ @ftp.put(temp, path(file))
32
32
  rescue Net::FTPPermError => e
33
33
  raise e unless e.to_s =~ /550|553/
34
34
  mkdir_p(File.dirname(path(file)))
35
- @ftp.putbinaryfile(temp, path(file))
35
+ @ftp.put(temp, path(file))
36
36
  end
37
37
  end
38
38
  end
@@ -54,6 +54,9 @@ module Dandelion
54
54
  def ftp_client
55
55
  ftp = Net::FTP.new
56
56
  ftp.connect(@config['host'], @config['port'])
57
+ if @config['ascii']
58
+ ftp.binary=false
59
+ end
57
60
  ftp.login(@config['username'], @config['password'])
58
61
  ftp.passive = @config['passive']
59
62
  ftp
@@ -6,14 +6,12 @@ module Dandelion
6
6
  include ::Dandelion::Utils
7
7
 
8
8
  adapter 'ftps'
9
- requires_gems 'double-bag-ftps'
10
9
 
11
10
  def initialize(config)
12
- require 'double_bag_ftps'
11
+ require 'net/ftp'
13
12
 
14
- config[:auth_tls] = to_b(config[:auth_tls])
15
13
  config[:ftps_implicit] = to_b(config[:ftps_implicit])
16
- config[:inscecure] = to_b(config[:insecure])
14
+ config[:insecure] = to_b(config[:insecure])
17
15
 
18
16
  super(config)
19
17
  end
@@ -21,24 +19,27 @@ module Dandelion
21
19
  private
22
20
 
23
21
  def ftp_client
24
- ftps = DoubleBagFTPS.new(@config['host'], nil, nil, nil, ftps_mode, {})
25
-
26
- if @config['insecure']
27
- ftps.ssl_context = DoubleBagFTPS.create_ssl_context(verify_mode: OpenSSL::SSL::VERIFY_NONE)
22
+ host = @config['host']
23
+ ftps = Net::FTP.new(host, connection_params)
24
+ if @config['ascii']
25
+ ftps.binary = false
28
26
  end
29
27
 
30
- ftps.login(@config['username'], @config['password'], nil, ftps_auth)
31
- ftps.passive = @config[:passive]
32
-
33
- ftps
34
- end
35
-
36
- def ftps_auth
37
- @config['auth_tls'] ? 'TLS' : nil
28
+ def connection_params
29
+ {
30
+ port: @config['port'],
31
+ ssl: ssl_context_params,
32
+ passive: @config['passive'],
33
+ implicit_ftps: @config['ftps_implicit'],
34
+ username: @config['username'],
35
+ password: @config['password'],
36
+ debug_mode: @config['debug']
37
+ }
38
+ end
38
39
  end
39
40
 
40
- def ftps_mode
41
- @config['ftps_implicit'] ? DoubleBagFTPS::IMPLICIT : DoubleBagFTPS::EXPLICIT
41
+ def ssl_context_params
42
+ @config['insecure'] ? { verify_mode: OpenSSL::SSL::VERIFY_NONE } : true
42
43
  end
43
44
  end
44
45
  end
@@ -25,8 +25,8 @@ module Dandelion
25
25
  yield Change.new(path, change.type)
26
26
  else
27
27
  read = -> { @tree.data(change.path) }
28
-
29
- if @tree.is_symlink?(change.path)
28
+
29
+ if @tree.symlink?(change.path)
30
30
  yield Change.new(path, :symlink, read)
31
31
  else
32
32
  yield Change.new(path, change.type, read)
@@ -26,7 +26,11 @@ private
26
26
 
27
27
  class PartialDiff
28
28
  def initialize(diff)
29
- @deltas = diff.deltas
29
+ @deltas = []
30
+
31
+ diff.each_delta do |delta|
32
+ @deltas << delta
33
+ end
30
34
  end
31
35
 
32
36
  def empty?
@@ -42,7 +46,11 @@ private
42
46
 
43
47
  class FullDiff
44
48
  def initialize(diff)
45
- @deltas = diff.patches.map(&:delta)
49
+ @deltas = []
50
+
51
+ diff.each_patch do |patch|
52
+ @deltas << patch.delta
53
+ end
46
54
  end
47
55
 
48
56
  def empty?
@@ -55,4 +63,4 @@ private
55
63
  end
56
64
  end
57
65
  end
58
- end
66
+ end
@@ -1,5 +1,10 @@
1
1
  module Dandelion
2
2
  class Tree
3
+ # https://github.com/libgit2/libgit2/blob/development/include/git2/types.h
4
+ FILEMODE_BLOB = 0100644
5
+ FILEMODE_BLOB_EXECUTABLE = 0100755
6
+ FILEMODE_SYMLINK = 0120000
7
+
3
8
  attr_reader :commit
4
9
 
5
10
  def initialize(repo, commit)
@@ -7,34 +12,42 @@ module Dandelion
7
12
  @commit = commit
8
13
  end
9
14
 
10
- def is_symlink?(path)
11
- # https://github.com/libgit2/libgit2/blob/development/include/git2/types.h
12
- @commit.tree.path(path)[:filemode] == 0120000
15
+ def symlink?(path)
16
+ filemode(path) == FILEMODE_SYMLINK
13
17
  end
14
18
 
15
- def data(path)
16
- submodule = @repo.submodules[path]
19
+ def blob?(path)
20
+ mode = filemode(path)
21
+ mode == FILEMODE_BLOB || mode == FILEMODE_BLOB_EXECUTABLE
22
+ end
17
23
 
18
- if submodule
24
+ def data(path)
25
+ if blob?(path) || symlink?(path)
26
+ obj = object(path)
27
+ blob_content(obj)
28
+ else
19
29
  # TODO
20
30
  nil
21
- else
22
- info, obj = object(path)
23
- blob_content(obj)
24
31
  end
25
32
  end
26
33
 
27
34
  private
28
35
 
36
+ def info(path)
37
+ @commit.tree.path(path)
38
+ end
39
+
40
+ def filemode(path)
41
+ info(path)[:filemode]
42
+ end
43
+
29
44
  def object(path)
30
- info = @commit.tree.path(path)
31
- object = @repo.lookup(info[:oid])
32
- [info, object]
45
+ oid = info(path)[:oid]
46
+ @repo.lookup(oid)
33
47
  end
34
48
 
35
49
  def blob_content(object)
36
50
  object.read_raw.data
37
51
  end
38
-
39
52
  end
40
53
  end
@@ -1,3 +1,3 @@
1
1
  module Dandelion
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dandelion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Nelson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-26 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -16,15 +16,15 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.26.0
19
+ version: 0.27.7
20
20
  type: :runtime
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: 0.26.0
27
- description:
26
+ version: 0.27.7
27
+ description:
28
28
  email:
29
29
  - scott@scttnlsn.com
30
30
  executables:
@@ -180,9 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubyforge_project:
184
- rubygems_version: 2.5.1
185
- signing_key:
183
+ rubygems_version: 3.2.15
184
+ signing_key:
186
185
  specification_version: 4
187
186
  summary: Incremental Git repository deployment
188
187
  test_files: