dandelion 0.4.5 → 0.4.6
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 +4 -4
- data/lib/dandelion/adapter/s3.rb +5 -1
- data/lib/dandelion/cli.rb +3 -2
- data/lib/dandelion/version.rb +1 -1
- data/lib/dandelion/workspace.rb +22 -12
- data/spec/dandelion/workspace_spec.rb +21 -3
- data/spec/fixtures/repo.git/refs/tags/test-tag +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e24ed3bb3d909f2dde31c896dc0a55ba7bea103
|
4
|
+
data.tar.gz: 40301d574cfbd917d0ccc85da4449ff79f73226e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a33bd1ff022f1c5f0c0497d52e04b545db4f38b9f69487bd7ebe6d83753e2f3189b057d1b03a670a9057f5b8d9494c2a3e62b7a84b26a0b0fe7d55980ce3fc04
|
7
|
+
data.tar.gz: 963b92769bd3ab6c1af4af22662f056776ce801472c9542d726e3e5adb9f3aefecde44700a3744fbc6148c3e517b9c3bf079cc359f03364ffc37c435de2ec2bc
|
data/lib/dandelion/adapter/s3.rb
CHANGED
@@ -21,7 +21,11 @@ module Dandelion
|
|
21
21
|
connect!
|
22
22
|
|
23
23
|
key = path(file)
|
24
|
-
|
24
|
+
|
25
|
+
begin
|
26
|
+
policy = AWS::S3::S3Object.acl(key, bucket_name) if @config[:preserve_permissions]
|
27
|
+
rescue AWS::S3::NoSuchKey
|
28
|
+
end
|
25
29
|
|
26
30
|
AWS::S3::S3Object.store(path(file), data, bucket_name)
|
27
31
|
AWS::S3::S3Object.acl(key, bucket_name, policy) unless policy.nil?
|
data/lib/dandelion/cli.rb
CHANGED
data/lib/dandelion/version.rb
CHANGED
data/lib/dandelion/workspace.rb
CHANGED
@@ -41,18 +41,28 @@ module Dandelion
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def lookup(val)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
44
|
+
result = lookup_sha(val) ||
|
45
|
+
lookup_ref(val) ||
|
46
|
+
lookup_ref("refs/tags/#{val}") ||
|
47
|
+
lookup_ref("refs/branches/#{val}") ||
|
48
|
+
lookup_ref("refs/heads/#{val}")
|
49
|
+
|
50
|
+
raise RevisionError.new(val) unless result
|
51
|
+
|
52
|
+
result
|
53
|
+
end
|
54
|
+
|
55
|
+
def lookup_sha(val)
|
56
|
+
@repo.lookup(val)
|
57
|
+
rescue Rugged::OdbError, Rugged::InvalidError
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
|
61
|
+
def lookup_ref(val)
|
62
|
+
ref = @repo.ref(val)
|
63
|
+
lookup_sha(ref.target) if ref
|
64
|
+
rescue Rugged::ReferenceError
|
65
|
+
nil
|
56
66
|
end
|
57
67
|
|
58
68
|
def local_sha
|
@@ -19,10 +19,28 @@ describe Dandelion::Workspace do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'valid revision specified' do
|
22
|
-
|
22
|
+
context 'sha' do
|
23
|
+
let(:workspace) { Dandelion::Workspace.new(test_repo, adapter, revision: initial_revision) }
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
it 'returns commit for given revision' do
|
26
|
+
expect(workspace.local_commit.oid).to eq initial_revision
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'tag' do
|
31
|
+
let(:workspace) { Dandelion::Workspace.new(test_repo, adapter, revision: 'test-tag') }
|
32
|
+
|
33
|
+
it 'returns commit for given revision' do
|
34
|
+
expect(workspace.local_commit.oid).to eq initial_revision
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'branch' do
|
39
|
+
let(:workspace) { Dandelion::Workspace.new(test_repo, adapter, revision: 'master') }
|
40
|
+
|
41
|
+
it 'returns commit for given revision' do
|
42
|
+
expect(workspace.local_commit.oid).to eq head_revision
|
43
|
+
end
|
26
44
|
end
|
27
45
|
end
|
28
46
|
|
@@ -0,0 +1 @@
|
|
1
|
+
e289ff1e2729839759dbd6fe99b6e35880910c7c
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dandelion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Nelson
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- spec/fixtures/repo.git/objects/ee/314a31b622b027c10981acaed7903a3607dbd4
|
102
102
|
- spec/fixtures/repo.git/objects/f6/66b137794d56880bab05e8fd256713a8fccf92
|
103
103
|
- spec/fixtures/repo.git/refs/heads/master
|
104
|
+
- spec/fixtures/repo.git/refs/tags/test-tag
|
104
105
|
- spec/fixtures/repo_symlink.git/HEAD
|
105
106
|
- spec/fixtures/repo_symlink.git/config
|
106
107
|
- spec/fixtures/repo_symlink.git/description
|
@@ -206,6 +207,7 @@ test_files:
|
|
206
207
|
- spec/fixtures/repo.git/objects/ee/314a31b622b027c10981acaed7903a3607dbd4
|
207
208
|
- spec/fixtures/repo.git/objects/f6/66b137794d56880bab05e8fd256713a8fccf92
|
208
209
|
- spec/fixtures/repo.git/refs/heads/master
|
210
|
+
- spec/fixtures/repo.git/refs/tags/test-tag
|
209
211
|
- spec/fixtures/repo_symlink.git/HEAD
|
210
212
|
- spec/fixtures/repo_symlink.git/config
|
211
213
|
- spec/fixtures/repo_symlink.git/description
|