This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### i need to add another condition in on the Dir.entries, so that directories do not print out | |
### having no luck with File.stat(x)file? or File.file?....etc | |
get '/entry' do | |
list = Dir["/vagrant/TestRails/RubyPractice/RailsGirls/**/*"] | |
list.each do |dir| | |
if File.directory?(dir) | |
puts "Directory: #{dir}\n" | |
Dir.entries(dir).reject { |x| p "Entry: #{x}" if x =~ /^[^.].*$/ } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# netstat -anp | |
Active UNIX domain sockets (servers and established) | |
Proto RefCnt Flags Type State I-Node PID/Program name Path | |
unix 2 [ ] DGRAM 20453 2767/systemd /run/user/1000/systemd/notify | |
unix 2 [ ACC ] STREAM LISTENING 20454 2767/systemd /run/user/1000/systemd/private | |
unix 2 [ ACC ] SEQPACKET LISTENING 9974 1/init /run/udev/control | |
unix 2 [ ACC ] STREAM LISTENING 17042 1294/postgres /var/run/postgresql/.s.PGSQL.5432 | |
unix 2 [ ACC ] STREAM LISTENING 9780 1/init /run/systemd/private | |
unix 2 [ ACC ] STREAM LISTENING 9790 1/init /run/systemd/fsck.progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Attempt to use rack/reverse proxy to serve up files upon request that exist outside site root | |
# The full address for the files /vagrant/TestRails/Music/various-subdirectories | |
# You can see below the Sinatra route which uses the splat. | |
# I'm confused as to what should be in the reverse_proxy line, having tried a number of different variations | |
# Sinatra route | |
get '/file/*' do | |
slim :search_results | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Song < Sequel::Model | |
plugin :validation_helpers | |
self.raise_on_save_failure | |
def validate | |
super | |
validates_presence [:title, :length, :released_on, :lyrics] | |
end | |
end |
NewerOlder