Module: ActiveFiles

Defined in:
lib/active_files.rb

Defined Under Namespace

Modules: Record Classes: FileNotFound, NoFileId

Constant Summary collapse

VERSION =

:stopdoc:

'0.1.0'
LIBPATH =
::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
@@base_dir =
nil
@@ext =
'.yaml'

Class Method Summary collapse

Class Method Details

.base_dirObject

Accessor! Find out your ActiveFiles directory.



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

def self.base_dir
  @@base_dir
end

.base_dir=(dir) ⇒ Object

This should definitely be used right off the bat, like so:

ActiveFiles.base_dir = '/dir/where/I/store/files'

This is where all your ActiveFiles files will be loaded from and saved to.



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

def self.base_dir=(dir)
  FileUtils.mkdir_p dir
  @@base_dir = dir
end

.extObject

Accessor! Get your ActiveFiles file extension.



47
48
49
# File 'lib/active_files.rb', line 47

def self.ext
  @@ext
end

.ext=(ext) ⇒ Object

Probably never used, but you can change the default ActiveFiles extension, which is “.yaml”.



42
43
44
# File 'lib/active_files.rb', line 42

def self.ext=(ext)
  @@ext = ext
end

.versionObject

:startdoc:



17
18
19
# File 'lib/active_files.rb', line 17

def self.version
  VERSION
end