Sha256: e9da5b94fb01b48b0e83a1c86e55fc873e1bcb8161712276f34884d4666ba700

Contents?: true

Size: 762 Bytes

Versions: 18

Compression:

Stored size: 762 Bytes

Contents

module Souls
  module Sync
    class << self
      def model
        cp_dir = %w[db app/models spec/factories]
        cp_dir.each do |dir|
          cp_and_dl_files(dir: dir)
        end
      end

      private

      def cp_and_dl_files(dir: "db")
        require("#{Souls.get_mother_path}/config/souls")
        worker_paths = Souls.configuration.workers.map { |n| n[:name] }
        worker_paths.each do |path|
          cp_path = "./apps/api/#{dir}"
          old_path = "./apps/#{path}/#{dir}"
          system("rm -rf #{old_path}", chdir: Souls.get_mother_path)
          system("mkdir -p #{old_path}", chdir: Souls.get_mother_path)
          system("cp -r #{cp_path}/* #{old_path}", chdir: Souls.get_mother_path)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
souls-0.44.1 lib/souls/cli/sync/model.rb
souls-0.44.0 lib/souls/cli/sync/model.rb
souls-0.43.0 lib/souls/cli/sync/model.rb
souls-0.42.1 lib/souls/cli/sync/model.rb
souls-0.42.0 lib/souls/cli/sync/model.rb
souls-0.41.3 lib/souls/cli/sync/model.rb
souls-0.41.2 lib/souls/cli/sync/model.rb
souls-0.41.1 lib/souls/cli/sync/model.rb
souls-0.41.0 lib/souls/cli/sync/model.rb
souls-0.40.3 lib/souls/cli/sync/model.rb
souls-0.40.2 lib/souls/cli/sync/model.rb
souls-0.40.1 lib/souls/cli/sync/model.rb
souls-0.40.0 lib/souls/cli/sync/model.rb
souls-0.39.0 lib/souls/cli/sync/model.rb
souls-0.38.6 lib/souls/cli/sync/model.rb
souls-0.38.5 lib/souls/cli/sync/model.rb
souls-0.38.4 lib/souls/cli/sync/model.rb
souls-0.38.3 lib/souls/cli/sync/model.rb