Sha256: a2b393214dcebeaa73a2d870e581d5121842993fd054d8f0e53cf409ad15abac

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

require 'fulmar/domain/service/configuration_service'

module Fulmar
  module Domain
    module Service
      # Provides the helper methods used in the tasks
      module CommonHelperService
        attr_accessor :environment

        def full_configuration
          configuration.configuration
        end

        def configuration
          (@_config_service ||= Fulmar::Domain::Service::ConfigurationService.instance)
        end

        def composer(command, arguments = [])
          (@_composer ||= Fulmar::Infrastructure::Service::ComposerService.new).execute(command, arguments)
        end

        def local_shell
          @_local_shell ||= Fulmar::Infrastructure::Service::ShellService.new configuration[:local_path]
        end

        def remote_shell
          @_remote_shell ||= Fulmar::Infrastructure::Service::ShellService.new(configuration[:remote_path], configuration[:hostname])
        end

        def file_sync
          @_file_sync ||= Fulmar::FileSync.create_transfer configuration
        end

        def database
          @_database ||= Fulmar::Infrastructure::Service::Database::DatabaseService.new configuration
        end

        def render_templates
          (Fulmar::Domain::Service::ConfigRenderingService.new configuration).render
        end

        def git
          @_git ||= Fulmar::Infrastructure::Service::GitService.new configuration
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fulmar-0.6.4 lib/fulmar/service/common_helper_service.rb
fulmar-0.6.3 lib/fulmar/service/common_helper_service.rb