Module: BinderCore::Default

Defined in:
lib/binder_core/defaults.rb

Class Method Summary collapse

Class Method Details

.configObject

this is the default config proc



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/binder_core/defaults.rb', line 17

def self.config
  lambda do |config|
    config.add_parser BinderCore::NullParser do |cxt|
      true
    end

    config.add_parser BinderCore::TextParser do |cxt|
      %w{.txt .html .htm .json}.include? cxt.file.ext.downcase
    end

    config.add_parser BinderCore::FolderParser do |cxt|
      cxt.file.dir?
    end
  
    config.add_parser BinderCore::AssetParser do |cxt|
      %w{.jpg .jpeg .png .gif}.include? cxt.file.ext.downcase
    end
    
    config.add_rule BinderCore::NullParser do |cxt|
      cxt.file.name.start_with?(".","_")
    end
  end
end

.settingsObject



8
9
10
11
12
13
14
15
# File 'lib/binder_core/defaults.rb', line 8

def self.settings
  Settings.configure do
    config.base_asset_folder = ""
    config.base_asset_url = ""
    config.content_folder = ""
    config.folder_size_limit_mb = 100
  end
end