Sha256: c55b2774901a98fda7b0876c7ae009de9f3ffc6646802b5a05e8aa72aa35d8ee

Contents?: true

Size: 689 Bytes

Versions: 26

Compression:

Stored size: 689 Bytes

Contents

module ContentfulMiddleman
  module LocalData
    class Store
      include ContentfulMiddleman::Tools::Backup::InstanceMethods

      class << self
        def base_path=(path)
          @base_path = path
        end

        def base_path
          @base_path
        end
      end

      def initialize(files, folder)
        @files  = files
        @folder = folder
      end

      def write
        do_with_backup backup_name, path_to_backup do
          @files.each(&:write)
        end
      end

      private
      def backup_name
        "#{@folder}-data-backup"
      end

      def path_to_backup
        ::File.join(self.class.base_path, @folder)
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
contentful_middleman-4.2.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-4.1.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-3.0.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-4.0.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-4.0.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-3.0.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.1.3 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.1.2 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.1.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.1.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.0.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-2.0.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.5.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.4.2 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.4.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.4.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.3.2 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.3.1 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.2.0 lib/contentful_middleman/local_data/store.rb
contentful_middleman-1.1.1 lib/contentful_middleman/local_data/store.rb