Method: Bookfile::BookPackage#prepare
- Defined in:
- lib/bookfile/package/package.rb
#prepare(unzip_dir) ⇒ Object
change to require - why, why not??
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/bookfile/package/package.rb', line 71 def prepare( unzip_dir ) ## change to require - why, why not?? puts "auto-require/include book scripts in '#{unzip_dir}/_scripts'" files = Dir["#{unzip_dir}/_scripts/**/*.rb"] pp files files.each_with_index do |file,idx| ## todo/check: check for exceptions??? puts " [#{idx+1}/#{files.count}] try auto-require '#{file}'..." require file end ## include Hytext::Helper or use HytextHelper ?? ## include Bookfile::Helper or use BookfileHelper ?? ## check Rails example names for helper modules ## get Helper module name from book template name ??? =begin res = require 'worlddb/models' if res puts " include WorldDb::Models" Builder.send :include, WorldDb::Models ## PageCtx.send :include, WorldDb::Models ## BookCtx.send :include, WorldDb::Models ## also add to xxxx ??? ## (possible to include as globals ???? how - Object.send :include ???) or ## Module.send :include ?? else ## find a better check - check for constants defined??? if not define??? ## or use constant_missing handler??? puts " assume WorldDb::Models already included ??" end =end end |