Module: HsdsTransformer::FilePaths

Included in:
BaseTransformer
Defined in:
lib/hsds_transformer/file_paths.rb

Constant Summary collapse

DEFAULT_OUTPUT_PATH =
"#{ENV["ROOT_PATH"]}/tmp"
DEFAULT_INPUT_PATH =
"#{ENV["ROOT_PATH"]}/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#datapackage_json_pathObject (readonly)

Returns the value of attribute datapackage_json_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def datapackage_json_path
  @datapackage_json_path
end

#input_pathObject (readonly)

Returns the value of attribute input_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def input_path
  @input_path
end

#output_accessibility_for_disabilities_pathObject (readonly)

Returns the value of attribute output_accessibility_for_disabilities_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_accessibility_for_disabilities_path
  @output_accessibility_for_disabilities_path
end

#output_contacts_pathObject (readonly)

Returns the value of attribute output_contacts_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_contacts_path
  @output_contacts_path
end

#output_data_pathObject (readonly)

Returns the value of attribute output_data_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_data_path
  @output_data_path
end

#output_datapackage_pathObject (readonly)

Returns the value of attribute output_datapackage_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_datapackage_path
  @output_datapackage_path
end

#output_eligibilities_pathObject (readonly)

Returns the value of attribute output_eligibilities_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_eligibilities_path
  @output_eligibilities_path
end

#output_languages_pathObject (readonly)

Returns the value of attribute output_languages_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_languages_path
  @output_languages_path
end

#output_locations_pathObject (readonly)

Returns the value of attribute output_locations_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_locations_path
  @output_locations_path
end

#output_organizations_pathObject (readonly)

Returns the value of attribute output_organizations_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_organizations_path
  @output_organizations_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_path
  @output_path
end

#output_phones_pathObject (readonly)

Returns the value of attribute output_phones_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_phones_path
  @output_phones_path
end

#output_physical_addresses_pathObject (readonly)

Returns the value of attribute output_physical_addresses_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_physical_addresses_path
  @output_physical_addresses_path
end

#output_postal_addresses_pathObject (readonly)

Returns the value of attribute output_postal_addresses_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_postal_addresses_path
  @output_postal_addresses_path
end

#output_regular_schedules_pathObject (readonly)

Returns the value of attribute output_regular_schedules_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_regular_schedules_path
  @output_regular_schedules_path
end

#output_service_areas_pathObject (readonly)

Returns the value of attribute output_service_areas_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_service_areas_path
  @output_service_areas_path
end

#output_service_taxonomies_pathObject (readonly)

Returns the value of attribute output_service_taxonomies_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_service_taxonomies_path
  @output_service_taxonomies_path
end

#output_services_at_locations_pathObject (readonly)

Returns the value of attribute output_services_at_locations_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_services_at_locations_path
  @output_services_at_locations_path
end

#output_services_pathObject (readonly)

Returns the value of attribute output_services_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_services_path
  @output_services_path
end

#output_taxonomies_pathObject (readonly)

Returns the value of attribute output_taxonomies_path.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def output_taxonomies_path
  @output_taxonomies_path
end

#zipfile_nameObject (readonly)

Returns the value of attribute zipfile_name.



6
7
8
# File 'lib/hsds_transformer/file_paths.rb', line 6

def zipfile_name
  @zipfile_name
end

Instance Method Details

#set_file_paths(args) ⇒ Object

TODO DRY this up



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/hsds_transformer/file_paths.rb', line 14

def set_file_paths(args)
  @input_path = args[:input_path] || DEFAULT_INPUT_PATH
  @output_path = args[:output_path] || DEFAULT_OUTPUT_PATH
  @output_datapackage_path = File.join(output_path, "datapackage")
  @output_data_path = File.join(output_datapackage_path, "data")
  @zipfile_name = File.join(output_path, "datapackage.zip")

  @output_organizations_path = output_data_path + "/organizations.csv"
  @output_locations_path = output_data_path + "/locations.csv"
  @output_services_path = output_data_path + "/services.csv"
  @output_phones_path = output_data_path + "/phones.csv"
  @output_physical_addresses_path = output_data_path + "/physical_addresses.csv"
  @output_postal_addresses_path = output_data_path + "/postal_addresses.csv"
  @output_services_at_locations_path = output_data_path + "/services_at_location.csv"
  @output_eligibilities_path = output_data_path + "/eligibility.csv"
  @output_contacts_path = output_data_path + "/contacts.csv"
  @output_languages_path = output_data_path + "/languages.csv"
  @output_accessibility_for_disabilities_path = output_data_path + "/accessibility_for_disabilities.csv"
  @output_taxonomies_path = output_data_path + "/taxonomy.csv"
  @output_service_taxonomies_path = output_data_path + "/services_taxonomy.csv"
  @output_regular_schedules_path = output_data_path + "/regular_schedules.csv"
  @output_service_areas_path = output_data_path + "/service_areas.csv"

  @datapackage_json_path = File.join(ENV["ROOT_PATH"], "lib/datapackage/datapackage.json")
end