lib/notifaction/notify.rb in notifaction-0.4.0 vs lib/notifaction/notify.rb in notifaction-0.4.1

- old
+ new

@@ -1,110 +1,79 @@ class Notify + extend Notifaction::Helpers + # Display a notification bubble + # @since 0.1.0 def self.bubble(message, title) if Utils.os == :macosx handler = Notifaction::Type::OSX.new else handler = Notifaction::Type::Linux.new end handler.bubble(message, title) - handler.quit + handler.quit_ok end + # Display a modal popup with a close button + # @since 0.1.0 def self.modal(message, title) if Utils.os == :macosx handler = Notifaction::Type::OSX.new else handler = Notifaction::Type::Linux.new end handler.modal(message, title) - handler.quit + handler.quit_ok end # Prints a pre-formatted error message to the console + # @since 0.1.0 def self.error(message, config = {}) handler = Notifaction::Type::Terminal.new handler.error(message, config) - handler.quit unless self.auto_quit_enabled(config, handler.user_conf) + handler.quit unless auto_quit_enabled?(config, handler.user_conf) end # Prints a pre-formatted warning message to the console + # @since 0.1.0 def self.warning(message, config = {}) handler = Notifaction::Type::Terminal.new handler.warning(message, config) end # Prints a pre-formatted informational message to the console + # @since 0.1.0 def self.info(message, config = {}) handler = Notifaction::Type::Terminal.new handler.info(message, config) end # Prints a pre-formatted secondary informational message to the console - def self.sinfo(message, config = {}) - handler = Notifaction::Type::Terminal.new - handler.note(message, config) - end - + # @since 0.2.0 def self.note(message, config = {}) handler = Notifaction::Type::Terminal.new handler.note(message, config) end # Prints a pre-formatted success message to the console + # @since 0.1.0 def self.success(message, config = {}) handler = Notifaction::Type::Terminal.new handler.success(message, config) end # Prints a pre-formatted unstyled message to the console + # @since 0.1.0 def self.spit(message, config = {}) handler = Notifaction::Type::Terminal.new handler.spit(message, config) end - # Send status updates to WorkingOn - def self.workingon(message, print_info_message = false) - self.deprecation_notice("0.3.0") - end - # pretty-print a spacer + # @since 0.1.0 def self.spacer(config = {}) handler = Notifaction::Type::Terminal.new handler.spacer(config) - end - - def self.configure - self.deprecation_notice("0.3.0") - - yield self if block_given? - end - - def self.print_output - true - end - - def self.print_timestamps - true - end - - # register new plugins - def self.plugins=(plugin_config_arr) - self.deprecation_notice("0.3.0") - end - - private_class_method - - # - # @since 0.2.8 - def deprecation_notice(version) - puts "Deprecated as of #{version}, current #{Notifaction::VERSION}" - end - - # - # @since 0.3.0 - def self.auto_quit_enabled(config, user_conf) - config[:auto_quit] == false || user_conf.conf["auto_quit"] == false end end