Sha256: 045fb4fba5c42e3f4ff8a9d044b9bdc7ac99b9ba30122c3d483cbfdc07b32e9a

Contents?: true

Size: 901 Bytes

Versions: 7

Compression:

Stored size: 901 Bytes

Contents

require "thecore_backend_commons"
require "haml"
require "haml-rails"
# require "serviceworker-rails"
require "groupdate"
# require "apexcharts"
require "rails_charts"
require "echarts/speedometer"
require "echarts/vector"
require "echarts/multiple_vectors"
require "echarts/binary"
require "echarts/binary_series"
require "echarts/map"

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

7 entries across 7 versions & 1 rubygems

Version Path
thecore_ui_commons-3.2.11 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.10 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.9 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.8 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.7 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.6 lib/thecore_ui_commons.rb
thecore_ui_commons-3.2.5 lib/thecore_ui_commons.rb