vara 0.24.0 → 0.25.0

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: 6062ac7eb0c62fbf59ffcea1c7a7dc7c28baf43f
4
- data.tar.gz: 771892cd70935c222f723a939179bcae9dc8ae36
3
+ metadata.gz: 048bcb5c18a386f8a281e5cff832af8bce9f33d9
4
+ data.tar.gz: dba1aaf136f21de5a1625ea11b0f804d27690923
5
5
  SHA512:
6
- metadata.gz: 8af4f042898f482b82ccf76450960580ce935fbb59ce390e39ccbdef72f6e9c71c02098525fdeaa8b867ea645f48e3094f09b608e0fa7bc336976bbfe180cf54
7
- data.tar.gz: 925200d0dd86e9164a6876b9ed950edc0df687cf375857e08a78c660e49887fbfc6dd8840b9e0c6070fc04cc6c54770389a72c34785ea25d267296896e2132f9
6
+ metadata.gz: 9107c0807aa065ffac5c5ab9eb175faf281dcd8351c68ddabee5f94ec075f0725e11f2b923eae1d7b9b6fe58ff841a8ee218b3c25a0d04e44a38ab2a7f42391d
7
+ data.tar.gz: c6af9856fac513b15a57aa1f4e20f078640c799ac33c180aedc0f133ea2ca93eb720f77f9db571768515073095fcf153db600f4c586f02acf26a789777170b26
@@ -87,12 +87,18 @@ module Vara
87
87
 
88
88
  desc 'update-product-version PIVOTAL_FILE_PATH VERSION', 'Update the version of a pivotal file'
89
89
  def update_product_version(pivotal_file_path, version)
90
+ require 'vara/content_migrations_processor'
90
91
  require 'vara/product'
92
+ require 'vara/static_versioner'
91
93
  pivotal_file_path = File.expand_path(pivotal_file_path)
92
94
  Dir.mktmpdir do |temp_dir|
93
95
  FileUtils.cd(temp_dir) do
94
96
  `unzip #{pivotal_file_path} -d .`
95
97
  output_dir = File.dirname(pivotal_file_path)
98
+
99
+ versioner = Vara::StaticVersioner.new(temp_dir, version)
100
+ Vara::ContentMigrationsProcessor.new(temp_dir, versioner).update_product_version_migrations
101
+
96
102
  product = Vara::Product.new(temp_dir)
97
103
  product.update_product_version(version)
98
104
  product.build
@@ -22,6 +22,12 @@ module Vara
22
22
  save_content_migrations(processed)
23
23
  end
24
24
 
25
+ def update_product_version_migrations
26
+ migrations = YAML.load_file(migrations_file_path)
27
+ versioner.update_content_migrations(migrations)
28
+ save_content_migrations(migrations)
29
+ end
30
+
25
31
  private
26
32
 
27
33
  attr_reader :product_dir, :versioner
@@ -45,7 +51,7 @@ module Vara
45
51
  end
46
52
 
47
53
  def save_content_migrations(processed_hash)
48
- out_path = File.join(product_dir, 'content_migrations', 'migrations.yml')
54
+ out_path = migrations_file_path
49
55
 
50
56
  File.open(out_path, 'w') do |out|
51
57
  YAML.dump(processed_hash, out)
@@ -53,6 +59,10 @@ module Vara
53
59
 
54
60
  out_path
55
61
  end
62
+
63
+ def migrations_file_path
64
+ File.join(product_dir, 'content_migrations', 'migrations.yml')
65
+ end
56
66
  end
57
67
  end
58
68
 
@@ -1,5 +1,5 @@
1
1
  module Vara
2
- VERSION = '0.24.0'.freeze
2
+ VERSION = '0.25.0'.freeze
3
3
  end
4
4
 
5
5
  # Copyright (c) 2014-2015 Pivotal Software, Inc.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CF Release Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-27 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor