Sha256: 6bc135f9f5a77eaf61188727fb1397504c81d4b1de5075d539d510288bfa2657

Contents?: true

Size: 821 Bytes

Versions: 9

Compression:

Stored size: 821 Bytes

Contents

require 'haml'
require 'haml-rails'

require 'thecore_background_jobs' # This brings backend commons also.
# Rails
require 'serviceworker-rails'
require "groupdate"
require "apexcharts"
require "image_processing"

require 'concerns/thecore_ui_commons_user'

require "thecore_ui_commons/engine"

module ThecoreUiCommons
	def self.save_files files
		files.each do |pic|
			upload_dir = Rails.root.join(Settings.ns(:importer).import_from_folder, 'uploads')
			FileUtils.mkdir_p upload_dir
			file_to_upload = Rails.root.join(upload_dir, "uploaded-#{Time.now.strftime("%Y%m%d%H%M%S%L")}-#{pic.original_filename}")
			
			File.open(file_to_upload, 'wb') { |file| file.write(pic.read) } if Regexp.new("\\.#{Settings.ns(:importer).extension.gsub(/ +/, "").split(",").join("|\\.")}$").match? pic.original_filename
		end
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
thecore_ui_commons-3.0.10 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.9 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.8 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.7 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.6 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.5 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.4 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.3 lib/thecore_ui_commons.rb
thecore_ui_commons-3.0.0 lib/thecore_ui_commons.rb