dsu 3.0.0.beta.0 → 3.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/CHANGELOG.md +1 -0
  4. data/Gemfile +5 -5
  5. data/Gemfile.lock +4 -1
  6. data/lib/dsu/migration/base_service.rb +118 -0
  7. data/lib/dsu/migration/migrator.rb +24 -0
  8. data/lib/dsu/migration/raw_helpers/color_theme_hash.rb +13 -0
  9. data/lib/dsu/migration/raw_helpers/configuration_hash.rb +15 -0
  10. data/lib/dsu/migration/raw_helpers/entry_group_hash.rb +13 -0
  11. data/lib/dsu/migration/raw_json_file.rb +15 -0
  12. data/lib/dsu/migration/raw_json_files.rb +56 -0
  13. data/lib/dsu/migration/v20230613121411/service.rb +94 -0
  14. data/lib/dsu/migration/v20240210161248/service.rb +148 -0
  15. data/lib/dsu/models/color_theme.rb +2 -0
  16. data/lib/dsu/models/project.rb +2 -2
  17. data/lib/dsu/support/fileable.rb +11 -7
  18. data/lib/dsu/version.rb +1 -1
  19. data/lib/dsu/views/project/list.rb +4 -4
  20. data/lib/dsu.rb +8 -15
  21. data/lib/locales/en/miscellaneous.yml +1 -2
  22. data/lib/locales/en/subcommands.yml +5 -5
  23. data/lib/seed_data/20230613121411/dsu/migration_version.json +3 -0
  24. data/lib/seed_data/20240210161248/dsu/current_project.json +4 -0
  25. data/lib/seed_data/20240210161248/dsu/migration_version.json +3 -0
  26. data/lib/seed_data/20240210161248/dsu/projects/default/project.json +5 -0
  27. data/lib/seed_data/20240210161248/dsu/themes/cherry.json +79 -0
  28. data/lib/seed_data/20240210161248/dsu/themes/christmas.json +79 -0
  29. data/lib/seed_data/20240210161248/dsu/themes/default.json +79 -0
  30. data/lib/seed_data/20240210161248/dsu/themes/lemon.json +79 -0
  31. data/lib/seed_data/20240210161248/dsu/themes/light.json +79 -0
  32. data/lib/seed_data/20240210161248/dsu/themes/matrix.json +79 -0
  33. data/lib/seed_data/20240210161248/dsu/themes/whiteout.json +79 -0
  34. metadata +31 -12
  35. data/lib/dsu/migration/factory.rb +0 -26
  36. data/lib/dsu/migration/service.rb +0 -196
  37. data/lib/dsu/migration/service_20240210161248.rb +0 -172
  38. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/cherry.json +0 -0
  39. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/christmas.json +0 -0
  40. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/default.json +0 -0
  41. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/lemon.json +0 -0
  42. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/light.json +0 -0
  43. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/matrix.json +0 -0
  44. /data/lib/seed_data/{themes → 20230613121411/dsu/themes}/whiteout.json +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 480ee218003cde2deef47853915e5a59a396ca0ea62d65b243e2c789fdffaeb1
4
- data.tar.gz: 34fcb64b9dfcedf87a3b3ffdd49e6504e4a1662952d027dc9855e7c2e4a17b72
3
+ metadata.gz: a4e9cb8f6a8eb3af6363f9d7fc277e72082db6964dcdecd07a40b5c499ebc438
4
+ data.tar.gz: b85536f382ed639c5cecd06a16d148c378ca742f5156be1ad18cc16f4a5116dc
5
5
  SHA512:
6
- metadata.gz: 40b201d06c9f7271bf3c5c4f962901682c54ec7509dee80156dfed39aa613bf928caa020d24416c0e600504b223e0f1146f7e44a1049711660d639d2524711d5
7
- data.tar.gz: 56a459e90ea910802709e1893bbd7e8cccb33e9e110f3b5fae7dc118fd393a9873b5953e19ea1d415dd71d42505a31b92e7011b4ed00c44bdfb4ffebd00ac3d1
6
+ metadata.gz: a91851e7a145ba77b00959e8207a9334f4f7ea798dab4374ea339a61168c3363118b31ebaa6ad919358f957c0947ffece2ac445eb3f3cf512af4a23826910a5d
7
+ data.tar.gz: 5cf55b4b71387efee97919933553c050f4ac5ddf7746f800e63ebb8f8e2d09808778cc949d2725bc1f6ce80eae2bf991aa211ed845ed5c601c675d3be3a51e8d
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  require:
2
2
  - rubocop-performance
3
3
  - rubocop-rspec
4
+ - rubocop-factory_bot
5
+ - rubocop-rake
4
6
 
5
7
  AllCops:
6
8
  TargetRubyVersion: 3.0.1
data/CHANGELOG.md CHANGED
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
10
10
 
11
11
  ### Changes
12
12
  [x] Update ruby gems.
13
+ [x] `dsu import` now has the --override true|false (default: false) OPTION. If true, the import process will ignore the project name found in the import file and import the entries into the current project. If false, the import process will use the project name found in the import file.
13
14
  [x] Change `dsu export` file name for exports. When exporting all DSU entry groups for a project, the file name will be:
14
15
 
15
16
  "dsu-export-<transformed project name>-<timestamp>-all-entry-groups-<from date>-thru-<to date>.csv"
data/Gemfile CHANGED
@@ -6,14 +6,14 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  gem 'dotenv', '~> 2.8', '>= 2.8.1'
9
+ gem 'factory_bot', '~> 6.3'
10
+ gem 'ffaker', '~> 2.21'
11
+ gem 'pry-byebug', '~> 3.9'
9
12
  gem 'rake', '~> 13.0'
13
+ gem 'reek', '~> 6.1', '>= 6.1.1'
10
14
  gem 'rspec', '~> 3.0'
11
15
  gem 'rubocop', '~> 1.50', '>= 1.50.2'
12
16
  gem 'rubocop-performance', '~> 1.19'
17
+ gem 'rubocop-rake', '~> 0.6.0'
13
18
  gem 'rubocop-rspec', '~> 2.23'
14
-
15
- gem 'factory_bot', '~> 6.3'
16
- gem 'ffaker', '~> 2.21'
17
- gem 'pry-byebug', '~> 3.9'
18
- gem 'reek', '~> 6.1', '>= 6.1.1'
19
19
  gem 'simplecov', '~> 0.22.0'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dsu (3.0.0.alpha.13)
4
+ dsu (3.0.0.rc.1)
5
5
  activemodel (>= 7.0.8, < 8.0)
6
6
  activesupport (>= 7.0.8, < 8.0)
7
7
  colorize (>= 1.1, < 2.0)
@@ -128,6 +128,8 @@ GEM
128
128
  rubocop-performance (1.20.2)
129
129
  rubocop (>= 1.48.1, < 2.0)
130
130
  rubocop-ast (>= 1.30.0, < 2.0)
131
+ rubocop-rake (0.6.0)
132
+ rubocop (~> 1.0)
131
133
  rubocop-rspec (2.26.1)
132
134
  rubocop (~> 1.40)
133
135
  rubocop-capybara (~> 2.17)
@@ -163,6 +165,7 @@ DEPENDENCIES
163
165
  rspec (~> 3.0)
164
166
  rubocop (~> 1.50, >= 1.50.2)
165
167
  rubocop-performance (~> 1.19)
168
+ rubocop-rake (~> 0.6.0)
166
169
  rubocop-rspec (~> 2.23)
167
170
  simplecov (~> 0.22.0)
168
171
 
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../models/migration_version'
4
+ require_relative '../support/fileable'
5
+ require_relative 'version'
6
+
7
+ module Dsu
8
+ module Migration
9
+ class BaseService
10
+ include Support::Fileable
11
+
12
+ def initialize(options: {})
13
+ @options = options || {}
14
+ end
15
+
16
+ class << self
17
+ def migrates_to_latest_migration_version?
18
+ to_migration_version == Migration::VERSION
19
+ end
20
+
21
+ # The migration version that this migration is upgrading from.
22
+ def from_migration_version
23
+ raise NotImplementedError, 'You must implement the #from_migration_version method in your subclass'
24
+ end
25
+
26
+ # The migration version that this migration is upgrading to.
27
+ def to_migration_version
28
+ raise NotImplementedError, 'You must implement the #to_migration_version method in your subclass'
29
+ end
30
+ end
31
+
32
+ def migrate_if!
33
+ return unless run_migration?
34
+
35
+ puts "Running migrations #{from_migration_version} -> #{to_migration_version}..."
36
+ puts "\tpretend?: #{pretend?}" if pretend?
37
+
38
+ run_migration!
39
+ update_migration_version!
40
+
41
+ puts "\tMigration #{from_migration_version} -> #{to_migration_version} complete."
42
+ end
43
+
44
+ private
45
+
46
+ attr_accessor :options
47
+
48
+ # You must implement your own migration logic in your subclass and call this method.
49
+ def run_migration!
50
+ create_backup
51
+ end
52
+
53
+ def pretend?
54
+ options.fetch(:pretend, true)
55
+ end
56
+
57
+ def run_migration?
58
+ migration_version == from_migration_version
59
+ end
60
+
61
+ # The migration version that this migration is upgrading from.
62
+ def from_migration_version
63
+ self.class.from_migration_version
64
+ end
65
+
66
+ # The migration version that this migration is upgrading to.
67
+ def to_migration_version
68
+ self.class.to_migration_version
69
+ end
70
+
71
+ # The migration version before running this migration.
72
+ def migration_version
73
+ # Typically we should not be using models in any of the migration services
74
+ # because if these change, the migrations will break. However, using
75
+ # the MigrationVersion model is an exception because it is a very simple
76
+ # model and is unlikely to change.
77
+ Models::MigrationVersion.new.version
78
+ end
79
+
80
+ def create_backup
81
+ puts "Creating backup #{backup_folder}..."
82
+
83
+ return puts "\tSkipping: backup already exists." if backup_exist?
84
+
85
+ FileUtils.cp_r(dsu_folder, backup_folder)
86
+ FileUtils.cp(config_path, backup_folder)
87
+ end
88
+
89
+ def backup_exist?
90
+ Dir.exist?(backup_folder)
91
+ end
92
+
93
+ def backup_folder
94
+ @backup_folder ||= backup_folder_for(migration_version: from_migration_version)
95
+ end
96
+
97
+ def update_migration_version!
98
+ puts 'Updating migration version...'
99
+
100
+ return if pretend? || migration_version == to_migration_version
101
+
102
+ Models::MigrationVersion.new(version: to_migration_version).save!
103
+ end
104
+
105
+ def seed_data_folder
106
+ seed_data_dsu_folder_for(migration_version: to_migration_version)
107
+ end
108
+
109
+ def seed_data_configuration
110
+ seed_data_dsu_configuration_for(migration_version: to_migration_version)
111
+ end
112
+
113
+ def raise_backup_folder_does_not_exist_error_if!
114
+ raise "Backup folder #{backup_folder} does not exist, cannot continue" unless backup_exist?
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../env'
4
+ require_relative 'version'
5
+
6
+ module Dsu
7
+ module Migration
8
+ class Migrator
9
+ class << self
10
+ def migrate_if!(migration_services: [])
11
+ return if migration_services.any? do |migration_service|
12
+ migration_service.migrate_if!
13
+ migration_service.class.migrates_to_latest_migration_version?
14
+ end
15
+
16
+ raise I18n.t('migrations.error.missing_current_migration_service', migration_version: Migration::VERSION)
17
+ rescue StandardError => e
18
+ puts I18n.t('migrations.error.failed', message: e.message)
19
+ exit 1 unless Dsu.env.test?
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dsu
4
+ module Migration
5
+ module RawHelpers
6
+ module ColorThemeHash
7
+ def to_h
8
+ read.merge(version: version)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dsu
4
+ module Migration
5
+ module RawHelpers
6
+ module ConfigurationHash
7
+ attr_accessor :default_project
8
+
9
+ def to_h
10
+ read.merge(version: version, default_project: default_project)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dsu
4
+ module Migration
5
+ module RawHelpers
6
+ module EntryGroupHash
7
+ def to_h
8
+ read.merge(version: version)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../crud/json_file'
4
+
5
+ module Dsu
6
+ module Migration
7
+ class RawJsonFile < Crud::JsonFile
8
+ public :read, :read!, :version=
9
+
10
+ def to_h
11
+ read.merge(version: version)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require 'pathname'
5
+
6
+ require_relative 'raw_json_file'
7
+
8
+ module Dsu
9
+ module Migration
10
+ class RawJsonFiles
11
+ attr_reader :folder
12
+
13
+ def initialize(folder)
14
+ @folder = folder
15
+ end
16
+
17
+ def each_file(regex: //)
18
+ return unless folder_exist?
19
+
20
+ Pathname.new(folder).children.each do |child|
21
+ next unless child.file? && child.to_s.match?(regex)
22
+
23
+ yield RawJsonFile.new(child)
24
+ end
25
+ end
26
+
27
+ def folder_exist?
28
+ self.class.folder_exist?(folder: folder)
29
+ end
30
+
31
+ class << self
32
+ def folder_exist?(folder:)
33
+ Dir.exist?(folder)
34
+ end
35
+ end
36
+
37
+ private
38
+
39
+ attr_writer :folder
40
+
41
+ def safe_cp_r(source, destination)
42
+ Pathname.new(source).find do |source_path|
43
+ next if source_path.directory?
44
+
45
+ relative_path = source_path.relative_path_from(Pathname.new(source))
46
+ target_path = Pathname.new(destination).join(relative_path)
47
+
48
+ next if target_path.exist?
49
+
50
+ FileUtils.mkdir_p(target_path.dirname)
51
+ FileUtils.cp(source_path, target_path)
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../base_service'
4
+ require_relative '../raw_helpers/entry_group_hash'
5
+ require_relative '../version'
6
+
7
+ module Dsu
8
+ module Migration
9
+ module V20230613121411
10
+ class Service < BaseService
11
+ class << self
12
+ def from_migration_version
13
+ 0
14
+ end
15
+
16
+ def to_migration_version
17
+ 20230613121411 # rubocop:disable Style/NumericLiterals
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def run_migration!
24
+ super
25
+
26
+ raise_backup_folder_does_not_exist_error_if!
27
+
28
+ delete_old_config_file
29
+ delete_old_themes_folder
30
+
31
+ copy_new_dsu_folders
32
+ copy_new_dsu_configuration
33
+ migrate_entry_groups
34
+ end
35
+
36
+ def config_file_from
37
+ File.join(root_folder, '.dsu')
38
+ end
39
+
40
+ def dsu_folder_from
41
+ File.join(root_folder, 'dsu')
42
+ end
43
+
44
+ def entries_folder_from
45
+ File.join(dsu_folder_from, 'entries')
46
+ end
47
+
48
+ def themes_folder_from
49
+ File.join(dsu_folder_from, 'themes')
50
+ end
51
+
52
+ def copy_new_dsu_folders
53
+ puts 'Copying new dsu folders...'
54
+
55
+ FileUtils.cp_r(File.join(seed_data_folder, '.'), File.join(root_folder, 'dsu')) unless pretend?
56
+ end
57
+
58
+ def copy_new_dsu_configuration
59
+ puts 'Copying new dsu configuration...'
60
+
61
+ FileUtils.cp(seed_data_configuration, config_folder) unless pretend?
62
+ end
63
+
64
+ def migrate_entry_groups
65
+ puts 'Migrating entry groups...'
66
+
67
+ return if pretend?
68
+
69
+ puts "\tUpdating entry group version..."
70
+
71
+ RawJsonFiles.new(entries_folder_from).each_file(regex: /\d{4}-\d{2}-\d{2}.json/) do |raw_entry_group|
72
+ raw_entry_group.extend(RawHelpers::EntryGroupHash)
73
+ raw_entry_group.version = to_migration_version
74
+ raw_entry_group.save!
75
+ end
76
+ end
77
+
78
+ def delete_old_config_file
79
+ puts 'Deleting old configuration file...'
80
+
81
+ return if pretend?
82
+
83
+ File.delete(config_file_from) if File.file?(config_file_from)
84
+ end
85
+
86
+ def delete_old_themes_folder
87
+ puts 'Deleting old themes folder...'
88
+
89
+ FileUtils.rm_rf(themes_folder_from) unless pretend?
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../base_service'
4
+ require_relative '../raw_helpers/color_theme_hash'
5
+ require_relative '../raw_helpers/configuration_hash'
6
+ require_relative '../raw_helpers/entry_group_hash'
7
+ require_relative '../raw_json_file'
8
+ require_relative '../version'
9
+
10
+ module Dsu
11
+ module Migration
12
+ module V20240210161248
13
+ class Service < BaseService
14
+ class << self
15
+ def from_migration_version
16
+ 20230613121411 # rubocop:disable Style/NumericLiterals
17
+ end
18
+
19
+ def to_migration_version
20
+ 20240210161248 # rubocop:disable Style/NumericLiterals
21
+ end
22
+ end
23
+
24
+ private
25
+
26
+ def run_migration!
27
+ super
28
+
29
+ raise_backup_folder_does_not_exist_error_if!
30
+
31
+ add_new_color_themes
32
+ create_default_project
33
+ create_current_project_file
34
+ update_configuration
35
+ update_entry_groups
36
+ update_color_themes
37
+ delete_old_entry_folder
38
+
39
+ puts 'Migration completed successfully.'
40
+ end
41
+
42
+ def dsu_folder_from
43
+ File.join(root_folder, 'dsu')
44
+ end
45
+
46
+ def entries_folder_from
47
+ File.join(dsu_folder_from, 'entries')
48
+ end
49
+
50
+ def themes_folder_from
51
+ File.join(dsu_folder_from, 'themes')
52
+ end
53
+
54
+ def add_new_color_themes
55
+ puts 'Copying new color themes...'
56
+
57
+ FileUtils.mkdir_p(themes_folder_from) unless pretend?
58
+
59
+ %w[light.json christmas.json].each do |theme_file|
60
+ destination_theme_file_path = File.join(themes_folder_from, theme_file)
61
+ # Don't skip these theme files because they were deployed in the previous
62
+ # dsu version with bugs. We need to overwrite them with this new version.
63
+ # next if File.exist?(destination_theme_file_path)
64
+
65
+ source_theme_file_path = File.join(seed_data_folder, 'themes', theme_file)
66
+ FileUtils.cp(source_theme_file_path, destination_theme_file_path) unless pretend?
67
+ end
68
+ end
69
+
70
+ def create_default_project
71
+ puts "Creating default project \"#{default_project_name}\"..."
72
+
73
+ return if pretend?
74
+
75
+ FileUtils.cp_r(File.join(seed_data_folder, 'projects', '.'),
76
+ File.join(dsu_folder, 'projects'))
77
+ end
78
+
79
+ def create_current_project_file
80
+ puts 'Creating current project file...'
81
+
82
+ return if pretend?
83
+
84
+ # NOTE: dsu_folder won't change and is safe to use here.
85
+ FileUtils.cp(File.join(seed_data_folder, 'current_project.json'), dsu_folder)
86
+ end
87
+
88
+ def update_configuration
89
+ puts 'Updating configuration...'
90
+
91
+ return if pretend?
92
+
93
+ # NOTE: config_path won't change and is safe to use here.
94
+ RawJsonFile.new(config_path).tap do |configuration_file|
95
+ configuration_file.extend(RawHelpers::ConfigurationHash)
96
+ configuration_file.version = to_migration_version
97
+ configuration_file.default_project = default_project_name
98
+ end.save!
99
+ end
100
+
101
+ def update_entry_groups
102
+ puts 'Updating entry groups...'
103
+
104
+ return if pretend?
105
+
106
+ puts "\tCopying entries to default project \"#{default_project_name}\"..."
107
+
108
+ entries_folder_to = File.join(dsu_folder, 'projects', default_project_name, 'entries')
109
+ FileUtils.cp_r(File.join(entries_folder_from, '.'), entries_folder_to)
110
+
111
+ puts "\tUpdating entry group version..."
112
+
113
+ RawJsonFiles.new(entries_folder_to).each_file(regex: /\d{4}-\d{2}-\d{2}.json/) do |raw_entry_group|
114
+ raw_entry_group.extend(RawHelpers::EntryGroupHash)
115
+ raw_entry_group.version = to_migration_version
116
+ raw_entry_group.save!
117
+ end
118
+ end
119
+
120
+ def update_color_themes
121
+ puts 'Updating color themes...'
122
+
123
+ FileUtils.cp_r(File.join(backup_folder, 'themes', '.'), themes_folder) unless pretend?
124
+
125
+ puts "\tUpdating color theme version..."
126
+
127
+ themes_folder_to = File.join(dsu_folder, 'themes')
128
+
129
+ RawJsonFiles.new(themes_folder_to).each_file(regex: /.+.json/) do |raw_entry_group|
130
+ raw_entry_group.extend(RawHelpers::ColorThemeHash)
131
+ raw_entry_group.version = to_migration_version
132
+ raw_entry_group.save! unless pretend?
133
+ end
134
+ end
135
+
136
+ def delete_old_entry_folder
137
+ puts 'Cleaning up old entries...'
138
+
139
+ FileUtils.rm_rf(File.join(entries_folder_from)) unless pretend?
140
+ end
141
+
142
+ def default_project_name
143
+ 'default'
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
@@ -20,6 +20,8 @@ module Dsu
20
20
  include Support::Fileable
21
21
  include Support::Presentable
22
22
 
23
+ THEME_FILE_NAME_REGEX = /.+.json/
24
+
23
25
  VERSION = Migration::VERSION
24
26
 
25
27
  DEFAULT_THEME_NAME = 'default'
@@ -25,9 +25,9 @@ module Dsu
25
25
 
26
26
  VERSION = Migration::VERSION
27
27
  MIN_PROJECT_NAME_LENGTH = 2
28
- MAX_PROJECT_NAME_LENGTH = 24
28
+ MAX_PROJECT_NAME_LENGTH = 32
29
29
  MIN_DESCRIPTION_LENGTH = 2
30
- MAX_DESCRIPTION_LENGTH = 32
30
+ MAX_DESCRIPTION_LENGTH = 64
31
31
 
32
32
  attr_reader :project_name, :current_project_file, :description, :version, :options
33
33
 
@@ -77,16 +77,14 @@ module Dsu
77
77
  Gem.loaded_specs['dsu'].gem_dir
78
78
  end
79
79
 
80
- # Back up folder
80
+ # Seed data files and folders
81
81
 
82
- def backup_folder(version:)
83
- File.join(dsu_folder, 'backup', version.to_s)
82
+ def seed_data_dsu_folder_for(migration_version:)
83
+ File.join(gem_dir, 'lib/seed_data', migration_version.to_s, 'dsu')
84
84
  end
85
85
 
86
- # Seed data folders
87
-
88
- def seed_data_folder
89
- File.join(gem_dir, 'lib/seed_data')
86
+ def seed_data_dsu_configuration_for(migration_version:)
87
+ File.join(gem_dir, 'lib/seed_data', migration_version.to_s, '.dsu')
90
88
  end
91
89
 
92
90
  # Projects
@@ -126,6 +124,12 @@ module Dsu
126
124
  end
127
125
  alias project_file project_file_for
128
126
 
127
+ # Backup folders
128
+
129
+ def backup_folder_for(migration_version:)
130
+ File.join(root_folder, "dsu-#{migration_version}-backup")
131
+ end
132
+
129
133
  extend self # rubocop:disable Style/ModuleFunction
130
134
  end
131
135
  end
data/lib/dsu/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Dsu
4
4
  VERSION_REGEX = /\A\d+\.\d+\.\d+(\.(alpha|beta|rc)\.\d+)?\z/
5
- VERSION = '3.0.0.beta.0'
5
+ VERSION = '3.0.0.beta.1'
6
6
  end
@@ -8,10 +8,10 @@ module Dsu
8
8
  # TODO: I18n.
9
9
  class List < Views::BaseListView
10
10
  NO_JUSTIFICATION = 4
11
- PROJECT_JUSTIFICATION = 15
12
- DEFAULT_JUSTIFICATION = 10
13
- CURRENT_JUSTIFICATION = 10
14
- DESCRIPTION_JUSTIFICATION = 10
11
+ PROJECT_JUSTIFICATION = 15 + 10
12
+ DEFAULT_JUSTIFICATION = 10 + 10
13
+ CURRENT_JUSTIFICATION = 10 + 10
14
+ DESCRIPTION_JUSTIFICATION = 10 + 10
15
15
 
16
16
  DETAIL_HEADER_STRING = "#{'No.'.ljust(NO_JUSTIFICATION)} " \
17
17
  "#{'Project'.ljust(PROJECT_JUSTIFICATION)} " \