Include batman test_case - tdd

I am trying to implement TDD in BatmanJS, but the Batman.TestCase class is an extra. How do i include it from github in my rails app as sugested here?

Unfortunately, Batman.TestCase isn't included in any of the distributed builds for batman.js. If you want to use it, you'll have to copy the files yourself. You could get those files into your Rails project by cloning the Github repository, then copying the src/extras/testing directory into your project's app/assets/batman/extras/testing directory.
For example, you could run these commands in your terminal:
$ cd /path/to/your/projects
$ git clone git#github.com:batmanjs/batman.git
$ mkdir -p your_project/app/assets/batman/extras/testing
$ cp -R batman/src/extras/testing your_project/app/assets/batman/extras/testing
Now, you should have all the contents of that directory inside your app and TestCase should be available on your development server at /assets/extras/testing/test_case.js.
(If it isn't there, try /assets/extras/test_case.js or just /assets/test_case.js. I know Sprockets does something special with asset paths, but I can't remember what!)
By the way, I've had good luck with just jasmine for tests :) Hope this helps!

Related

Not able to build ROS package with catkin_make. Confused by package tree

I'm looking to run the main.launch stored in vehicle/launch/ from this github page
https://github.com/aureliopuebla/vehicle
I am very new at using ROS and have been learning, however I can't seem to be able to build these files.
If I try to use catkin_make on the parent folder it says that there is no existing 'src' folder.
If I go into the /vehicle folder there is a 'src' folder, but if I try to run catkin_make there, then it says that I have to run it at the root of the workspace. Which has me a bit stumped.
I have also tried to just run 'cmake ..', then 'make', and then 'sudo make install' in the /vehicle folder, but that just fills the /vehicle folder with copies of the other folders in the parent folder.
The reason why I want to build these packages is to be able to run the 'main.launch' file inside the '/vehicle/launch' folder with roslaunch, but it keeps saying that it can't find the other packages, no matter what I do.
Ready to clear up any questions. Thanks for the help.
the CMakeLists.txt in the folder is the top-level CMakeLists. So You need to make this src folder yourself.
Just do the following:
$ mkdir -p vehicle_ws && cd vehicle_ws
$ git clone https://github.com/aureliopuebla/vehicle.git
$ mv vehicle src
$ catkin_make
This way it should work. Just leave out mkdir -p vehicle_ws, if you already created a workspace and instead just cd into it.

godep: exec: "go": executable file not found in $PATH

I trying to deploy my server on heroku and I stuck on step where I should use godep, I spent little time with GO, last two days I had looking how to solve this issue, actually it's a popular issue, but I can't figure out, maybe I did something fundamentally wrong.
I have OS X 10.11.2
My GOPATH - Users/denis/Programming/Golang
My PATH - $GOPATH/bin
I trying to use godep to my project which is placed in $GOPATH/src/backend
in my PATH I have an executable godep file(not .go).
Whole structure of my workplace.
/Golang/
.bin/
godep //executable file
.pkg/
.darwin-amd64/
.//other folders/
.src/
.github.com/
.backend/
.//other folders//
First, what is the output of this:
$ echo $PATH
It should, at a minimal to run Go projects, have TWO directories in it for:
/path/to/go/installation/bin (e.g. /usr/local/go/bin)
/path/to/your/GOPATH/bin (e.g. /Users/denis/Programming/Golang/bin)
Your go's installation should be in your PATH already if you followed the Go installation setup.
https://golang.org/doc/install
Since you posted /Users/denis/Programming/Golang, with the capital U, I am going to assume that you are on OS X going forward...
In OS X, and if you used the default install, you can test for Go in your PATH with a simple command:
$ echo $PATH | grep --color=auto "/usr/local/go/bin"
It should print our your entire $PATH and highlight that you have things setup properly. This is because the OS X GoLang installer in the URL above should have modified your PATH to include:
/usr/local/go/bin
or more specifically, it may be export PATH="$PATH:/usr/local/go/bin"
If you have some custom .bashrc and/or .profile files, then most likely your PATH isn't being setup correctly. You can test this by doing this:
$ export PATH="$PATH:/usr/local/go/bin"
$ export PATH="$PATH:/Users/denis/Programming/Golang/bin"
$ godep go build
If it works now, then your PATH isn't setup properly in your .bashrc/.profile files. That's a different kind of question and can be setup a 1000 different ways and you may need to figure it out (or another SO question).
If that resolves your issue, then you need to follow the godep directions to run godep from your project's root:
$ cd $GOPATH/src/backend/
$ godep save
$ git add Godeps/
godep creates a Godeps directory in the root of the Go project. If you have multiple Go projects/multiple executables, then you need to run godep save on each root of the runtime.
IOW, for each executable you run go build for, you need to run godep save in each directory.
Also, once you move to godep, you want to use it for your build and testing as well:
$ godep go build
$ godep go test
...etc
If that's not the problem (you are running it as stated above), then please update your question with more specifics such as what godep command you are running, where, and what that directorys structure looks like for the root of that project (including the filename with package main and your func main() function).

Gemfile git branch for Beanstalk unable to bundle install

In my Gemfile I have
gem 'slim', :git => 'git://github.com/brennancheung/slim.git', :branch => 'angularjs_support'
which is a branch of the slim gem required for me to run AngularJS correctly with my views. I've pushed my code to my beanstalk application but am unable to bundle install according to the logs shown below...
sh: git: command not found
Git error: command `git clone 'git://github.com/brennancheung/slim.git'
"/usr/share/ruby/1.9/gems/1.9.1/cache/bundler/git/slim-700ed452e752ccb6baf9de9d0a46fbded8bb2da5"
--bare --no-hardlinks` in directory /var/app/ondeck has failed.
I'm new to Beanstalk and have no idea how to fix this. Any help on how to get bundle to install successfully would be greatly appreciated. Thanks.
Since git is not installed on by default on EC2 instance, you would have to find a workaround solution:
a. Install git on instance with configuration file and command.
It is the most obvious way to solve the problem, although not be the most efficient.
b. Clone slim repository into your project, so it will be deployed together.
Seems that slim is not being actively developed lately, so having the copy in your project might not be a bad idea. It protects you from github.com being down, yet you will have extra files to carry around.
c. Use configuration file and commands to pull the data from github.com directly with http.
Too many files to work with, and also dependency on third party service.
d. Use a combination of above. Clone slim repository and copy files to S3. Use configuration and commands to copy files from S3 to your instance.
It seems like the most elegant and efficient way to solve the problem.
It might look something like:
$ cat .ebextensions/myapp.config
commands:
10-copy-slim-from-s3
command: "aws s3 cp s3://mybucket/slim slim --recursive"

How to place Golang project (a set of packages) to Github?

It is not clear for me from Golang tutorial how to put Golang code to Github to be able to import that code as a package from Github later.
This is an example project-workspace (directory structure) from the Golang tutorial http://golang.org/doc/code.html:
bin/
hello # command executable
pkg/
linux_amd64/ # this will reflect your OS and architecture
github.com/user/
newmath.a # package object
src/
github.com/user/
hello/
hello.go # command source
newmath/
sqrt.go # package source
So, what do I need to do, where do I need to git init in this workspace, to be able later:
To import only newmath package into my some separate project. This way:
import "github.com/user/newmath"
To get only hello.exe executable.
To get the whole project-workspace (all directories: bin, pkg, src).
For the package newmath it's the same as (later 2.)
$ mkdir $GOPATH/src/github.com/username/newmath
$ cd $GOPATH/src/github.com/username/newmath
$ git init
$ ... more git setup
$ touch sqrt.go
$ gvim sqrt.go
$ git add sqrt.go
$ git commit -a -m 'Inital commit'
$ git push
Now people can do
$ go get github.com/username/newmath
and
import "github.com/username/newmath"
should now work in their sources. The package will be installed on
demand automatically.
I'll assume that the hello command and the newmath package are
not related, or not enough tightly related to belong to a single
repository.
$ mkdir $GOPATH/src/github.com/username/hello
$ cd $GOPATH/src/github.com/username/hello
$ git init
$ ... more git setup
$ touch hello.go
$ gvim hello.go
$ git add hello.go
$ git commit -a -m 'Inital commit'
$ git push
Now people can do
$ go get github.com/username/hello
$ go install github.com/username/hello
to install your command hello.
It makes almost no sense to publish the content of $GOPATH/pkg at
the hosting service.
It makes some sense to publish the content of $GOPATH/bin at the hosting service. But I discourage this practice for obvious
reasons. Additionally, if you're publishing the sources - the
binaries are not necessary and everybody can build their (trusted)
own.
You seem to be perhaps still a bit confused by the term 'workspace'. A workspace is quite often existing only once at the developer's machine, yet it the typically contains several repositories. Some authored by the developer, others "go getted" from the Internet. To publish a whole wokspace in this case makes little sense.
However, there are people using a separate workspace per project or per repository or maybe even per package. I don't know what the benefits are. Or better said, I think that there are none compared to the single workspace, defined by, say export GOPATH=$HOME (as is my case for years w/o any trouble with it for years).
Check this link out for more details:
github go wiki on github code layout
below is a permanent section:
The app and both libraries live on Github, each in its own repository.
$GOPATH is the root of the project - each of your Github repos will be
checked out several folders below $GOPATH.
Your code layout would look like this:
$GOPATH/
src/
github.com/
jmcvetta/
useless/
.git/
useless.go
useless_test.go
README.md
uselessd/
.git/
uselessd.go
uselessd_test.go
README.md
Each folder under src/github.com/jmcvetta/ is the root of a separate git checkout.
If your not a fan of git cli then all you really need to do is upload to github repo via the web interface. Just make sure that you have your package name the same name as the repo (lowercase) and you should be good to go. I did just the same with github.com/Digitalblueeye/enroute for my REST API library.

exporting a project in rubymine

I've created a project and now want to export it to another folder so I can do work on it. The project itself is a repository so thats why I don't just want to copy and paste the files (since I'll get the hidden .git files with it).
Is there a simple way to export a project in rubymine?
If you use GitHub you could push all current files to your repo, then (assuming you are on a *nix command line) mkdir and/or cd into the NEW folder that you want to work in. You could then perform a:
$ git clone git#github.com:username/projectyouwanttomove.git
Let me know if that helps or not.

Resources