Skip to content

Commit

Permalink
Merge pull request #26 from elanthia-online/mrhoribu-patch-1
Browse files Browse the repository at this point in the history
bugfix: NilClass Opts.char when none passed
  • Loading branch information
mrhoribu authored Dec 10, 2024
2 parents 3c00a96 + 0cf8ed2 commit 6381e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
bundler-cache: false
- name: Install ruby gem dependencies with bundler
run: |
gem install bundler
Expand Down
6 changes: 4 additions & 2 deletions profanity.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# encoding: US-ASCII

=begin
ProfanityFE
Expand Down Expand Up @@ -54,7 +56,7 @@ def self.log_file

@title = nil
@status = nil
@char = Opts.char.capitalize
@char = Opts.char.nil? ? "Unknown" : Opts.char.capitalize
@state = {}

def self.fetch(key, default = nil)
Expand Down Expand Up @@ -179,7 +181,7 @@ def add_prompt(window, prompt_text, cmd = "")
ERROR
end

Profanity.set_terminal_title(Opts.char.capitalize)
Profanity.set_terminal_title((Opts.char.nil? ? "Unknown" : Opts.char.capitalize))

unless defined?(CUSTOM_COLORS)
CUSTOM_COLORS = Curses.can_change_color?
Expand Down

0 comments on commit 6381e55

Please sign in to comment.