thecore_ui_commons 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/it.yml +1 -0
- data/db/migrate/20210208142646_add_settings_for_uploader.rb +6 -0
- data/lib/thecore_ui_commons.rb +16 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f96a230065dcec5fdb22b7959137e33b030af287152f1ef142f30830475908be
|
4
|
+
data.tar.gz: 5a01e066cb48e721f83a208a0cf5570140a02babf5dd14d730019198bef95e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aa2e381eb398e0b3fb29fc38ad3de5d2be9930afe486ac47352a45d76677a00317e883380bcb203c226351a409c60f4b4368bc6ce2ec6af95c272e122e5edb2
|
7
|
+
data.tar.gz: 14e72ad93387dd2600bcbb09cf54440c60857ae55c62b393b77a2a240ad3a1f9ccb271cacf42b3f94ae7591f08114665025c1d35b6352f1ea64cc92929f9bdf3
|
data/config/locales/it.yml
CHANGED
data/lib/thecore_ui_commons.rb
CHANGED
@@ -13,4 +13,20 @@ require "thecore_ui_commons/engine"
|
|
13
13
|
|
14
14
|
module ThecoreUiCommons
|
15
15
|
# Your code goes here...
|
16
|
+
|
17
|
+
def self.save_files files
|
18
|
+
# Rails.logger.debug "AAAAAAAAAAA: POST?"
|
19
|
+
files.each do |pic|
|
20
|
+
# Rails.logger.debug "AAAAAAAAAAA: EACH PIC: #{pic.inspect}"
|
21
|
+
upload_dir = Rails.root.join(Settings.ns(:importer).import_from_folder, 'uploads')
|
22
|
+
FileUtils.mkdir_p upload_dir
|
23
|
+
# Rails.logger.debug "AAAAAAAAAAA: Fatto MKDIR di #{upload_dir}"
|
24
|
+
file_to_upload = Rails.root.join(upload_dir, "uploaded-#{Time.now.strftime("%Y%m%d%H%M%S%L")}-#{pic.original_filename}")
|
25
|
+
# Rails.logger.debug "AAAAAAAAAAA: File da uploadare #{file_to_upload}"
|
26
|
+
File.open(file_to_upload, 'wb') do |file|
|
27
|
+
# Rails.logger.debug "AAAAAAAAAAAAAAAAAA: Dentro alla scrittura"
|
28
|
+
file.write(pic.read)
|
29
|
+
end if Regexp.new("\\.#{Settings.ns(:importer).extension.gsub(/ +/, "").split(",").join("|\\.")}$").match? pic.original_filename
|
30
|
+
end
|
31
|
+
end
|
16
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- config/routes.rb
|
139
139
|
- db/migrate/20200515070620_add_username_to_user.rb
|
140
140
|
- db/migrate/20200515132932_add_rememberable_to_user.rb
|
141
|
+
- db/migrate/20210208142646_add_settings_for_uploader.rb
|
141
142
|
- lib/concerns/thecore_ui_commons_user.rb
|
142
143
|
- lib/tasks/thecore_ui_commons_tasks.rake
|
143
144
|
- lib/thecore_ui_commons.rb
|