Skip to content

Commit

Permalink
Add christmas theme
Browse files Browse the repository at this point in the history
  • Loading branch information
gangelo committed Dec 23, 2023
1 parent 2f36b1e commit b4f61df
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions dsu.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
7 changes: 4 additions & 3 deletions lib/dsu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/dsu/version.rb
Original file line number Diff line number Diff line change
@@ -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
79 changes: 79 additions & 0 deletions lib/seed_data/themes/christmas.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit b4f61df

Please sign in to comment.