Module: Ekylibre

Defined in:
lib/ekylibre/plugin.rb,
lib/ekylibre.rb,
lib/ekylibre/job.rb,
lib/ekylibre/hook.rb,
lib/ekylibre/export.rb,
lib/ekylibre/record.rb,
lib/ekylibre/secret.rb,
lib/ekylibre/schema.rb,
lib/ekylibre/tenant.rb,
lib/ekylibre/access.rb,
lib/ekylibre/snippet.rb,
lib/ekylibre/version.rb,
lib/ekylibre/support.rb,
lib/ekylibre/job/base.rb,
lib/ekylibre/reporting.rb,
lib/ekylibre/first_run.rb,
lib/ekylibre/navigation.rb,
lib/ekylibre/tele/idele.rb,
lib/ekylibre/record/base.rb,
lib/ekylibre/access/right.rb,
lib/ekylibre/support/tree.rb,
lib/ekylibre/schema/column.rb,
lib/ekylibre/support/lister.rb,
lib/ekylibre/navigation/dsl.rb,
lib/ekylibre/first_run/base.rb,
lib/ekylibre/record/bookkeep.rb,
lib/ekylibre/navigation/tree.rb,
lib/ekylibre/navigation/node.rb,
lib/ekylibre/navigation/page.rb,
lib/ekylibre/first_run/faker.rb,
lib/ekylibre/record/has_shape.rb,
lib/ekylibre/first_run/folder.rb,
lib/ekylibre/first_run/booker.rb,
lib/ekylibre/first_run/counter.rb,
lib/ekylibre/corporate_identity.rb,
lib/ekylibre/tele/idele/generator.rb,
lib/ekylibre/export/open_document.rb,
lib/ekylibre/corporate_identity/visual.rb,
app/exchangers/ekylibre/zones_exchanger.rb,
app/exchangers/ekylibre/backup_exchanger.rb,
app/exchangers/ekylibre/workers_exchanger.rb,
app/exchangers/ekylibre/matters_exchanger.rb,
app/exchangers/ekylibre/animals_exchanger.rb,
app/exchangers/ekylibre/budgets_exchanger.rb,
app/exchangers/ekylibre/variants_exchanger.rb,
lib/ekylibre/export/accountancy_spreadsheet.rb,
app/exchangers/ekylibre/equipments_exchanger.rb,
app/exchangers/ekylibre/activities_exchanger.rb,
lib/ekylibre/export/open_document/spreadsheet.rb,
app/exchangers/ekylibre/animal_groups_exchanger.rb,
app/exchangers/ekylibre/bank_statements_exchanger.rb,
app/exchangers/ekylibre/cultivable_zones_exchanger.rb,
app/exchangers/ekylibre/incoming_payments_exchanger.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, Navigation, Record, Reporting, Schema, Secret, Support, Tele Classes: ActivitiesExchanger, AnimalGroupsExchanger, AnimalsExchanger, BackupExchanger, BankStatementsExchanger, BudgetsExchanger, BuildingsJsonExchanger, CultivableZonesExchanger, CultivableZonesJsonExchanger, EntitiesExchanger, EquipmentsExchanger, EquipmentsJsonExchanger, 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


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/ekylibre.rb', line 50

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 }
        unless help[:title].blank?
          @helps[locale][path.to_s.gsub(/\.txt$/, '')] = help
        end
      end
    end
  end
  @helps
end

.http_languagesObject


21
22
23
24
25
26
# File 'lib/ekylibre.rb', line 21

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

.rootObject

Return root path of Ekylibre


29
30
31
# File 'lib/ekylibre.rb', line 29

def root
  Rails.root
end

.themesObject

Returns list of themes


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

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

.versionObject

Returns Ekylibre Version


34
35
36
# File 'lib/ekylibre.rb', line 34

def version
  Ekylibre::VERSION
end