dandelion 0.5.3 → 0.5.4

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
- SHA256:
3
- metadata.gz: f3d202883168a8166c28a422c0a46d2c8e691b50e170e3c176432159ecadceae
4
- data.tar.gz: e6a0118befa06a36746d0862c478a98be301e5f71935a928a72a983c84355d68
2
+ SHA1:
3
+ metadata.gz: 3cabf65a76a5c2f1d342e37622bd46eacbfac685
4
+ data.tar.gz: 8867a0b64744e90b42c96b6ce40a0117acaf54c5
5
5
  SHA512:
6
- metadata.gz: 04e3edcb6148b6033c392f69fb260ea59142aa8d8971eaf12f68f3c52d038afc156be5d00bee75b578b874046cf2a613cbaecca6bf30958afcd917cd7696f253
7
- data.tar.gz: cdd934044c7374e15437bd62cb7fd71da41d4adf313241ab1e3cf9a21caefaa4ef6a005476e4f4ce85fd8b8e2965202bbb6aa59a4fa093453cb9a629c18c5801
6
+ metadata.gz: b2d8284ac4667afe38f92bbf0cf7375de3b3897cd4597821c2810d20fda17104e136de9a100b6db108c8279b3b29ddc114d180363f78fd63e6a3c83d4cdd2a7d
7
+ data.tar.gz: 9169b0716f5e4e30739532fda1a89a125998b7c88d48c6d8a27ef7868e3383daf0ae16a30ecff3e3e41df93fcd3a8376b13cc6e7a081d11c938ba2e2926ccf54
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
 
@@ -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
@@ -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)
@@ -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.3'
2
+ VERSION = '0.5.4'
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.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-20 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
@@ -16,14 +16,14 @@ 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
26
+ version: 0.27.7
27
27
  description:
28
28
  email:
29
29
  - scott@scttnlsn.com
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.7.3
184
+ rubygems_version: 2.6.14.1
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Incremental Git repository deployment