Module: Ekylibre

Defined in:
lib/ekylibre/plugin.rb,
lib/ekylibre.rb,
lib/ekylibre/job.rb,
lib/ekylibre/hook.rb,
lib/ekylibre/view.rb,
lib/ekylibre/abaci.rb,
lib/ekylibre/model.rb,
lib/ekylibre/access.rb,
lib/ekylibre/export.rb,
lib/ekylibre/record.rb,
lib/ekylibre/schema.rb,
lib/ekylibre/secret.rb,
lib/ekylibre/tenant.rb,
lib/ekylibre/snippet.rb,
lib/ekylibre/support.rb,
lib/ekylibre/version.rb,
lib/ekylibre/job/base.rb,
lib/ekylibre/extension.rb,
lib/ekylibre/first_run.rb,
lib/ekylibre/reporting.rb,
lib/ekylibre/bookkeeper.rb,
lib/ekylibre/navigation.rb,
lib/ekylibre/view/addon.rb,
lib/ekylibre/record/base.rb,
lib/ekylibre/record/sums.rb,
lib/ekylibre/access/right.rb,
lib/ekylibre/support/tree.rb,
lib/ekylibre/schema/column.rb,
lib/ekylibre/first_run/base.rb,
lib/ekylibre/navigation/dsl.rb,
lib/ekylibre/support/lister.rb,
lib/ekylibre/first_run/faker.rb,
lib/ekylibre/navigation/node.rb,
lib/ekylibre/navigation/page.rb,
lib/ekylibre/navigation/tree.rb,
lib/ekylibre/record/autosave.rb,
lib/ekylibre/record/bookkeep.rb,
lib/ekylibre/first_run/booker.rb,
lib/ekylibre/first_run/folder.rb,
lib/ekylibre/record/has_shape.rb,
lib/ekylibre/first_run/counter.rb,
lib/ekylibre/record/dependents.rb,
lib/ekylibre/corporate_identity.rb,
lib/ekylibre/export/open_document.rb,
lib/ekylibre/first_run/faker/base.rb,
lib/ekylibre/record/acts/numbered.rb,
lib/ekylibre/first_run/faker/sales.rb,
lib/ekylibre/record/acts/protected.rb,
lib/ekylibre/testing/spec_reporter.rb,
lib/ekylibre/first_run/faker/crumbs.rb,
lib/ekylibre/record/acts/affairable.rb,
lib/ekylibre/testing/bookkeep/entry.rb,
lib/ekylibre/record/acts/reconcilable.rb,
lib/ekylibre/record/selects_among_all.rb,
lib/ekylibre/corporate_identity/visual.rb,
lib/ekylibre/testing/bookkeep/recorder.rb,
lib/ekylibre/testing/fixture_retriever.rb,
app/exchangers/ekylibre/sales_exchanger.rb,
app/exchangers/ekylibre/zones_exchanger.rb,
app/exchangers/ekylibre/backup_exchanger.rb,
app/exchangers/ekylibre/plants_exchanger.rb,
app/exchangers/ekylibre/animals_exchanger.rb,
app/exchangers/ekylibre/budgets_exchanger.rb,
app/exchangers/ekylibre/matters_exchanger.rb,
app/exchangers/ekylibre/visuals_exchanger.rb,
app/exchangers/ekylibre/workers_exchanger.rb,
lib/ekylibre/testing/bookkeeper_test_case.rb,
app/exchangers/ekylibre/accounts_exchanger.rb,
app/exchangers/ekylibre/entities_exchanger.rb,
app/exchangers/ekylibre/pictures_exchanger.rb,
app/exchangers/ekylibre/settings_exchanger.rb,
app/exchangers/ekylibre/variants_exchanger.rb,
lib/ekylibre/first_run/faker/interventions.rb,
lib/ekylibre/first_run/faker/prescriptions.rb,
lib/ekylibre/testing/application_test_case.rb,
app/exchangers/ekylibre/purchases_exchanger.rb,
lib/ekylibre/export/accountancy_spreadsheet.rb,
app/exchangers/ekylibre/activities_exchanger.rb,
app/exchangers/ekylibre/equipments_exchanger.rb,
app/exchangers/ekylibre/georeadings_exchanger.rb,
lib/ekylibre/export/open_document/spreadsheet.rb,
lib/ekylibre/testing/concerns/fixtures_module.rb,
app/exchangers/ekylibre/land_parcels_exchanger.rb,
app/exchangers/ekylibre/animal_groups_exchanger.rb,
app/exchangers/ekylibre/interventions_exchanger.rb,
app/exchangers/ekylibre/buildings_json_exchanger.rb,
app/exchangers/ekylibre/bank_statements_exchanger.rb,
app/exchangers/ekylibre/cash_transferts_exchanger.rb,
app/exchangers/ekylibre/equipments_json_exchanger.rb,
app/exchangers/ekylibre/cultivable_zones_exchanger.rb,
app/exchangers/ekylibre/incoming_payments_exchanger.rb,
app/exchangers/ekylibre/outgoing_payments_exchanger.rb,
lib/ekylibre/testing/application_controller_test_case.rb,
lib/ekylibre/testing/concerns/fixtures_cleaner_module.rb,
lib/ekylibre/testing/concerns/model_action_test_module.rb,
app/exchangers/ekylibre/cultivable_zones_json_exchanger.rb

Overview

FIXME: Not absolute name. Rename to ProductNatureVariantsExchanger (don't forget nomenclature)

Defined Under Namespace

Modules: Access, CorporateIdentity, Export, FirstRun, Job, Model, Navigation, Record, Reporting, Schema, Secret, Support, Testing, View Classes: Abaci, AccountsExchanger, ActivitiesExchanger, AnimalGroupsExchanger, AnimalsExchanger, BackupExchanger, BankStatementsExchanger, Bookkeeper, BudgetsExchanger, BuildingsJsonExchanger, CashTransfertsExchanger, CultivableZonesExchanger, CultivableZonesJsonExchanger, EntitiesExchanger, EquipmentsExchanger, EquipmentsJsonExchanger, Extension, ForbiddenImport, GeoreadingsExchanger, Hook, IncomingPaymentsExchanger, InterventionsExchanger, LandParcelsExchanger, MattersExchanger, OutgoingPaymentsExchanger, PicturesExchanger, PlantsExchanger, Plugin, PluginRequirementError, PurchasesExchanger, SalesExchanger, SettingsExchanger, Snippet, Tenant, TenantError, VariantsExchanger, VisualsExchanger, WorkersExchanger, ZonesExchanger

Constant Summary collapse

CSV =
::CSV.freeze
VERSION =
File.read(Rails.root.join('VERSION')).freeze

Class Method Summary collapse

Class Method Details

.helpsObject


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/ekylibre.rb', line 59

def helps
  return @helps unless @helps.nil?
  @helps = HashWithIndifferentAccess.new
  for locale in ::I18n.available_locales
    @helps[locale] = HashWithIndifferentAccess.new
    locales_dir = root.join('config', 'locales', locale.to_s, 'help')
    for file in Dir[locales_dir.join('**', '*.txt')].sort
      path = Pathname.new(file).relative_path_from(locales_dir)
      File.open(file, 'rb:UTF-8') do |f|
        help = { title: f.read[/^======\s*(.*)\s*======$/, 1].strip, name: path.to_s.gsub(/\.txt$/, ''), file: file }
        if help[:title].present?
          @helps[locale][path.to_s.gsub(/\.txt$/, '')] = help
        end
      end
    end
  end
  @helps
end

.http_languagesObject


23
24
25
26
27
28
# File 'lib/ekylibre.rb', line 23

def http_languages
  ::I18n.available_locales.each_with_object({}) do |l, h|
    h['i18n.iso2'.t(locale: l)] = l
    h
  end
end

.load_integrationsObject


50
51
52
53
54
55
# File 'lib/ekylibre.rb', line 50

def load_integrations
  Dir.glob(Rails.root.join('app', 'integrations', '**', '*.rb')).each do |file|
    require file
  end
  Ekylibre::Plugin.load_integrations
end

.rootObject

Return root path of Ekylibre


31
32
33
# File 'lib/ekylibre.rb', line 31

def root
  Rails.root
end

.themesObject

Returns list of themes


41
42
43
44
45
46
47
48
# File 'lib/ekylibre.rb', line 41

def themes
  unless @themes
    Dir.chdir(root.join('app', 'themes')) do
      @themes = Dir.glob('*')
    end
  end
  @themes
end

.versionObject

Returns Ekylibre Version


36
37
38
# File 'lib/ekylibre.rb', line 36

def version
  Ekylibre::VERSION
end