thecore_ui_commons 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f510ad3fa384e9d3a3598f949d7a71bd233c690c72022244df397108ac0224cc
4
- data.tar.gz: 1bb0f13df31b05f4c9953b050cbcef0b16a827dc6dd950d694dd919fd57fb16d
3
+ metadata.gz: f96a230065dcec5fdb22b7959137e33b030af287152f1ef142f30830475908be
4
+ data.tar.gz: 5a01e066cb48e721f83a208a0cf5570140a02babf5dd14d730019198bef95e4b
5
5
  SHA512:
6
- metadata.gz: 40d0ddc4c4992240d4e0e5b1a9cbc6b9baf98a7708fa76cadbb7e30c364d2338a3965890a4c59fc259b29fc6dfcf5d68f1d8ace41eea8443142a53496498501e
7
- data.tar.gz: baf89f83fca413e37606f7ca6dd40e414d5a5a7cae102f18cdcd4e3f83f2d78aea903a22c894df9799cbe39a84390e6cd575f3f15a578eab2d7a237ae0a6c714
6
+ metadata.gz: 1aa2e381eb398e0b3fb29fc38ad3de5d2be9930afe486ac47352a45d76677a00317e883380bcb203c226351a409c60f4b4368bc6ce2ec6af95c272e122e5edb2
7
+ data.tar.gz: 14e72ad93387dd2600bcbb09cf54440c60857ae55c62b393b77a2a240ad3a1f9ccb271cacf42b3f94ae7591f08114665025c1d35b6352f1ea64cc92929f9bdf3
@@ -1,4 +1,5 @@
1
1
  it:
2
+ import_success: Importazione completata con successo
2
3
  current_user: Utente corrente
3
4
  hello: "Ciao Mondo"
4
5
  dashboard: "Pannello di controllo"
@@ -0,0 +1,6 @@
1
+ class AddSettingsForUploader < ActiveRecord::Migration[6.0]
2
+ def change
3
+ Settings.ns(:importer).import_from_folder = "tmp/imports"
4
+ Settings.ns(:importer).extension = "txt"
5
+ end
6
+ end
@@ -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
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