209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
# File 'lib/ruby_app/session.rb', line 209
def self.get_scripts(path = String.interpolate { RubyApp::Session.configuration.scripts.path })
scripts = []
Dir.new(path).each do |item|
unless item.start_with?('.')
_path = File.join(path, item)
if File.directory?(_path)
scripts += self.get_scripts(_path)
elsif _path =~ /\.rb/
name = _path.gsub(String.interpolate { RubyApp::Session.configuration.scripts.path }, '').gsub(/^\//, '').gsub(/\.rb/, '')
scripts.push({:name => name,
:url => "#{RubyApp::Application.root_or_nil}/quit?go=#{CGI.escape("#{RubyApp::Application.root}?script=#{name}")}"})
end
end
end
return scripts.sort { |a, b| a.name <=> b.name }
end
|