eco-helpers 0.6.8 → 0.6.9

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
  SHA1:
3
- metadata.gz: 0e58350f64df3d047b936f8402176ffdb1d46f03
4
- data.tar.gz: 1cc1332c7b32fabb925aceb5c9e9faa2a8d4437a
3
+ metadata.gz: a4077d63348b8ec7af402d3d9a410392eda90aad
4
+ data.tar.gz: 9be53c478c67b022e12e55cc77acca57c592a52e
5
5
  SHA512:
6
- metadata.gz: 7bd72edae894d015e9dcb0f728695a9d85e78f6d8d6d4bfc439c750249f620adcfd497b8705a1942faf006cc0df977b82bc06409a9169183417f67b90254568e
7
- data.tar.gz: 333eda620a91b533ba18be046bc9f72ec9a0bdde3ff5b5c94f06a6bfbadaadbe1f191c08d2852ee4024ba540139fbda4747d4690b88dc479dc88b31878f2f6a9
6
+ metadata.gz: 63beb34156723095b8c3c1a72acf28608f35467defac8f2e97a1c3a7cd97ce9d9e6dec66d60128168544ecc964582fca4c153d944e3d316af96df6659810002e
7
+ data.tar.gz: 64f63702ae2330a7ebe7a1a7aa67579c513c56ccf35a4de03019bfca89119345f4639d3625bf1a891d95de563765631959cfed8609efd1a4a4c874b3cc8845e3
@@ -20,7 +20,24 @@ module Eco
20
20
  CSV.open(file, "w") do |csv|
21
21
  deps = {"supervisor_id" => {people: people}}
22
22
  entry = session.new_entry(people.first, dependencies: deps)
23
- csv << entry.to_hash.keys
23
+ header = entry.to_hash.keys
24
+
25
+ if options.dig(:nice_header)
26
+ name_maps = session.schema.fields_by_alt_id.transform_values do |fld|
27
+ fld.name
28
+ end.merge({
29
+ "policy_group_ids" => "User Group(s)",
30
+ "email" => "Email",
31
+ "name" => "Name",
32
+ "supervisor_id" => "Manager ID",
33
+ "filter_tags" => "Locations",
34
+ "default_tag" => "Default Location",
35
+ "id" => "ecoPortal ID"
36
+ })
37
+ header = header.map {|name| name_maps[name] ? name_maps[name] : name}
38
+ end
39
+
40
+ csv << header
24
41
  people.each do |person|
25
42
  csv << session.new_entry(person, dependencies: deps).to_hash.values
26
43
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "0.6.8"
2
+ VERSION = "0.6.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura