importo 3.0.12 → 3.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb87400266c9f97c658bd13a140100ae2c19ea5605ca3bf4c2497ba2b525b826
4
- data.tar.gz: 96de0804e9232dbd537515f7619dc8291af771507c59f00b8a326e348ac4a2fa
3
+ metadata.gz: dd4b3db91de0cb6d968bd01d4bf0bad047d780c4107b6c93516c24167b57c0de
4
+ data.tar.gz: 85acd9762cb804e328bb74f4d7a89f903e63815b624510d011d065cb6fdf722d
5
5
  SHA512:
6
- metadata.gz: 3be3ff53acb123bb507dbabb19b121c604df16b893369cbd43d63482acac9ebfde2cd141c09708605ad866bf8554ccdfd35ce3dd13c6439040c84dcb16e11b8f
7
- data.tar.gz: 7fdb190675a95cdc8085a7651755e4796f66ea0f9f0af60cc4d61653b79ec8fca503efadd048e0034c132828559d687edd7b9825b346a6d30f5181f8db8b8e67
6
+ metadata.gz: 4776bb7d6af56b198ad1e2786b9f77fba192e4d75717e113924634fc67278afc30505b2ce180ee77c5fb327e1833c23fd2f48c4c05f78e6a6ebb772a3d8cc3b3
7
+ data.tar.gz: 76f821df633edfb58fad53d99229d26891d349f2cc7bc99421afc36f24a72f22ba1fa4863bf11bd6838b6628b5013540c38d21de519f29d60ec306803292bcf1
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Importo::ImportsTable < ActionTable::ActionTable
3
+ if defined? ActionTable
4
+ class Importo::ImportsTable < ActionTable::ActionTable
4
5
  model Importo::Import
5
6
 
6
7
  column(:created_at, html_value: proc { |import| l(import.created_at.in_time_zone(Time.zone), format: :short).to_s })
@@ -33,3 +34,7 @@ class Importo::ImportsTable < ActionTable::ActionTable
33
34
  @scope
34
35
  end
35
36
  end
37
+ else
38
+ class Importo::ImportsTable
39
+ end
40
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "axlsx"
4
+ require "roo/excelx"
4
5
 
5
6
  module Importo
6
7
  module TestHelpers
@@ -15,5 +16,21 @@ module Importo
15
16
 
16
17
  xls.to_stream
17
18
  end
19
+
20
+ def sample_sheet(kind, locale: I18n.locale)
21
+ excel = Importo::Import.new(kind: kind, locale: locale).importer.sample_file
22
+
23
+ Roo::Excelx.new(excel.set_encoding("BINARY"))
24
+ end
25
+
26
+ def import_sheet(kind, sheet, filename: 'import.xlsx', locale: I18n.locale, owner: users(:admin))
27
+ import = Importo::Import.new(kind: kind, locale: locale, importo_ownable: owner)
28
+
29
+ import.original.attach(io: sheet, filename: filename, content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", identify: false)
30
+ import.save!
31
+
32
+ ImportService.perform(import: import)
33
+ import
34
+ end
18
35
  end
19
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Importo
4
- VERSION = "3.0.12"
4
+ VERSION = "3.0.14"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.12
4
+ version: 3.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Meij
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-12 00:00:00.000000000 Z
12
+ date: 2024-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: caxlsx