Sha256: 457218644c6753ac3e31762979c950a6a615605f345faed71f07b96bd0f4cc73

Contents?: true

Size: 822 Bytes

Versions: 10

Compression:

Stored size: 822 Bytes

Contents

# encoding: utf-8
module Guard
  class Bundler < Plugin
    class Notifier

      def self.guard_message(result, duration)
        case result
        when 'up-to-date'
          "Bundle already up-to-date"
        when 'bundle_check_install'
          "Bundle installed using local gems"
        when true
          "Bundle has been installed\nin %.1f seconds." % [duration]
        else
          "Bundle can't be installed,\nplease check manually."
        end
      end

      # failed | success
      def self.guard_image(result)
        result ?  :success : :failed
      end

      def self.notify(result, duration)
        message = guard_message(result, duration)
        image   = guard_image(result)

        Guard::Compat::UI.notify(message, title: 'bundle install', image: image)
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
guard-bundler-3.0.1 lib/guard/bundler/notifier.rb
guard-bundler-3.0.0 lib/guard/bundler/notifier.rb
guard-bundler-2.2.1 lib/guard/bundler/notifier.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/guard-bundler-2.1.0/lib/guard/bundler/notifier.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/guard-bundler-2.1.0/lib/guard/bundler/notifier.rb
guard-bundler-2.2.0 lib/guard/bundler/notifier.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-bundler-2.1.0/lib/guard/bundler/notifier.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-bundler-2.1.0/lib/guard/bundler/notifier.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/guard-bundler-2.1.0/lib/guard/bundler/notifier.rb
guard-bundler-2.1.0 lib/guard/bundler/notifier.rb