festive_errors 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +41 -15
- data/lib/festive_errors/debug_exceptions_extension.rb +28 -28
- data/lib/festive_errors/version.rb +1 -1
- data/lib/styles/christmas.css +31 -0
- data/lib/styles/halloween.css +33 -1
- data/lib/styles/newyears.css +31 -0
- data/lib/styles/thanksgiving.css +31 -0
- data/lib/styles/valentines.css +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b618c052cd3092d15e1059210455dbf9c968e88b28221fb10cd4849274e2749
|
4
|
+
data.tar.gz: da162eb147a26d4df62798c8ac8bb6cdceeda8633a2bd4e72f9cc7e658ff7e3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e33303c455658a40eb78cb73edc474301d721ac05e712818d59f9959c69a9d3f10dcb8f1bba88e29ac9daa2919809f765778e4fc1e6093a7e6eb5b5dc6bf392
|
7
|
+
data.tar.gz: ce224e1b55c7167d48d553fface26a57808b24332ad8d116807cf1c55f215271edd5b84a91e17589a42fb2be305dcadc1da9d981db3e042db6bb4b6c2486a528
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,54 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# Festive Errors
|
2
|
+
|
3
|
+
Festive Errors is a Rails gem that spices up the Rails error page with fun holiday themes. We all like to do a little coding around the holidays. Get into the holiday spirit with Festive Errors!
|
4
|
+
|
5
|
+

|
6
|
+
<p align="center"><small><em>Debugging an exception in the month of October.</em></small></p>
|
3
7
|
|
4
8
|
## Usage
|
5
|
-
|
9
|
+
|
10
|
+
The gem adds a CSS theme override to the Rails debug page when your app raises an error in development. All you need to do is install it.
|
6
11
|
|
7
12
|
## Installation
|
8
|
-
|
13
|
+
|
14
|
+
Add the gem to your Gemfile:
|
9
15
|
|
10
16
|
```ruby
|
11
|
-
|
17
|
+
bundle add festive_errors --group development
|
12
18
|
```
|
13
19
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
## Contributing
|
21
|
+
|
22
|
+
This is a new gem. The themes and holidays are limited, and it needs tests. Contributions are welcome!
|
23
|
+
|
24
|
+
1. Fork it.
|
25
|
+
2. Create a topic branch `git checkout -b my_branch`
|
26
|
+
3. Make your changes and add an entry to [CHANGELOG.md](./CHANGELOG.md).
|
27
|
+
4. Commit your changes `git commit -am "Happy Hanukkah!"`
|
28
|
+
5. Push to your branch `git push origin my_branch`
|
29
|
+
6. Send a [pull request](https://github.com/honeybadger-io/festive_errors/pulls)
|
30
|
+
|
31
|
+
## Development
|
32
|
+
|
33
|
+
Run the local Rails server in the gem directory to raise a test exception:
|
18
34
|
|
19
|
-
|
20
|
-
|
21
|
-
|
35
|
+
```
|
36
|
+
git clone git@github.com:honeybadger-io/festive_errors.git
|
37
|
+
cd festive_errors
|
38
|
+
bundle install
|
39
|
+
bin/rails server
|
22
40
|
```
|
23
41
|
|
24
|
-
|
25
|
-
|
42
|
+
...then visit http://localhost:3000/
|
43
|
+
|
44
|
+
## Releasing
|
45
|
+
|
46
|
+
1. `gem install gem-release`
|
47
|
+
2. `gem bump -v [version] -t -r`
|
48
|
+
3. Update unreleased heading in [CHANGELOG.md](./CHANGELOG.md) (TODO: automate
|
49
|
+
this in gem-release command)
|
50
|
+
4. `git push origin main --tags`
|
26
51
|
|
27
52
|
## License
|
28
|
-
|
53
|
+
|
54
|
+
The gem is available as open source under the terms of the [MIT License](https://github.com/honeybadger-io/festive_errors/blob/main/MIT-LICENSE).
|
@@ -17,13 +17,40 @@ module FestiveErrors
|
|
17
17
|
}
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.current_theme
|
21
|
+
today = Date.today
|
22
|
+
year = today.year
|
23
|
+
|
24
|
+
# Get holiday ranges for current year
|
25
|
+
ranges = FestiveErrors.holiday_ranges(year)
|
26
|
+
|
27
|
+
# Check if today falls within a holiday range
|
28
|
+
ranges.each do |theme, date_range|
|
29
|
+
if date_range.cover?(today)
|
30
|
+
return theme
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Also check ranges from previous year (for dates that span multiple years)
|
35
|
+
if today.month == 1
|
36
|
+
prev_ranges = FestiveErrors.holiday_ranges(year - 1)
|
37
|
+
prev_ranges.each do |theme, date_range|
|
38
|
+
if date_range.cover?(today)
|
39
|
+
return theme
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
nil # No theme if not within a holiday range
|
45
|
+
end
|
46
|
+
|
20
47
|
module DebugExceptionsExtension
|
21
48
|
private
|
22
49
|
|
23
50
|
def create_template(*)
|
24
51
|
template = super
|
25
52
|
|
26
|
-
return template unless (theme_file = THEMES[
|
53
|
+
return template unless (theme_file = THEMES[FestiveErrors.current_theme])
|
27
54
|
|
28
55
|
css_path = File.expand_path("../styles/#{theme_file}", __dir__)
|
29
56
|
css_content = File.read(css_path)
|
@@ -34,32 +61,5 @@ module FestiveErrors
|
|
34
61
|
|
35
62
|
template
|
36
63
|
end
|
37
|
-
|
38
|
-
def __festive_errors_current_theme
|
39
|
-
today = Date.today
|
40
|
-
year = today.year
|
41
|
-
|
42
|
-
# Get holiday ranges for current year
|
43
|
-
ranges = FestiveErrors.holiday_ranges(year)
|
44
|
-
|
45
|
-
# Check if today falls within a holiday range
|
46
|
-
ranges.each do |theme, date_range|
|
47
|
-
if date_range.cover?(today)
|
48
|
-
return theme
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# Also check ranges from previous year (for dates that span multiple years)
|
53
|
-
if today.month == 1
|
54
|
-
prev_ranges = FestiveErrors.holiday_ranges(year - 1)
|
55
|
-
prev_ranges.each do |theme, date_range|
|
56
|
-
if date_range.cover?(today)
|
57
|
-
return theme
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
nil # No theme if not within a holiday range
|
63
|
-
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/styles/christmas.css
CHANGED
@@ -1,3 +1,34 @@
|
|
1
1
|
header h1::after {
|
2
2
|
content: " 🎅";
|
3
3
|
}
|
4
|
+
|
5
|
+
header {
|
6
|
+
background: #034f1b;
|
7
|
+
}
|
8
|
+
|
9
|
+
.exception-message .message,
|
10
|
+
h2,
|
11
|
+
a {
|
12
|
+
color: #56705b;
|
13
|
+
}
|
14
|
+
|
15
|
+
a:hover {
|
16
|
+
color: #034f1b;
|
17
|
+
}
|
18
|
+
|
19
|
+
.line.active {
|
20
|
+
background-color: #9ab99e;
|
21
|
+
color: #444444;
|
22
|
+
}
|
23
|
+
|
24
|
+
@media (prefers-color-scheme: dark) {
|
25
|
+
.exception-message .message,
|
26
|
+
h2,
|
27
|
+
a {
|
28
|
+
color: #07B33D;
|
29
|
+
}
|
30
|
+
|
31
|
+
a:hover {
|
32
|
+
color: #09f152;
|
33
|
+
}
|
34
|
+
}
|
data/lib/styles/halloween.css
CHANGED
@@ -1,3 +1,35 @@
|
|
1
1
|
header h1::after {
|
2
|
-
content: "
|
2
|
+
content: " 👻";
|
3
|
+
}
|
4
|
+
|
5
|
+
header {
|
6
|
+
background: #f18405;
|
7
|
+
color: #552E02;
|
8
|
+
}
|
9
|
+
|
10
|
+
.exception-message .message,
|
11
|
+
h2,
|
12
|
+
a {
|
13
|
+
color: #AE5F04;
|
14
|
+
}
|
15
|
+
|
16
|
+
a:hover {
|
17
|
+
color: #462602;
|
18
|
+
}
|
19
|
+
|
20
|
+
.line.active {
|
21
|
+
background-color: #f24f13;
|
22
|
+
color: #212121;
|
23
|
+
}
|
24
|
+
|
25
|
+
@media (prefers-color-scheme: dark) {
|
26
|
+
.exception-message .message,
|
27
|
+
h2,
|
28
|
+
a {
|
29
|
+
color: #CE7005;
|
30
|
+
}
|
31
|
+
|
32
|
+
a:hover {
|
33
|
+
color: #f98f15;
|
34
|
+
}
|
3
35
|
}
|
data/lib/styles/newyears.css
CHANGED
@@ -1,3 +1,34 @@
|
|
1
1
|
header h1::after {
|
2
2
|
content: " 🎆";
|
3
3
|
}
|
4
|
+
|
5
|
+
header {
|
6
|
+
background: #062844;
|
7
|
+
}
|
8
|
+
|
9
|
+
.exception-message .message,
|
10
|
+
h2,
|
11
|
+
a {
|
12
|
+
color: #8A701B;
|
13
|
+
}
|
14
|
+
|
15
|
+
a:hover {
|
16
|
+
color: #372d0b;
|
17
|
+
}
|
18
|
+
|
19
|
+
.line.active {
|
20
|
+
background-color: #d7b030;
|
21
|
+
color: #333;
|
22
|
+
}
|
23
|
+
|
24
|
+
@media (prefers-color-scheme: dark) {
|
25
|
+
.exception-message .message,
|
26
|
+
h2,
|
27
|
+
a {
|
28
|
+
color: #BA9724;
|
29
|
+
}
|
30
|
+
|
31
|
+
a:hover {
|
32
|
+
color: #DEBF56;
|
33
|
+
}
|
34
|
+
}
|
data/lib/styles/thanksgiving.css
CHANGED
@@ -1,3 +1,34 @@
|
|
1
1
|
header h1::after {
|
2
2
|
content: " 🦃";
|
3
3
|
}
|
4
|
+
|
5
|
+
header {
|
6
|
+
background: #5a391e;
|
7
|
+
}
|
8
|
+
|
9
|
+
.exception-message .message,
|
10
|
+
h2,
|
11
|
+
a {
|
12
|
+
color: #744D27;
|
13
|
+
}
|
14
|
+
|
15
|
+
a:hover {
|
16
|
+
color: #2e1f10;
|
17
|
+
}
|
18
|
+
|
19
|
+
.line.active {
|
20
|
+
background-color: #b78c55;
|
21
|
+
color: #2D2D2D;
|
22
|
+
}
|
23
|
+
|
24
|
+
@media (prefers-color-scheme: dark) {
|
25
|
+
.exception-message .message,
|
26
|
+
h2,
|
27
|
+
a {
|
28
|
+
color: #C98E5D;
|
29
|
+
}
|
30
|
+
|
31
|
+
a:hover {
|
32
|
+
color: #DFBA9D;
|
33
|
+
}
|
34
|
+
}
|
data/lib/styles/valentines.css
CHANGED
@@ -1,3 +1,35 @@
|
|
1
1
|
header h1::after {
|
2
2
|
content: " 💗";
|
3
3
|
}
|
4
|
+
|
5
|
+
header {
|
6
|
+
background: #f7a3db;
|
7
|
+
color: #930D66;
|
8
|
+
}
|
9
|
+
|
10
|
+
.exception-message .message,
|
11
|
+
h2,
|
12
|
+
a {
|
13
|
+
color: #D81396;
|
14
|
+
}
|
15
|
+
|
16
|
+
a:hover {
|
17
|
+
color: #56083c;
|
18
|
+
}
|
19
|
+
|
20
|
+
.line.active {
|
21
|
+
background-color: #fe2eab;
|
22
|
+
color: #4A0733;
|
23
|
+
}
|
24
|
+
|
25
|
+
@media (prefers-color-scheme: dark) {
|
26
|
+
.exception-message .message,
|
27
|
+
h2,
|
28
|
+
a {
|
29
|
+
color: #F267C3;
|
30
|
+
}
|
31
|
+
|
32
|
+
a:hover {
|
33
|
+
color: #f585cf;
|
34
|
+
}
|
35
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: festive_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Wood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|