palimpsest 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 786935525c8fd9d713375ffc0b13e52bae005eb7
4
- data.tar.gz: 9b1f0e46de8b8d23fd44a55034e1ce87529c135a
3
+ metadata.gz: f5c5fd7be63cf42172ba38c5aa33e5be3fa92f83
4
+ data.tar.gz: 79170f2245713ce67b510482b3ad4283817aea95
5
5
  SHA512:
6
- metadata.gz: 7a405c655b0aa0024da55885d687e89cabe671705ba2dde83c1875ee911b04c297856dc97cf05ea85f79544ae35f49c6f8a7cb354993bb356d61c61e65e757ca
7
- data.tar.gz: c139bd33702b70b8297f6f5eab2d0a1289f74249e95fd8fd68c184f1c1e7b5b8349f614ac3b7db538d836971c41c74597ced18ac2f98cdce2911058a382b31bd
6
+ metadata.gz: 1fbb3b3b92713de6e71c56cd6d3e296e085cf2968d87ff6300eb0cbbb523735c887b137917df09ffbac9e964c3a55ea657ec57a1ab1b58245de8ba0b11b0191e
7
+ data.tar.gz: 83ff64c867a93424b6550623dd75a6ef39e9b91440c934f7bcbd85d09fc91eec9df180ed4d249794b722c7ff2f8c5a6b7c4ea0e6805c5ff1be2a4afb51663563
@@ -156,6 +156,7 @@ module Palimpsest
156
156
  # @param dest [String] path to copy environment's files to
157
157
  # @return [Environment] the current environment instance
158
158
  def copy dest: site.path
159
+ FileUtils.mkdir_p dest
159
160
  FileUtils.cp_r Dir["#{directory}/*"], dest, preserve: true
160
161
  self
161
162
  end
@@ -247,7 +248,7 @@ module Palimpsest
247
248
  # Install all externals.
248
249
  # @return [Environment] the current environment instance
249
250
  def install_externals
250
- externals.each { |e| e.install }
251
+ externals.each { |e| e.install.cleanup }
251
252
  self
252
253
  end
253
254
 
@@ -36,14 +36,15 @@ module Palimpsest
36
36
  def environment
37
37
  return @environment if @environment
38
38
 
39
- site = Site.new repo: Grit::Repo.new(tmp_environment.directory)
39
+ site = Site.new name: "external_#{name.gsub '/', '_'}", repo: Grit::Repo.new(tmp_environment.directory)
40
40
  @environment = Environment.new site: site, treeish: branch
41
41
  end
42
42
 
43
43
  # Copy the files to the {#install_path}.
44
44
  # @return (see Environment#copy)
45
45
  def install
46
- environment.copy dest: install_path
46
+ environment.populate.copy dest: install_path
47
+ self
47
48
  end
48
49
 
49
50
  # @return [External] the current external instance
@@ -65,7 +66,7 @@ module Palimpsest
65
66
  Grit::Git.git_max_size = 200 * 1048576
66
67
  Grit::Git.git_timeout = 200
67
68
 
68
- @tmp_environment = Environment.new
69
+ @tmp_environment = Environment.new site: Site.new(name: "external_clone_#{name.gsub '/', '_'}")
69
70
  gritty = Grit::Git.new tmp_environment.directory
70
71
  gritty.clone( { branch: branch }, repo_path, tmp_environment.directory )
71
72
  @tmp_environment
@@ -1,4 +1,4 @@
1
1
  module Palimpsest
2
2
  # Palimpsest version.
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
@@ -79,9 +79,11 @@ describe Palimpsest::Environment do
79
79
  end
80
80
 
81
81
  describe "#copy" do
82
- it "moves the component to the install path" do
82
+
83
+ it "copies the environment to the destination" do
83
84
  dir = environment.directory
84
85
  allow(Dir).to receive(:[]).with("#{dir}/*").and_return( %W(#{dir}/path/1 #{dir}/path/2) )
86
+ expect(FileUtils).to receive(:mkdir_p).with('/dest/path')
85
87
  expect(FileUtils).to receive(:cp_r).with( %W(#{dir}/path/1 #{dir}/path/2), '/dest/path', preserve: true)
86
88
  environment.copy dest: '/dest/path'
87
89
  end
@@ -292,13 +294,11 @@ describe Palimpsest::Environment do
292
294
  allow(external_2).to receive(:install)
293
295
  end
294
296
 
295
- it "installs the externals" do
296
- expect(external_1).to receive(:install)
297
- expect(external_2).to receive(:install)
298
- environment.install_externals
299
- end
300
-
301
- it "returns itself" do
297
+ it "installs the externals and returns itself" do
298
+ expect(external_1).to receive(:install).and_return(external_1)
299
+ expect(external_1).to receive(:cleanup)
300
+ expect(external_2).to receive(:install).and_return(external_2)
301
+ expect(external_2).to receive(:cleanup)
302
302
  expect(environment.install_externals).to be environment
303
303
  end
304
304
  end
@@ -11,6 +11,7 @@ describe Palimpsest::External do
11
11
  allow(Grit::Git).to receive(:new).and_return(gritty)
12
12
  allow(Grit::Repo).to receive(:new).and_return(repo)
13
13
  allow(gritty).to receive(:clone)
14
+ allow(repo).to receive(:archive_tar)
14
15
  end
15
16
 
16
17
  describe "#repo_path" do
@@ -77,10 +78,11 @@ describe Palimpsest::External do
77
78
 
78
79
  describe "#install" do
79
80
 
80
- it "installs the external to the install path" do
81
+ it "populates and installs the external to the install path and returns itself" do
81
82
  external.install_path = 'path/to/install'
83
+ expect(external.environment).to receive(:populate).and_return(external.environment)
82
84
  expect(external.environment).to receive(:copy).with(dest: 'path/to/install')
83
- external.install
85
+ expect(external.install).to be external
84
86
  end
85
87
  end
86
88
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: palimpsest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Boyd Sosenko