Module: Edgar

Defined in:
lib/edgar.rb,
lib/edgar/engine.rb,
app/models/edgar.rb,
lib/edgar/version.rb,
lib/edgar/enum_cache.rb,
app/models/edgar/sssn.rb,
app/models/edgar/search.rb,
app/models/edgar/address.rb,
app/models/edgar/view_status.rb,
app/models/edgar/search_form.rb,
app/helpers/edgar/list_drawer.rb,
app/models/edgar/search_popup.rb,
app/helpers/edgar/form_drawer.rb,
app/helpers/edgar/field_helper.rb,
app/helpers/edgar/popup_helper.rb,
app/helpers/edgar/record_drawer.rb,
app/helpers/edgar/addresses_helper.rb,
app/controllers/edgar/addresses_controller.rb,
app/controllers/edgar/authentication_mixin.rb,
app/controllers/edgar/controller_mixin_for_app.rb

Defined Under Namespace

Modules: AddressesHelper, AuthenticationMixin, ControllerCommon, ControllerMixinForApp, FieldHelper, FormDrawer, ListDrawer, MenuHelper, PermissionMixin, PopupHelper, RescueMixin, SessionsHelper, ZipAddressesHelper Classes: Address, AddressesController, EdgarError, Engine, EnumCache, ModelPermission, ModelPermissionsController, PopupModelNameError, RecordDrawer, ScaffoldGenerator, Search, SearchForm, SearchPopup, Sssn, SssnsController, User, UserGroup, UserGroupUser, UserGroupUsersController, UserGroupsController, UsersController, ViewStatus, ZipAddress, ZipAddressesController

Constant Summary

WORK_DIR =

Edgar related work directory under Rails.root/tmp

'tmp/edgar'
CSV_DIR =

csv download work directory. Files under this directory should be deleted periodically. See git-commit d1c741f761a4f43c4d84287fd9eaf4def76ff883

WORK_DIR + '/csv_download'
CSV_DELETE_DELAY =

csv work files will be deleted after this.

10
LINES_PER_PAGE =
min.
[2, 5, 10,20,50,100,200].freeze
LIST_TEXT_MAX_LEN =
20
VERSION =
"0.02.00"

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) delete_stale_work_files

delete old Edgar work files (like csv_download)



21
22
23
24
25
26
27
28
29
# File 'lib/edgar.rb', line 21

def delete_stale_work_files
  t = Time.now - CSV_DELETE_DELAY.minutes
  for file in Dir.glob(Rails.root + CSV_DIR + '**/*') do
    if File.file?(file) && File.stat(file).mtime < t
      print "deleting #{file}...\n"
      File.unlink(file)
    end
  end
end

+ (Object) table_name_prefix



2
3
4
# File 'app/models/edgar.rb', line 2

def self.table_name_prefix
  'edgar_'
end

Instance Method Details

- (Object) delete_stale_work_files (private)

delete old Edgar work files (like csv_download)



21
22
23
24
25
26
27
28
29
# File 'lib/edgar.rb', line 21

def delete_stale_work_files
  t = Time.now - CSV_DELETE_DELAY.minutes
  for file in Dir.glob(Rails.root + CSV_DIR + '**/*') do
    if File.file?(file) && File.stat(file).mtime < t
      print "deleting #{file}...\n"
      File.unlink(file)
    end
  end
end