Module: Card::Set::Abstract::AssetFile
- Extended by:
- Card::Set
- Defined in:
- platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb
Overview
Set: Abstract (AssetFile)
Defined Under Namespace
Modules: Format, HtmlFormat
Constant Summary
Constants included from Helpers
Helpers::SET_PATTERN_TEST_REGEXP
Constants included from Event::Api
Instance Attribute Summary collapse
-
#base_path ⇒ Object
Returns the value of attribute base_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#files_must_exist! ⇒ Object
-
#find_file(path) ⇒ Object
-
#new? ⇒ Boolean
-
#source_files ⇒ Object
-
#source_paths ⇒ Object
-
#unknown_file?(file_path) ⇒ Boolean
-
#virtual? ⇒ Boolean
Methods included from Card::Set
Methods included from I18nScope
Methods included from Registrar
#extended, #finalize_load, #process_base_modules, #register_set
Methods included from Helpers
#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name
Methods included from Card::Set::AdvancedApi
#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method
Methods included from Format
#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Instance Attribute Details
#base_path ⇒ Object
Returns the value of attribute base_path.
10 11 12 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 10 def base_path @base_path end |
Class Method Details
.source_location ⇒ Object
7 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 7 def self.source_location; "/Users/ethan/dev/decko/gem/mod/assets/set/abstract/asset_file.rb"; end |
Instance Method Details
#files_must_exist! ⇒ Object
18 19 20 21 22 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 18 def files_must_exist! source_paths.select do |path| raise Card::Error, "couldn't locate asset file: #{path}" if unknown_file? path end end |
#find_file(path) ⇒ Object
28 29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 28 def find_file path path.tap do |file_path| return nil if unknown_file? file_path end end |
#new? ⇒ Boolean
45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 45 def new? false end |
#source_files ⇒ Object
24 25 26 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 24 def source_files [db_content] end |
#source_paths ⇒ Object
12 13 14 15 16 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 12 def source_paths source_files.map do |file| ::File.join base_path, file end end |
#unknown_file?(file_path) ⇒ Boolean
34 35 36 37 38 39 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 34 def unknown_file? file_path return false if ::File.exist? file_path Rails.logger.info "couldn't locate #{file_path}" true end |
#virtual? ⇒ Boolean
41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod018-assets/abstract/asset_file.rb', line 41 def virtual? true end |