Sha256: 5e3d60e7e54dbfa559ad3b1488002cab20b0aa5926231bbc81df847f8cb0bf80

Contents?: true

Size: 575 Bytes

Versions: 10

Compression:

Stored size: 575 Bytes

Contents

require 'thor'

module Author
  module Commands
    class Check < Thor::Group
      
      def check_for_prince
        check_for "Prince"
      end
      
      def check_for_kindlegen
        check_for "KindleGen"
      end
      
      private
      
      def check_for(dependency)
        command = dependency.downcase
        installed = (`which #{command}` && $?.success?)
        color = installed ? :green : :red
        say "Checking for #{dependency}"
        say "#{dependency} is#{' not' unless installed} installed\n\n", color
      end
      
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
author-1.2.0.alpha lib/author/commands/check.rb
author-1.1.6.alpha lib/author/commands/check.rb
author-1.1.5.alpha lib/author/commands/check.rb
author-1.1.4.alpha lib/author/commands/check.rb
author-1.1.3.alpha lib/author/commands/check.rb
author-1.1.2.alpha lib/author/commands/check.rb
author-1.1.1.alpha lib/author/commands/check.rb
author-1.1.0.alpha lib/author/commands/check.rb
author-1.0.1.alpha lib/author/commands/check.rb
author-1.0.0.alpha lib/author/commands/check.rb