Top Level Namespace

Defined Under Namespace

Modules: BasicLogging, File_Checking, TagMunging, Translating Classes: AboutDialog, BusyIndicator, ButtonLabel, CFPrawn, ConfCheck, ConfDialog, ConfOption, ConfValue, Configuration, CremeFraiche, CremeFraicheGui, EmlFile, HowtoDialog, Html2Text

Constant Summary collapse

LICENSE_TEXT =

the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, version 2

%+
         DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                  Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.+
YEARS =

/***************************************************************************

*   ©2011-2023, Michael Uplawski <[email protected]>           *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the WTFPL 2.0 or later version of the  LICENSE. *
*   See https://wtfpl2.com/ for details.                                  * 
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *
*                                                                         *
***************************************************************************/
"2011 - 2023"
VERSION =
"1.1.8"
SUMMARY =
"README for rubygems.org"
App_name =
'Creme Fraiche'
Author =
'Michael Uplawski'
Author_mail =
'<[email protected]>'
Web_page =
'http://www.rubygems.org/gems/cremefraiche'
GD =
File::expand_path(File::dirname(__FILE__) ) + File::Separator
DLG_ERROR =
:error
DLG_INFO =
:info
DLG_WARN =
:warning
MAX_FN_LEN =

maximum length of the file-names before they are clipped

35
HOME =
ENV['HOME'].dup
LIST_FILE =

the list of eml-files is stored each time upon quitting

HOME << File::Separator << '.cremefraiche.lst'
CLICKED =

String-constants

'clicked'
LN =
"\n"
FIELD_SEPARATOR =
'#'
LINE_SEPARATOR =
nil
COLORS =

Helper functions for color-output to an Ansi-terminal.

... I have never seen an Ansi-terminal, but learned that about each Linux
terminal-emulator can behave like one.
And anyway. This works.
{:default => 9, :black => 0, :red => 1, :green => 2, :yellow => 3, :blue => 4, :purple => 5, :cyan => 6, :white => 7 }
BG =
4
FG =
3
REGULAR =
0
BOLD =
1
UNDERLINE =
4
5
SWAP =
7
NEUTRAL =
0
STYLES =
{:regular => REGULAR, :bold => BOLD, :underline => UNDERLINE, :blink => BLINK, :swap => SWAP, :neutral => NEUTRAL}

Instance Method Summary collapse

Instance Method Details

#busy_indicator(width) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/busy_indicator/busy_function_test.rb', line 29

def busy_indicator(width)
  tobj = Thread.new() do
    loop do 
      %w"OOO ooo ___ ooo".each do |s|
        print "%+#{width}s" %s
        sleep 0.1
        print ("\b" * width)
      end
    end
  end
end

#clean_busy_indicator(thr, width, comment) ⇒ Object



22
23
24
25
26
27
# File 'lib/busy_indicator/busy_function_test.rb', line 22

def clean_busy_indicator(thr, width, comment)
  thr.terminate
  thr.join
  print ("\b" * width)
  print ("%+#{width}s\n" %comment)
end

#colored_output(output_text, fg_color = :default, bg_color = :default, style = :regular, mode = :neutral) ⇒ Object



39
40
41
# File 'lib/busy_indicator/color_output.rb', line 39

def colored_output(output_text, fg_color = :default, bg_color = :default, style = :regular , mode = :neutral )
  "\033[%i;%i;%i%i;%i%im%s\033[0m" %[STYLES[mode.to_sym], STYLES[style.to_sym], FG, COLORS[fg_color.to_sym], BG, COLORS[bg_color.to_sym], output_text]
end

#colored_text(text, color_code) ⇒ Object



35
36
37
# File 'lib/busy_indicator/color_output.rb', line 35

def colored_text(text, color_code)
    "#{color_code}#{text}e[0m"
end

#green(text) ⇒ Object



44
# File 'lib/busy_indicator/color_output.rb', line 44

def green(text); colorize(text, "\033[32m"); end

#msg_dialog(msg, type = :info) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/gui/message_dialog.rb', line 25

def msg_dialog(msg, type = :info)
		dialog = Gtk::MessageDialog.new(:parent => nil, 
						:flags => :destroy_with_parent,
						:type => type,
						:message => msg)
		dialog.set_title(type)
		dialog.run
		dialog.destroy
		return msg
end

#red(text) ⇒ Object



43
# File 'lib/busy_indicator/color_output.rb', line 43

def red(text); colorize(text, "\033[31m"); end