What is the basic setup on SVN to work on a Rails app? - ruby-on-rails

Lets say, I setup my svn host, like: http://www.example.com/svn
Then I create my project at a folder like: /home/me/workspace/my_app
I want to Setup my svn client and ignore files like tmp/* log/* db/schema.rb and such, so what are the commands on console for that? If possible can you write what the full sequence of commands to set this up?
obs: I have found no GUI that suit my needs on Ubuntu kdesvn / rapidsvn :(

Using TortoiseSVN, you could simply use the ignore menu item, but I guess you're not using a GUI.
You can ignore single files by executing this in the containing directory:
svn propset svn:ignore filename .
Replace filename by the filename you want to ignore. This can also be a wildcard expression like *.suo. It can also be a directory like tmp.

you can define the prop svn:ignore
so in your directory where you want ignore file made :
svn propedit svn:ignore .
An editor is open an add your information into. Close it and your file are ignore

Related

How to overwrite sphinx/locale/{language}/LC_MESSAGES/sphinx.po?

I'd like to overwrite admonition labels.
Admonitions are directives such as note, warning, and so on.
For Japanese, the labels are defined in
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/locale/ja/LC_MESSAGES/sphinx.po.
Is there a simple way to overwrite them without changing the master repository?
Here is what works for me (tested with Sphinx 3.3.1):
Copy the Japanese sphinx.po from <sphinx_install_dir>/sphinx/locale/ja/LC_MESSAGES/
to <your_sphinx_proj>/locales/ja/LC_MESSAGES/.
Note the directory name locales (the default value of the locale_dirs configuration option).
Edit msgstr for the relevant entries (admonitions in this case) in the copy of sphinx.po.
It is not necessary to keep the entire copy. You can remove the unchanged entries if you want.
Run sphinx-build with language=ja (set it in conf.py or on the command line). A local project-specific sphinx.mo file is generated and used in the build.
This means that there will be two *.mo files for the same domain ("sphinx"). The local sphinx.mo is consulted first, and the original sphinx.mo that comes with Sphinx is used as the fallback.

how to find and deploy the correct files with Bazel's pkg_tar() in Windows?

please take a look at the bin-win target in my repository here:
https://github.com/thinlizzy/bazelexample/blob/master/demo/BUILD#L28
it seems to be properly packing the executable inside a file named bin-win.tar.gz, but I still have some questions:
1- in my machine, the file is being generated at this directory:
C:\Users\John\AppData\Local\Temp_bazel_John\aS4O8v3V\execroot__main__\bazel-out\x64_windows-fastbuild\bin\demo
which makes finding the tar.gz file a cumbersome task.
The question is how can I make my bin-win target to move the file from there to a "better location"? (perhaps defined by an environment variable or a cmd line parameter/flag)
2- how can I include more files with my executable? My actual use case is I want to supply data files and some DLLs together with the executable. Should I use a filegroup() rule and refer its name in the "srcs" attribute as well?
2a- for the DLLs, is there a way to make a filegroup() rule to interpret environment variables? (e.g: the directories of the DLLs)
Thanks!
Look for the bazel-bin and bazel-genfiles directories in your workspace. These are actually junctions (directory symlinks) that Bazel updates after every build. If you bazel build //:demo, you can access its output as bazel-bin\demo.
(a) You can also set TMP and TEMP in your environment to point to e.g. c:\tmp. Bazel will pick those up instead of C:\Users\John\AppData\Local\Temp, so the full path for the output directory (that bazel-bin points to) will be c:\tmp\aS4O8v3V\execroot\__main__\bazel-out\x64_windows-fastbuild\bin.
(b) Or you can pass the --output_user_root startup flag, e.g. bazel--output_user_root=c:\tmp build //:demo. That will have the same effect as (a).
There's currently no way to get rid of the _bazel_John\aS4O8v3V\execroot part of the path.
Yes, I think you need to put those files in pkg_tar.srcs. Whether you use a filegroup() rule is irrelevant; filegroup just lets you group files together, so you can refer to the group by name, which is useful when you need to refer to the same files in multiple rules.
2.a. I don't think so.

Windows 7 - Add Path

I need to add a new path (sumatraPDF) on my PATH variable.
I don't know why it does not work...
I think everything is right but when I try to execute sumatrapdf.exe from CMD it cannot find the program.
This is what I did:
The path is correct, I checked it 1000 times.
The idea is use LaTeX with sublimetext and when I save a .text file sumatra has to open and show to me the result. If I want that I have to add the path of SumatraPDF... but it does not work.
I think you are editing something in the windows registry but that has no effect on the path.
Try this:
How to Add, Remove or Edit Environment variables in Windows 7
the variable of interest is the PATH
also you can type on the command line:
Set PATH=%PATH%;(your new path);
Another method that worked for me on Windows 7 that did not require administrative privileges:
Click on the Start menu, search for "environment," click "Edit environment variables for your account."
In the window that opens, select "PATH" under "User variables for username" and click the "Edit..." button. Add your new path to the end of the existing Path, separated by a semi-colon (%PATH%;C:\Python27;...;C:\NewPath). Click OK on all the windows, open a new CMD window, and test the new variable.
I founded the problem:
Just insert the folder without the executable file.
so Instead of:
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe
you have to write this:
C:\Program Files (x86)\SumatraPDF\
In answer to the OP:
The PATH environment variable specifies which folders Windows will search in, in order to find such files as executable programs or DLLs. To make your Windows installation find your program, you specify the folder that the program resides in, NOT the program file itself!
So, if you want Windows to look for executables (or other desired files) in the folder:
C:\PHP
because, for example, you want to install PHP manually, and choose that folder into which to install PHP, then you add the entry:
C:\PHP
to your PATH environment variable, NOT an entry such as "C:\PHP\php.exe".
Once you've added the folder entry to your PATH environment variable, Windows will search that folder, and will execute ANY named executable file you specify, if that file happens to reside in that folder, just the same as with all the other existing PATH entries.
Before editing your PATH variable, though, protect yourself against foul ups in advance. Copy the existing value of the PATH variable to a Notepad file, and save it as a backup. If you make a mistake editing PATH, you can simply revert to the previous version with ease if you take this step.
Once you've done that, append your desired path entries to the text (again, I suggest you do this in Notepad so you can see what you're doing - the Windows 7 text box is a pain to read if you have even slight vision impairment), then paste that text into the Windows text box, and click OK.
Your PATH environment variable is a text string, consisting of a list of folder paths, each entry separated by semicolons. An example has already been given by someone else above, such as:
C:\Program Files; C:\Winnt; C:\Winnt\System32
Your exact version may vary depending upon your system.
So, to add "C:\PHP" to the above, you change it to read as follows:
C:\Program Files; C:\Winnt; C:\Winnt\System32; C:\PHP
Then you copy & paste that text into the windows dialogue box, click OK, and you should now have a new PATH variable, ready to roll. If your changes don't take effect immediately, you can always restart the computer.
The path is a list of directories where the command prompt will look for executable files, if it can't find it in the current directory. The OP seems to be trying to add the actual executable, when it just needs to specify the path where the executable is.
Try this in cmd:
cd address_of_sumatrapdf.exe_file && sumatrapdf.exe
Where you should put the address of your .exe file instead of adress_of_sumatrapdf.exe_file.

SCP Jenkins Plugin does not copy selectively

I want to copy only specific files in a directory to remote server using Jenkins SCP Plugin.
I have folder structure /X/Y/...Under Y, I need only the files a b c among a b c d e f. Is this possible...?
Of course, to copy all files all you need is X/Y/**. But what about copying selectively.
I was reading somewhere that this is a kind of bug in the plugin.
I have string parameter, $FILES=x,y,z highlighted in "BUILD WITH PARAMETERS"
SCP Configuration:
Source: some/path/$FILES (relative to $WORKSPACE)
Destination: /var/lib/some/path
You should be able to say X/Y/a; X/Y/b; X/Y/c
Also remember that these files have to be under the job's ${WORKSPACE}
Alternatively, you can have another build step in-between that copies only the files that you want into a staging folder, and then supplying the staging folder to SCP plugin
Edit after OP clarification:
Your $FILES variable contains x,y,z When you supply this as Source to SCP plugin, it becomes:
some/path/x,y,z
Or if we break this one item per line:
some/path/x
y
z
The first item is valid, the next two are not complete paths, therefore are not found.
Several ways to fix it (chose either one):
Full path in parameter variable.
Under your FILES string parameter, list the full path, like:
some/path/x, some/path/y, some/path/z
Under SCP Source, use only $FILES
pros: quick and stable.
cons: looks ugly with long paths.
Wildcard path in parameter variables.
Under your FILES string parameter, list the global wildcard path (files will be found under any directory), like:
**/x, **/y, **/z
Under SCP Source, use only $FILES
pros: quick and looks better than long paths.
cons: only works if files x, y and z are unique in your whole workspace. If there is $WORKSPACE/x and $WORKSPACE/some/path/x, one will end up overwriting the other.
Prepare MYFILES variable and inject it.
You need an Execute Shell build step added. In there write the following:
mypath=some/path/
echo MYFILES=${mypath}${files//,/,$mypath} > myfiles.props
Then add Inject environment variables build step (get the plugin in the link). Under Properties File Path, specify myfiles.props.
Under SCP Source, use only $MYFILES (note you are reading modified and injected variable, not the original $FILES)
pros: looks good in UI, proper and further customizable.
cons: more build steps to maintain in configuration.
p.s.
In all these cases, a multi select Extended Choice Parameter will probably look better than a string parameter.

Replacing dos executable names with custom short names?

I've been using the command prompt to practice assembly programs and I wish to use notepad++ as the editor. Adding notepad++ to the path will do the job but I don't want to type 'notepad++' each time I have to edit a file. Is there a way I can change the name of the executable? Without having to rename the application name.
You could create a quick batch file called, say, npp.cmd. That batch file only needs to have this in it:
#"C:\Program Files (x86)\Notepad++\notepad++.exe" %*
Put npp.cmd somewhere in your path (I have a C:\tools directory for batch files like this) and off you go.
Or associate your assembler sources with Notepad++.
ASSOC .asm=asmfile
FTYPE asmfile="C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
Then you can edit *.asm files with Notepad++ by double clicking on it in Explorer or by writing it's name in command prompt.

Resources