All Questions
Tagged with file-system ruby
17 questions
5
votes
1
answer
63
views
Scheduled file sorting with Ruby
I have a script running as an hourly cron job. It finds all screenshots on the Desktop and moves them to directories sorted by year/month/day.
On MacOS, screenshots are automatically saved to the ...
3
votes
1
answer
291
views
Short Ruby program that opens a random video file from a directory
I am currently learning to code in ruby. I have created a small program that iterates through a directory of video files and opens one at random. The program is fully functioning (with the odd issue). ...
3
votes
1
answer
270
views
Removing folders from my rails app with rake
I'm trying to remove the tmp/letter_opener folder. Everything works fine, just wondering if there's a better way to write it. My next step is to write some tests, ...
4
votes
1
answer
346
views
Auto move files to a sub folder with Ruby
I started writing a script to handle my file downloads in osx because they quickly pile up and it gets time consuming to do this manually by drag and drop. I am looking forward to get some feedback.
<...
3
votes
2
answers
87
views
Search utility that searches through source code files
I'm working on a search utility that searches through source files. It's only the beginning of the project. It lacks a lot of features, but a backbone of the project works and it would be great if you ...
4
votes
2
answers
74
views
Simple Ruby directory navigator functions
In the process of writing scripts to work with CSVs and other files of the like I found myself in the need of a way to navigate and select files for various purposes. I wrote the following function ...
5
votes
1
answer
825
views
Move and rename images into separate folders
Basically, we came up with this task at work. I was wondering if there's a shorter and cleaner way of doing the following in some other language (or even improving what I did with Ruby).
We have a ...
4
votes
1
answer
344
views
Ruby script to create git repos
I wrote my first ruby script, by this tutorial. It creates a local and remote git repo.
I have been working for about 3 years with PHP, and somehow I find that my ruby script looks incredibly ugly.
...
0
votes
2
answers
284
views
A platform-independent implementation of "which" in Ruby
I like to know if there's anything that I may have missed in this implementation. The method tries to provide the absolute path of the binary or script which is likely to execute based on the provided ...
3
votes
4
answers
121
views
How can I prettify blocks with more than 2 of each block?
Actually, I just have no ideas.
How can I make breaklines to make it more readable?
Can anyone suggest ways on improving this?
...
3
votes
1
answer
93
views
Return path to rubygems.rb
From the command line, I can easily find the path to rubygems.rb
$ gem which rubygems
/usr/lib/ruby/1.9.1/rubygems.rb
and ...
5
votes
1
answer
388
views
Need reviews for impacts of dirty bug fix
I was having a hard time with bug logstash#665. Hope they will fix it some day, but sparc/solaris support is probably not on top of their priority list. For further reference, original error is:
<...
9
votes
3
answers
440
views
Search for directories with a certain prefix that contain no files of a given type
These two functions search for directories with a certain prefix that contain no files of a given type.
Does the code adhere to Ruby standards and conventions?
Am I doing something the hard way or the ...
5
votes
2
answers
345
views
Shorten code that gathers files from directories
I have the following method in Ruby that appears to be just one line too long according to Ruby style guides. (Specifically: Rubocop tells me that my method has too many lines.)
Granted, I'm only one ...
2
votes
2
answers
542
views
Uploading a file from the browser
This allows users to upload an file from the browser into my Rails app using the paperclip gem. Once the file is uploaded it gets saved into the filesystem. When the user then goes in and the "show" ...