Sha256: 310a090796c5125c3700d25169762ab09f17b04a350d89ec50ece33addd40d84

Contents?: true

Size: 934 Bytes

Versions: 55

Compression:

Stored size: 934 Bytes

Contents

module Softcover
  module Commands
    module Deployment
      include Softcover::Utils
      extend self

      # Deploy a book by building and publishing it.
      # The deploy steps can be customized using `.poly-publish`
      # in the book project's home directory.
      def deploy!
        if File.exist?('.softcover-deploy') && !custom_commands.empty?
          execute custom_commands
        else
          execute default_commands
        end
      end

      # Returns the default commands.
      def default_commands
        commands(['softcover build:all', 'softcover build:preview',
                  'softcover publish'])
      end

      # Returns custom commands (if any).
      def custom_commands
        commands(File.readlines(deploy_config).map(&:strip))
      end

      # Returns the filename for configuring `softcover deploy`.
      def deploy_config
        '.softcover-deploy'
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 2 rubygems

Version Path
softcover-1.1.6 lib/softcover/commands/deployment.rb
softcover-1.1.4 lib/softcover/commands/deployment.rb
softcover-1.1.3 lib/softcover/commands/deployment.rb
softcover-1.1.2 lib/softcover/commands/deployment.rb
softcover-1.1.1 lib/softcover/commands/deployment.rb
softcover-1.1.0 lib/softcover/commands/deployment.rb
softcover-1.1.beta2 lib/softcover/commands/deployment.rb
softcover-1.0.5 lib/softcover/commands/deployment.rb
softcover-1.1.beta1 lib/softcover/commands/deployment.rb
softcover-1.0.4 lib/softcover/commands/deployment.rb
softcover-1.0.3 lib/softcover/commands/deployment.rb
softcover-1.0.2 lib/softcover/commands/deployment.rb
softcover-1.0.1 lib/softcover/commands/deployment.rb
softcover-1.0.0 lib/softcover/commands/deployment.rb
softcover-1.0.beta17 lib/softcover/commands/deployment.rb
softcover-1.0.beta16 lib/softcover/commands/deployment.rb
softcover-1.0.beta15 lib/softcover/commands/deployment.rb
softcover-1.0.beta14 lib/softcover/commands/deployment.rb
softcover-1.0.beta13 lib/softcover/commands/deployment.rb
softcover-1.0.beta12 lib/softcover/commands/deployment.rb