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.0.beta11 lib/softcover/commands/deployment.rb
softcover-1.0.beta10 lib/softcover/commands/deployment.rb
softcover-1.0.beta9 lib/softcover/commands/deployment.rb
softcover-1.0.beta8 lib/softcover/commands/deployment.rb
softcover-1.0.beta7 lib/softcover/commands/deployment.rb
softcover-1.0.beta6 lib/softcover/commands/deployment.rb
softcover-1.0.beta5 lib/softcover/commands/deployment.rb
softcover-1.0.beta4 lib/softcover/commands/deployment.rb
softcover-1.0.beta3 lib/softcover/commands/deployment.rb
softcover-nonstop-1.0.beta2 lib/softcover/commands/deployment.rb
softcover-1.0.beta2 lib/softcover/commands/deployment.rb
softcover-1.0.beta1 lib/softcover/commands/deployment.rb
softcover-0.9.23 lib/softcover/commands/deployment.rb
softcover-0.9.22 lib/softcover/commands/deployment.rb
softcover-0.9.21 lib/softcover/commands/deployment.rb
softcover-0.9.20 lib/softcover/commands/deployment.rb
softcover-0.9.19 lib/softcover/commands/deployment.rb
softcover-0.9.18 lib/softcover/commands/deployment.rb
softcover-0.9.17 lib/softcover/commands/deployment.rb
softcover-0.9.16 lib/softcover/commands/deployment.rb