active-list 4.1.8 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.8
1
+ 4.2.0
@@ -38,7 +38,7 @@ module ActiveList
38
38
  headers, columns = [], table.exportable_columns
39
39
  for column in columns
40
40
  datum = column.header_code
41
- headers << (options[:iconv] ? "#{options[:iconv]}.iconv("+datum+".to_s)" : datum)
41
+ headers << (options[:encoding] ? datum+".to_s.encode('#{options[:encoding]}')" : datum)
42
42
  end
43
43
  return headers
44
44
  end
@@ -55,7 +55,7 @@ module ActiveList
55
55
  else
56
56
  datum = column.exporting_datum_code(record)
57
57
  end
58
- array << (options[:iconv] ? "#{options[:iconv]}.iconv("+datum+".to_s)" : datum)
58
+ array << (options[:encoding] ? datum+".to_s.encode('#{options[:encoding]}')" : datum)
59
59
  end
60
60
  end
61
61
  return array
@@ -18,14 +18,14 @@ module ActiveList
18
18
  def send_data_code(table)
19
19
  record = "r"
20
20
  code = table.select_data_code(:paginate => false)
21
- code += "ic = Iconv.new('cp1252', 'utf-8')\n"
22
- code += "data = ActiveList::CSV.generate(:col_sep=>';') do |csv|\n"
23
- code += " csv << [#{columns_to_array(table, :header, :iconv=>'ic').join(', ')}]\n"
24
- code += " for #{record} in #{table.records_variable_name}\n"
25
- code += " csv << [#{columns_to_array(table, :body, :record=>record, :iconv=>'ic').join(', ')}]\n"
26
- code += " end\n"
27
- code += "end\n"
28
- code += "send_data(data, :type=>#{self.mime_type.to_s.inspect}, :disposition=>'inline', :filename=>#{table.model.name}.model_name.human.gsub(/[^a-z0-9]/i,'_')+'.#{self.file_extension}')\n"
21
+ encoding = "CP1252"
22
+ code << "data = ActiveList::CSV.generate(:col_sep=>';') do |csv|\n"
23
+ code << " csv << [#{columns_to_array(table, :header, :encoding => '#{encoding}').join(', ')}]\n"
24
+ code << " for #{record} in #{table.records_variable_name}\n"
25
+ code << " csv << [#{columns_to_array(table, :body, :record=>record, :encoding => '#{encoding}').join(', ')}]\n"
26
+ code << " end\n"
27
+ code << "end\n"
28
+ code << "send_data(data, :type => #{self.mime_type.to_s.inspect}, :disposition => 'inline', :filename => #{table.model.name}.model_name.human.gsub(/[^a-z0-9]/i,'_')+'.#{self.file_extension}')\n"
29
29
  return code
30
30
  end
31
31
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: active-list
3
3
  version: !ruby/object:Gem::Version
4
4
  version: !binary |-
5
- NC4xLjg=
5
+ NC4yLjA=
6
6
  prerelease:
7
7
  platform: ruby
8
8
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-09 00:00:00.000000000 Z
13
+ date: 2013-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails