Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
How can I navigate back one or multiple directories in Ruby?
For example:
users/luigi/test/folder/file.rb
If I'm in the folder directory and want my file.rb script to load a file from within the test directory, how can I do that?
Something like:
require /../required_file.rb
You can use require_relative
require_relative "../test/file.rb"
require_relative "../requred_file.rb"
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
This is how I am changing the directory path to the download folder.
Dir.chdir("C:/Users/abcd/Downloads/")
But this specific to a user. Is there is any way to make it more general?
Use home method for Dir
Dir.chdir(Dir.home + '/Downloads')
The "C:/Users/abcd/Downloads/" looks like the user directory for user abcd on windows. So I think this is a windows related question.
The Dir.home on my Windows-PC is U:/, not the user-directory.
But you can make use of ENV:
Dir.chdir(File.join(ENV['USERPROFILE'], 'Downloads'))
Just to be aware of: This changes the directory for the rest of your script. There is also a block-version of Dir.chdir.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm writing a simple console app, but instead of distributing it as a script (somefile.rb), I want it as a binary file, like an executable.
Any idea?
Embedded Ruby (or better mruby) into C or C++
Simple one file with script as text.
Here is example for mruby mruby.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a little question for you :)
I want to write log files from C:/Windows to C:/mylogs.txt with ms-dos commands. But I don't know any ms-dos commands. How can I do this. Please help me !
If you only pretend to copy the content of Windows logs that are stored in the root folder of C:\Windows, then you could use the Copy command as follows:
Copy /B "%WinDir%\*.log" "C:\mylogs.txt"
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have ubuntu. I saved my file as untitled.rb print "hello"
If I build this, I see nothing in build results.
Build system is Ruby.
I believe he means running ruby code in the Sublime Text console. To do this, all you have to do is have your file (with the code) saved then press CMD + SHIFT + B and you will get something like this:
It didn't work because system's language was Russian.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I want edit the css of a component in zoomla ..can you tell me how?
Use can a text editor, VIM or Notepad. Else you can edit the CSS from the template management section inside Joomla!. But then you need to set proper permissions on the CSS file.
go to ur hosting folder .. and goto components/component_name you can find the files