Module: Sinatra::Hexacta
- Included in:
- AlertHelper, ChartsHelper, ConstantHandler, CrossOriginHandler, ErrorHandler, InputHelper, LibrariesHelper, MenuHelper, NotificationHandler, ProcessesHandler, ReportHandler, ReportHelper, UserConfigurationHandler, UserConfigurationHelper
- Defined in:
- lib/sinatra/hexacta.rb
Constant Summary collapse
- GEM_FILE_DIR =
"sinatra-hexacta"
Instance Method Summary collapse
- #copy_all_files(original_path, link_path) ⇒ Object
- #copy_dir_structure(original_path, destination_path) ⇒ Object
- #copy_file(original_path, link_path) ⇒ Object
- #gem_path ⇒ Object
- #setup_dir(path) ⇒ Object
Instance Method Details
#copy_all_files(original_path, link_path) ⇒ Object
22 23 24 25 26 |
# File 'lib/sinatra/hexacta.rb', line 22 def copy_all_files(original_path, link_path) Dir.foreach("#{gem_path}#{original_path}") do |child| copy_file("#{original_path}/#{child}","#{link_path}/#{child}") unless child == '.' || child == '..' end end |
#copy_dir_structure(original_path, destination_path) ⇒ Object
32 33 34 |
# File 'lib/sinatra/hexacta.rb', line 32 def copy_dir_structure(original_path, destination_path) FileUtils.copy_entry("#{gem_path}#{original_path}", destination_path) end |
#copy_file(original_path, link_path) ⇒ Object
18 19 20 |
# File 'lib/sinatra/hexacta.rb', line 18 def copy_file(original_path, link_path) IO.copy_stream("#{gem_path}#{original_path}",link_path) unless File.exist?(link_path) && FileUtils.compare_file("#{gem_path}#{original_path}",link_path) end |
#gem_path ⇒ Object
14 15 16 |
# File 'lib/sinatra/hexacta.rb', line 14 def gem_path File.("../..",__dir__) end |
#setup_dir(path) ⇒ Object
28 29 30 |
# File 'lib/sinatra/hexacta.rb', line 28 def setup_dir(path) FileUtils.mkdir_p path end |