dsu 3.0.0.beta.0 → 3.0.0.beta.2

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.
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
data/lib/dsu.rb CHANGED
@@ -20,21 +20,14 @@ Hash.include(ColorThemeMode)
20
20
  require_relative 'dsu/env'
21
21
  require 'pry-byebug' if Dsu.env.development?
22
22
 
23
- Dir.glob("#{__dir__}/dsu/**/*.rb").each do |file|
24
- require file
25
- end
23
+ Dir.glob("#{__dir__}/dsu/**/*.rb").each { |file| require file }
26
24
 
27
25
  unless Dsu.env.test? || Dsu.env.development?
28
- # TODO: This is upgrading from migrations version 0 to 20230613121411
29
- # Move this to to its own class and call from Migration::Factory.
30
- if Dsu::Migration::Service.run_migrations?
31
- begin
32
- Dsu::Migration::Service.new.call
33
- rescue StandardError => e
34
- puts I18n.t('migrations.error.failed', message: e.message)
35
- exit 1
36
- end
37
- end
38
-
39
- Dsu::Migration::Factory.migrate_if!(options: { pretend: false })
26
+ # NOTE: Add a new migration service to the array whenever a new migration is created.
27
+ options = { pretend: false }
28
+ migration_services = [
29
+ Dsu::Migration::V20230613121411::Service.new(options: options),
30
+ Dsu::Migration::V20240210161248::Service.new(options: options)
31
+ ]
32
+ Dsu::Migration::Migrator.migrate_if!(migration_services: migration_services)
40
33
  end
@@ -25,6 +25,5 @@ en:
25
25
  try_again: "Please try again. Valid options are [%{options}]."
26
26
  migrations:
27
27
  error:
28
+ missing_current_migration_service: "No migration service handles the current migration: %{migration_version}."
28
29
  failed: "Error running migrations: %{message}"
29
- information:
30
- theme_copied: Theme copied from %{from} to %{to}.
@@ -511,11 +511,11 @@ en:
511
511
 
512
512
  PROJECT_NAME
513
513
 
514
- The name of the project to create. PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
514
+ The name of the project to create. PROJECT_NAME must be between 2 and 32 characters (inclusive) in length.
515
515
 
516
516
  PROJECT_DESCRIPTION
517
517
 
518
- Optional. The description of the project. PROJECT_DESCRIPTION must be between 2 and 32 characters (inclusive) in length. If PROJECT_DESCRIPTION is not provided, the project description will be "<PROJECT_NAME> project" where <PROJECT_NAME> = the name of the project.
518
+ Optional. The description of the project. PROJECT_DESCRIPTION must be between 2 and 64 characters (inclusive) in length. If PROJECT_DESCRIPTION is not provided, the project description will be "<PROJECT_NAME> project" where <PROJECT_NAME> = the name of the project.
519
519
 
520
520
  EXAMPLES
521
521
 
@@ -610,7 +610,7 @@ en:
610
610
 
611
611
  PROJECT_NAME
612
612
 
613
- The name of the project to create. PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
613
+ The name of the project to create. PROJECT_NAME must be between 2 and 32 characters (inclusive) in length.
614
614
 
615
615
  PROJECT_NUMBER
616
616
 
@@ -618,11 +618,11 @@ en:
618
618
 
619
619
  NEW_PROJECT_NAME
620
620
 
621
- The new name of the project. NEW_PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
621
+ The new name of the project. NEW_PROJECT_NAME must be between 2 and 32 characters (inclusive) in length.
622
622
 
623
623
  NEW_PROJECT_DESCRIPTION
624
624
 
625
- Optional. The description of the project. NEW_PROJECT_DESCRIPTION must be between 2 and 32 characters (inclusive) in length. If NEW_PROJECT_DESCRIPTION is not provided, the project description will be "<NEW_PROJECT_NAME> project" where <NEW_PROJECT_NAME> = the name of the project.
625
+ Optional. The description of the project. NEW_PROJECT_DESCRIPTION must be between 2 and 64 characters (inclusive) in length. If NEW_PROJECT_DESCRIPTION is not provided, the project description will be "<NEW_PROJECT_NAME> project" where <NEW_PROJECT_NAME> = the name of the project.
626
626
 
627
627
  EXAMPLES
628
628
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": 20230613121411
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "project_name": "default"
4
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": 20240210161248
3
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "project_name": "default",
4
+ "description": "default project"
5
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Cherry color theme",
4
+ "help": {
5
+ "color": "red",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "red"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "red",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "red",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "red",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "red",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "light_red",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "red",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "light_red",
46
+ "mode": "italic",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "red",
51
+ "mode": "default",
52
+ "background": "default"
53
+ },
54
+ "success": {
55
+ "color": "red",
56
+ "mode": "default",
57
+ "background": "default"
58
+ },
59
+ "warning": {
60
+ "color": "yellow",
61
+ "mode": "default",
62
+ "background": "default"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "red",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "white",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Christmas theme ho ho ho!",
4
+ "help": {
5
+ "color": "red",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "red"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "red",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "light_green",
21
+ "mode": "bold",
22
+ "background": "red"
23
+ },
24
+ "subheader": {
25
+ "color": "red",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "red",
31
+ "mode": "italic",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "red",
36
+ "mode": "italic",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "white",
41
+ "mode": "bold",
42
+ "background": "green"
43
+ },
44
+ "index": {
45
+ "color": "white",
46
+ "mode": "bold",
47
+ "background": "red"
48
+ },
49
+ "info": {
50
+ "color": "white",
51
+ "mode": "bold",
52
+ "background": "light_red"
53
+ },
54
+ "success": {
55
+ "color": "white",
56
+ "mode": "bold",
57
+ "background": "green"
58
+ },
59
+ "warning": {
60
+ "color": "default",
61
+ "mode": "bold",
62
+ "background": "yellow"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "white",
71
+ "mode": "bold",
72
+ "background": "green"
73
+ },
74
+ "prompt_options": {
75
+ "color": "red",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Default color theme",
4
+ "help": {
5
+ "color": "cyan",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "cyan"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "cyan",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "cyan",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "cyan",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "cyan",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "light_cyan",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "cyan",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "light_cyan",
46
+ "mode": "default",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "cyan",
51
+ "mode": "default",
52
+ "background": "default"
53
+ },
54
+ "success": {
55
+ "color": "green",
56
+ "mode": "default",
57
+ "background": "default"
58
+ },
59
+ "warning": {
60
+ "color": "yellow",
61
+ "mode": "default",
62
+ "background": "default"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "cyan",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "white",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Lemon color theme",
4
+ "help": {
5
+ "color": "yellow",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "yellow"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "yellow",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "yellow",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "yellow",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "yellow",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "light_yellow",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "yellow",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "light_yellow",
46
+ "mode": "default",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "yellow",
51
+ "mode": "default",
52
+ "background": "default"
53
+ },
54
+ "success": {
55
+ "color": "green",
56
+ "mode": "default",
57
+ "background": "default"
58
+ },
59
+ "warning": {
60
+ "color": "yellow",
61
+ "mode": "default",
62
+ "background": "default"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "yellow",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "white",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Theme for Light backgrounds",
4
+ "help": {
5
+ "color": "default",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "black"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "default",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "default",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "default",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "default",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "default",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "default",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "default",
46
+ "mode": "italic",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "white",
51
+ "mode": "bold",
52
+ "background": "blue"
53
+ },
54
+ "success": {
55
+ "color": "white",
56
+ "mode": "bold",
57
+ "background": "green"
58
+ },
59
+ "warning": {
60
+ "color": "default",
61
+ "mode": "bold",
62
+ "background": "yellow"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "default",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "default",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Matrix color theme",
4
+ "help": {
5
+ "color": "green",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "green"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "green",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "green",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "green",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "green",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "light_green",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "green",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "light_green",
46
+ "mode": "default",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "green",
51
+ "mode": "default",
52
+ "background": "default"
53
+ },
54
+ "success": {
55
+ "color": "green",
56
+ "mode": "default",
57
+ "background": "default"
58
+ },
59
+ "warning": {
60
+ "color": "yellow",
61
+ "mode": "default",
62
+ "background": "default"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "green",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "white",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "version": 20240210161248,
3
+ "description": "Whiteout color theme",
4
+ "help": {
5
+ "color": "white",
6
+ "mode": "default",
7
+ "background": "default"
8
+ },
9
+ "dsu_header": {
10
+ "color": "white",
11
+ "mode": "bold",
12
+ "background": "white"
13
+ },
14
+ "dsu_footer": {
15
+ "color": "white",
16
+ "mode": "default",
17
+ "background": "default"
18
+ },
19
+ "header": {
20
+ "color": "white",
21
+ "mode": "bold",
22
+ "background": "default"
23
+ },
24
+ "subheader": {
25
+ "color": "white",
26
+ "mode": "underline",
27
+ "background": "default"
28
+ },
29
+ "body": {
30
+ "color": "white",
31
+ "mode": "default",
32
+ "background": "default"
33
+ },
34
+ "footer": {
35
+ "color": "light_white",
36
+ "mode": "default",
37
+ "background": "default"
38
+ },
39
+ "date": {
40
+ "color": "white",
41
+ "mode": "bold",
42
+ "background": "default"
43
+ },
44
+ "index": {
45
+ "color": "light_white",
46
+ "mode": "default",
47
+ "background": "default"
48
+ },
49
+ "info": {
50
+ "color": "white",
51
+ "mode": "default",
52
+ "background": "default"
53
+ },
54
+ "success": {
55
+ "color": "green",
56
+ "mode": "default",
57
+ "background": "default"
58
+ },
59
+ "warning": {
60
+ "color": "yellow",
61
+ "mode": "default",
62
+ "background": "default"
63
+ },
64
+ "error": {
65
+ "color": "light_yellow",
66
+ "mode": "default",
67
+ "background": "red"
68
+ },
69
+ "prompt": {
70
+ "color": "white",
71
+ "mode": "bold",
72
+ "background": "default"
73
+ },
74
+ "prompt_options": {
75
+ "color": "white",
76
+ "mode": "bold",
77
+ "background": "default"
78
+ }
79
+ }