decisive 0.6.2 → 0.6.3

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: 07c8a861463920b0e9aff56cdfe755e8da42beb2b5f4a2c148dcf043a53da1d6
4
- data.tar.gz: 72a5f54dc4b0ac9d9fe374c8f37b0bd5fac1ca488a69231204dd4d8c8ead1522
3
+ metadata.gz: 23b80a2524bbbb5ca658e58f19aace65cc19a912261b32110c7745c72e2cea17
4
+ data.tar.gz: b42ea7da05da22d7658b6ce5daf38029a5704f75cea8e6d3b0872a38a1466b65
5
5
  SHA512:
6
- metadata.gz: 5984a60b7c36675c3f84dca2eb057a5619fe0eba332842c745b0d850a3dba57fcb0c437cbcb405128054c92be2931cc77bf056fb528a810e467df53a98f74506
7
- data.tar.gz: 8bc44d8334b85209ec9b2d035f87e9bf2fbd21e5de52f31444f1c64f13df2980327e8a5175349bab6ed60892055a9295988545a4d78dd7cade8296b942fd53c8
6
+ metadata.gz: 02f001f7d3efdeb06a04890a7504316b0c24665b7438b2571f9f133d7cf7521612f7a807002334313f31b575be9cb9697f2ebe0ce5a11a72f15bf305c271f735
7
+ data.tar.gz: a8f98008525bf3537becd12f430c89213f4326e03e1432037486c837d3e94a4c8b499eddfefd6a1ea387b8e1ac45a81f0da2ab79cf0b0c01b3ccc2605fb76182
@@ -82,7 +82,7 @@ module Decisive
82
82
 
83
83
  def render xls
84
84
  worksheets.each do |name, enumerable|
85
- sheet = xls.create_worksheet(name: name)
85
+ sheet = xls.create_worksheet(name: sanitize_name(name))
86
86
 
87
87
  rows = to_array(enumerable)
88
88
 
@@ -93,6 +93,15 @@ module Decisive
93
93
  xls
94
94
  end
95
95
 
96
+ def sanitize_name name
97
+ name
98
+ .gsub(/[\[\]\*\?:\/\\\t\n\r]/, " ")
99
+ .gsub(/^'/, "")
100
+ .gsub(/'$/, "")
101
+ .strip
102
+ .slice(0,31)
103
+ end
104
+
96
105
  def to_array records
97
106
  context = RenderContext.new(records, nil, block)
98
107
  context.send(:header) + context.send(:body)
@@ -1,3 +1,3 @@
1
1
  module Decisive
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decisive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-11 00:00:00.000000000 Z
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview