diff --git a/CHANGELOG.md b/CHANGELOG.md index 58638e99..050e6308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [2.2.0.rc.2] 2023-12-23 + +Enhancements + +- Added "christmas" theme, see `dsu theme list` or `dsu theme show christmas` for more information. + +Changes + +- Refactors Dsu::VERSION_REGEX to include rc releases (e.g. 2.2.0.rc.1, 2.2.0.rc.2, etc.). + ## [2.2.0.rc.1] 2023-12-23 Enhancements diff --git a/Gemfile.lock b/Gemfile.lock index 121d31e2..5ef5f947 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dsu (2.2.0.rc.1) + dsu (2.2.0.rc.2) activemodel (>= 7.0.8, < 8.0) activesupport (>= 7.0.8, < 8.0) colorize (>= 0.8.1, < 1.0) diff --git a/dsu.gemspec b/dsu.gemspec index a16a17d3..ef1c18b5 100644 --- a/dsu.gemspec +++ b/dsu.gemspec @@ -53,6 +53,7 @@ Gem::Specification.new do |spec| Dsu now has a browse command! Try it out by running `dsu browse help`. + Dsu now has a festive "christmas" theme! Try it out by running `dsu theme use christmas`. Dsu now has a "light" theme for light background terminals! Try it out by running `dsu theme use light`. Dsu now has a delete command! Try it out by running `dsu delete help`. diff --git a/lib/dsu.rb b/lib/dsu.rb index 684d6ab4..a6844d1d 100644 --- a/lib/dsu.rb +++ b/lib/dsu.rb @@ -35,9 +35,10 @@ end # TODO: Hack. Integrate this into the migration service # so that this runs only if the migration version changes. - theme_file = 'light.json' - destination_theme_file_path = File.join(Dsu::Support::Fileable.themes_folder, theme_file) - unless File.exist?(destination_theme_file_path) + %w[light.json christmas.json].each do |theme_file| + destination_theme_file_path = File.join(Dsu::Support::Fileable.themes_folder, theme_file) + next if File.exist?(destination_theme_file_path) + source_theme_file_path = File.join(Dsu::Support::Fileable.seed_data_folder, 'themes', theme_file) FileUtils.cp(source_theme_file_path, destination_theme_file_path) puts I18n.t('migrations.information.theme_copied', from: source_theme_file_path, to: destination_theme_file_path) diff --git a/lib/dsu/version.rb b/lib/dsu/version.rb index f3808ef5..1d3a5e8f 100644 --- a/lib/dsu/version.rb +++ b/lib/dsu/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Dsu - VERSION_REGEX = /\A\d+\.\d+\.\d+(\.alpha\.\d+)?\z/ - VERSION = '2.2.0.rc.1' + VERSION_REGEX = /\A\d+\.\d+\.\d+(\.(alpha|rc)\.\d+)?\z/ + VERSION = '2.2.0.rc.2' end diff --git a/lib/seed_data/themes/christmas.json b/lib/seed_data/themes/christmas.json new file mode 100644 index 00000000..9699f524 --- /dev/null +++ b/lib/seed_data/themes/christmas.json @@ -0,0 +1,79 @@ +{ + "version": 20230613121411, + "description": "Christmas theme ho ho ho!", + "help": { + "color": "red", + "mode": "default", + "background": "default" + }, + "dsu_header": { + "color": "white", + "mode": "bold", + "background": "red" + }, + "dsu_footer": { + "color": "red", + "mode": "default", + "background": "default" + }, + "header": { + "color": "light_green", + "mode": "bold", + "background": "red" + }, + "subheader": { + "color": "red", + "mode": "underline", + "background": "default" + }, + "body": { + "color": "red", + "mode": "italic", + "background": "default" + }, + "footer": { + "color": "red", + "mode": "italic", + "background": "default" + }, + "date": { + "color": "white", + "mode": "bold", + "background": "green" + }, + "index": { + "color": "white", + "mode": "bold", + "background": "red" + }, + "info": { + "color": "white", + "mode": "bold", + "background": "light_red" + }, + "success": { + "color": "white", + "mode": "bold", + "background": "green" + }, + "warning": { + "color": "default", + "mode": "bold", + "background": "yellow" + }, + "error": { + "color": "light_yellow", + "mode": "default", + "background": "red" + }, + "prompt": { + "color": "white", + "mode": "bold", + "background": "green" + }, + "prompt_options": { + "color": "red", + "mode": "bold", + "background": "default" + } +}