eitil 1.1.34 → 1.1.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/drop_data.rb +7 -1
- data/eitil_integrate/lib/eitil_integrate/application_exporter/lookups.rb +7 -3
- data/eitil_store/lib/eitil_store/regex/regex.rb +1 -1
- data/eitil_wrapper/lib/eitil_wrapper/callbacks/helper_methods.rb +2 -0
- data/eitil_wrapper/lib/eitil_wrapper/scopes/default_scopes.rb +2 -0
- data/lib/eitil/railtie.rb +47 -8
- data/lib/eitil/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a10cacbe01eb49c8964a1dc6e2061e4b0aa80b0345d6560bf4353384146c61a
|
4
|
+
data.tar.gz: 1ca77ced97a199df79116b3023e3501b7072b5a680aca33fb142e303bba4136e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c579863550638fe0f4792406fb99b1ca21d577ae0c8e2e3794b9a9999862e547190ce10730f06415339b9f18b5965660afcf906833619a29b2c2c903183e0c5
|
7
|
+
data.tar.gz: c21f9c314e5861d0b9d64147280ac184c353f7c9516a460f73b27d609d6839b681e8f5a7e5dd9b327c1b0acf636bdc154066e086d395726efbe975c8e17914ae
|
@@ -17,7 +17,7 @@ module EitilIntegrate::RubyXL
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def try_float_conversion
|
20
|
-
@hash.transform_values! { |array| array.map { |item| item.is_num? ? item
|
20
|
+
@hash.transform_values! { |array| array.map { |item| item.is_num? ? to_float(item) : item } }
|
21
21
|
end
|
22
22
|
|
23
23
|
def drop_nil_values
|
@@ -37,6 +37,12 @@ module EitilIntegrate::RubyXL
|
|
37
37
|
value_is_a_int || value_is_a_float || value_is_a_time_string
|
38
38
|
end
|
39
39
|
|
40
|
+
def to_float(object)
|
41
|
+
# Implemented a new to_float method, which replaces .to_f, because "7.5".to_f
|
42
|
+
# would correctly return 7.5, but "7,5" would incorrectly return 7.0.
|
43
|
+
object.is_a?(String) ? object.gsub(',','.').to_f : object.to_f
|
44
|
+
end
|
45
|
+
|
40
46
|
def value_is_a_int
|
41
47
|
@value.is_a? Integer
|
42
48
|
end
|
@@ -31,9 +31,13 @@ module EitilIntegrate::RubyXL
|
|
31
31
|
|
32
32
|
# returns the exporter_infos, without the datatypes – for taxonomy purpuses, the field
|
33
33
|
# names are often sufficient
|
34
|
-
def exporter_taxonomy
|
35
|
-
exporter_infos.transform_values
|
36
|
-
|
34
|
+
def exporter_taxonomy
|
35
|
+
parameter_fields = exporter_infos.transform_values { |v| v.select { |k,v| k == :required || k == :optional } }
|
36
|
+
|
37
|
+
parameter_fields.transform_values do |setting_collection|
|
38
|
+
setting_collection.transform_values do |setting|
|
39
|
+
setting.map { |key| key.is_a?(Hash) ? key.keys : key }.flatten
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
@@ -16,7 +16,7 @@ module EitilStore
|
|
16
16
|
UUID = /\A(\h{32}|\h{8}-\h{4}-\h{4}-\h{4}-\h{12})\z/
|
17
17
|
|
18
18
|
# IsNum comes from the Rubinius source code and identifies both integers and floats correctly.
|
19
|
-
IsNum = /^\s*[+-]?((\d+_?)*\d+(
|
19
|
+
IsNum = /^\s*[+-]?((\d+_?)*\d+([.,](\d+_?)*\d+)?|\.(\d+_?)*\d+)(\s*|([eE][+-]?(\d+_?)*\d+)\s*)$/
|
20
20
|
|
21
21
|
# Validates Credit Card numbers, Checks if it contains 16 numbers in groups of 4 separated by -, space or nothing
|
22
22
|
CreditCard = /\A(\d{4}-){3}\d{4}\z|\A(\d{4}\s){3}\d{4}\z|\A\d{16}\z/
|
data/lib/eitil/railtie.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
|
2
|
+
|
3
|
+
|
2
4
|
# Constants
|
3
5
|
|
4
6
|
module Eitil
|
@@ -9,8 +11,53 @@ module Eitil
|
|
9
11
|
|
10
12
|
end
|
11
13
|
|
14
|
+
|
15
|
+
|
12
16
|
# Configuration
|
13
17
|
|
18
|
+
module Eitil
|
19
|
+
class Railtie < ::Rails::Railtie
|
20
|
+
|
21
|
+
# The following configuration has its own special place in the boot sequence:
|
22
|
+
# on the one hand, it should run before the initialization of Eitil (gem), but
|
23
|
+
# read config assigned by the main app – which is only loaded AFTER all gems have
|
24
|
+
# been initialized.
|
25
|
+
|
26
|
+
# Therefore, we only require the specified file from the main app, after defining
|
27
|
+
# the possible configurations for the Eitil railtie. This way we escape the boot
|
28
|
+
# sequence's dedault order.
|
29
|
+
|
30
|
+
config.before_initialize do |eitil|
|
31
|
+
|
32
|
+
Eitil.mattr_accessor :controller_ivars,
|
33
|
+
:skip_default_scopes_for_models,
|
34
|
+
:skip_callback_helper_methods_for_models
|
35
|
+
|
36
|
+
Eitil.controller_ivars ||= []
|
37
|
+
Eitil.skip_default_scopes_for_models ||= []
|
38
|
+
Eitil.skip_callback_helper_methods_for_models ||= []
|
39
|
+
|
40
|
+
def Eitil.set_config(&block)
|
41
|
+
yield Eitil
|
42
|
+
end
|
43
|
+
|
44
|
+
config_path = Rails.root + 'config/initializers/eitil.rb'
|
45
|
+
|
46
|
+
if File.exists? config_path
|
47
|
+
puts "Loading Eitil config from #{config_path}..."
|
48
|
+
load config_path
|
49
|
+
else
|
50
|
+
puts "Eitil config not found at #{config_path}, resorting to defaults..."
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
# Loading
|
60
|
+
|
14
61
|
module Eitil
|
15
62
|
|
16
63
|
class Railtie < ::Rails::Railtie
|
@@ -27,12 +74,4 @@ module Eitil
|
|
27
74
|
|
28
75
|
end
|
29
76
|
|
30
|
-
mattr_accessor :controller_ivars
|
31
|
-
|
32
|
-
self.controller_ivars ||= []
|
33
|
-
|
34
|
-
def self.set_config(&block)
|
35
|
-
yield self
|
36
|
-
end
|
37
|
-
|
38
77
|
end
|
data/lib/eitil/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eitil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Schrofer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|