Sha256: 8861d303e16d8ce11bd2c0028b2a7f6975829cb849d7cc117747664bb4775af6

Contents?: true

Size: 601 Bytes

Versions: 12

Compression:

Stored size: 601 Bytes

Contents

require 'active_support/concern'

module Locomotive::Wagon

  module BaseConcern

    extend ActiveSupport::Concern

    included do

      alias :_sync :_pull

    end

    module ClassMethods

      def sync(api_client, current_site, path, env)
        new(api_client, current_site, path, env).sync
      end

    end

    def sync
      instrument do
        instrument :start
        self._sync
        instrument :done
      end
    end

    def instrument_base_name
      'wagon.sync'
    end

    def resource_name
      self.class.name[/::Sync(\w+)Command$/, 1].underscore
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
locomotivecms_wagon-3.2.0.alpha2 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.2.0.alpha1 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.1.1 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.1.0 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.1.0.beta1 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.5 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.4 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.3 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.2 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.0 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.0.rc0 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb
locomotivecms_wagon-3.0.0.beta2 lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb