travis_bundle_cache 0.0.5 → 0.0.6

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: 9823ea826bf7435fac84b37130e2bf5a2f4d918e
4
- data.tar.gz: 0d3d8c0ac9d1993a046ae5121da984de30f1659a
3
+ metadata.gz: 374d7e23fb21ddfe9099926e721ad8d3ed3f0f5f
4
+ data.tar.gz: 5b809278f019f2b62efac0907f51582aca08477c
5
5
  SHA512:
6
- metadata.gz: 9664aad420c15f9175d93ea2807881bb14b333dc64154dda8ad49cf6b6258bbbb5f98179ad7557fb9e468ad91bc9aa614e83e71d72da13954575d05a6da5a1bb
7
- data.tar.gz: 49539468671d40cc88ea6fa8b838614abfd73abd2c1dd5a332ea6b2dfe768a0d82f4d5601115f47e2ecd6f3fc46c91152d4221c037732875c24774cbdc04c034
6
+ metadata.gz: 7ebb827324e9a4ed1dbad4ec5f8559e7e91f4b62300dc99b8dd45d91d113699f1e494ae9605951e7e0b0a11a2948ad58abaf23cb2d387b78bd06c35d6a70748f
7
+ data.tar.gz: 21de6b95f8e58c952a6d2d700e9ed9e46f2ff6cd84c177b9418edad7468cc9188da616a191aca7426295a062784b4167683c225a1b9f7e7bfbdd871c3fb157fe
@@ -1 +1,2 @@
1
- ���EL�ّC@-�$�|�=�����L��@0Z E�Œ_I!�#�C��ub'"խ��փC�*��T(��q�vӢ�䓖�9A)���1a�Z����o�����#�uy�sQ��eR{4�B810u��Z��ds9g|S����~؉/9��Pf���l
1
+ 5|�o$��k9��$ \�X�;I{+�Ϙ#!���u�h��)X_ Etڹ ��R�ؔ,M7G��&�`R�_5�̮�B�rk��jt��.�I�%b�q�*�)t�a$�'�ѳv!��5r�|�3B0��$� ;�&��
2
+ �G��P��Ye���e�k�r��-�j��Ͻfs�D�����8AvBCF�u�O���(��������hĚ5���UhьK��vek��ih��d�g�`#�Eo���Yw 17J��=u�
data.tar.gz.sig CHANGED
Binary file
@@ -6,7 +6,7 @@ module TravisBundleCache
6
6
  def initialize
7
7
  @architecture = `uname -m`.strip
8
8
  @bundle_archive = ENV['BUNDLE_ARCHIVE'] || ENV['TRAVIS_REPO_SLUG'].gsub(/\//, '-')
9
- @file_name = "#{@bundle_archive}-#{@architecture}.tgz"
9
+ @file_name = "#{@bundle_archive}-#{@architecture}-#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}.tgz"
10
10
  @file_path = File.expand_path("~/#{@file_name}")
11
11
  @lock_file = File.join(File.expand_path(ENV["TRAVIS_BUILD_DIR"]), "Gemfile.lock")
12
12
  @digest_filename = "#{@file_name}.sha2"
@@ -1,3 +1,3 @@
1
1
  module TravisBundleCache
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -9,6 +9,7 @@ describe TravisBundleCache::Cache do
9
9
  ENV["AWS_S3_BUCKET"] = "a-bucket-name"
10
10
 
11
11
  @uname = `uname -m`.strip
12
+ @ruby_version = "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
12
13
  @cache = TravisBundleCache::Cache.new
13
14
  end
14
15
 
@@ -18,13 +19,13 @@ describe TravisBundleCache::Cache do
18
19
  end
19
20
 
20
21
  it 'tries to download an available bundle archive' do
21
- expect(@cache).to receive(:run_command).once.with(/\Acd ~ && wget -O "remote_owner-repo-#{@uname}\.tgz" "https:\/\/a-bucket-name\.s3\.amazonaws\.com\/owner-repo-#{@uname}.tgz\?AWSAccessKeyId=AN_ACCESS_KEY_ID&Expires=[0-9]+&Signature=[^"]+" && tar -xf "remote_owner-repo-#{@uname}\.tgz"\Z/)
22
+ expect(@cache).to receive(:run_command).once.with(/\Acd ~ && wget -O "remote_owner-repo-#{@uname}-#{@ruby_version}\.tgz" "https:\/\/a-bucket-name\.s3\.amazonaws\.com\/owner-repo-#{@uname}-#{@ruby_version}.tgz\?AWSAccessKeyId=AN_ACCESS_KEY_ID&Expires=[0-9]+&Signature=[^"]+" && tar -xf "remote_owner-repo-#{@uname}-#{@ruby_version}\.tgz"\Z/)
22
23
 
23
24
  @cache.install
24
25
  end
25
26
 
26
27
  it 'tries to download an available bundle archive signature' do
27
- expect(@cache).to receive(:run_command).once.with(/\Acd ~ && wget -O "remote_owner-repo-#{@uname}\.tgz.sha2" "https:\/\/a-bucket-name\.s3\.amazonaws\.com\/owner-repo-#{@uname}.tgz.sha2\?AWSAccessKeyId=AN_ACCESS_KEY_ID&Expires=[0-9]+&Signature=[^"]+"\Z/)
28
+ expect(@cache).to receive(:run_command).once.with(/\Acd ~ && wget -O "remote_owner-repo-#{@uname}-#{@ruby_version}\.tgz.sha2" "https:\/\/a-bucket-name\.s3\.amazonaws\.com\/owner-repo-#{@uname}-#{@ruby_version}.tgz.sha2\?AWSAccessKeyId=AN_ACCESS_KEY_ID&Expires=[0-9]+&Signature=[^"]+"\Z/)
28
29
 
29
30
  @cache.install
30
31
  end
@@ -57,7 +58,7 @@ describe TravisBundleCache::Cache do
57
58
 
58
59
  it 'builds a new archive if the sha has changed' do
59
60
  FileUtils.mkdir_p("~/")
60
- File.open(File.expand_path("~/remote_owner-repo-#{@uname}.tgz.sha2"), 'w') {|f| f.print "old sha hash" }
61
+ File.open(File.expand_path("~/remote_owner-repo-#{@uname}-#{@ruby_version}.tgz.sha2"), 'w') {|f| f.print "old sha hash" }
61
62
  expect(@cache).to receive(:archive_and_upload_bundle).once.with(no_args)
62
63
 
63
64
  @cache.cache_bundle
@@ -65,7 +66,7 @@ describe TravisBundleCache::Cache do
65
66
 
66
67
  it 'does not build a new archive if the sha matches' do
67
68
  FileUtils.mkdir_p("~/")
68
- File.open(File.expand_path("~/remote_owner-repo-#{@uname}.tgz.sha2"), 'w') {|f| f.print "be7b966bd555fffd27c11f2557484501ad2ed482f1b6164457433800e163ae29" }
69
+ File.open(File.expand_path("~/remote_owner-repo-#{@uname}-#{@ruby_version}.tgz.sha2"), 'w') {|f| f.print "be7b966bd555fffd27c11f2557484501ad2ed482f1b6164457433800e163ae29" }
69
70
  expect(@cache).to receive(:archive_and_upload_bundle).never
70
71
  expect(@cache).to receive(:puts).with("=> There were no changes, doing nothing")
71
72
 
@@ -106,20 +107,20 @@ describe TravisBundleCache::Cache do
106
107
  end
107
108
 
108
109
  it 'archives the current bundle directory' do
109
- expect(@cache).to receive(:run_command).with(%{cd ~ && tar -cjf "owner-repo-#{@uname}.tgz" .bundle}, exit_on_error: true)
110
+ expect(@cache).to receive(:run_command).with(%{cd ~ && tar -cjf "owner-repo-#{@uname}-#{@ruby_version}.tgz" .bundle}, exit_on_error: true)
110
111
 
111
112
  @cache.archive_and_upload_bundle
112
113
  end
113
114
 
114
115
  it 'sends the correct files to S3' do
115
116
  storage = {
116
- "owner-repo-#{@uname}.tgz" => double(AWS::S3::S3Object),
117
- "owner-repo-#{@uname}.tgz.sha2" => double(AWS::S3::S3Object)
117
+ "owner-repo-#{@uname}-#{@ruby_version}.tgz" => double(AWS::S3::S3Object),
118
+ "owner-repo-#{@uname}-#{@ruby_version}.tgz.sha2" => double(AWS::S3::S3Object)
118
119
  }
119
120
  @cache.stub(:storage).and_return(storage)
120
121
 
121
- expect(storage["owner-repo-#{@uname}.tgz"]).to receive(:write).with(Pathname.new(File.expand_path("~/owner-repo-#{@uname}.tgz")), reduced_redundancy: true)
122
- expect(storage["owner-repo-#{@uname}.tgz.sha2"]).to receive(:write).with("be7b966bd555fffd27c11f2557484501ad2ed482f1b6164457433800e163ae29", content_type: 'text/plain', reduced_redundancy: true)
122
+ expect(storage["owner-repo-#{@uname}-#{@ruby_version}.tgz"]).to receive(:write).with(Pathname.new(File.expand_path("~/owner-repo-#{@uname}-#{@ruby_version}.tgz")), reduced_redundancy: true)
123
+ expect(storage["owner-repo-#{@uname}-#{@ruby_version}.tgz.sha2"]).to receive(:write).with("be7b966bd555fffd27c11f2557484501ad2ed482f1b6164457433800e163ae29", content_type: 'text/plain', reduced_redundancy: true)
123
124
 
124
125
  @cache.archive_and_upload_bundle
125
126
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis_bundle_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Genord II
@@ -30,7 +30,7 @@ cert_chain:
30
30
  FJkL4MD3SK4X13qDUlr6YzTkvc8MMfaECuzUIM6KqSGQnyZ16D2zLdZTtr0GPzJZ
31
31
  SdQ0gsTaFvafp6C7hh//UHFI92FnVtzpV01oGPDikn3a2qc8eUPvULa2NlJRFQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2013-08-02 00:00:00.000000000 Z
33
+ date: 2013-08-16 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
metadata.gz.sig CHANGED
Binary file