Where is the calabash_steps.rb file? - cucumber

I am new to calabash and working with it since past few months. When I execute the pre-defined step I get below path "# calabash-cucumber-0.11.4/feature/step-definitios/calabash-steps.rb"
I know its associated with my workspace somehow but I am not able to get this calabash-steps.rb file (neither in my system nor on Google)
Can someone help me in getting this file. I just wanna see how the implementation is done for the step.
A lot of thanks in advance!

Those files will be in the gems library itself. If you are on a mac, open a terminal and type
which calabash-android
The output will be a file path to where the gem is installed. If you look there there will be the files you are looking for.
If you are on windows you can run
gem env
and it will output a bunch of info and the GEM PATH section is the bit you want.
Mine looks like this
GEM PATHS:
C:/Ruby193/lib/ruby/gems/1.9.1
If you're getting started writing custom steps then you should check out the docs - https://github.com/calabash/calabash-ios/wiki/03-Writing-custom-steps

The file can be found in the Calabash iOS repo.
One of the of the problems with using predefined steps is that you can't edit them (easily).
If you want to explore the predefined steps (edit them, set break points, etc.), I suggest copying the calabash_steps.rb file into your local features/step_definitions directory and updating your features/support/env.rb file to not load the predefined steps from the gem.
This code comment in the features explains how to not include the predefined steps shipped with the Calabash gem.
If you use bundler + Gemfile (which we strongly recommend), you can find where the gem is installed:
$ bundle show calabash-cucumber
As an aside, you should update to the most recent version of Calabash iOS (0.14.3 as of this writing).

Related

Where can I find Yocto "sub"-packages not listed in OpenEmbedded layer index like "kbd-keymaps"?

I just tried to build the Yocto core-image-minimal and was not able to change the keyboard layout using "loadkeys de".
So I googled a bit and found, that I have to add "kbd-keymaps" to IMAGE_INSTALL_append. Then it worked perfectly fine.
Afterwards I found https://layers.openembedded.org/layerindex/branch/master/recipes/ and saw that the package is not listed there.
Instead I only found just "kbd" and just "keymaps" as separate packages. But when only installing these instead of kbd-keymaps, "loadkeys de" did not work. kbd was installed then but NOT the accordant keymaps under "usr/share/keymaps".
So my question is: Where are such packages like "kbd-keymaps" officially listed? (Google only shows forum entries of experienced users knowing about that package name and on the kbd project page I also didn't find anything about the keymaps package)
Look at
http://layers.openembedded.org/layerindex/recipe/595/
A recipe is set of input rules to build a package, which can however generate different output packages for keeping the install size small the output artifacts may be bundled into different ipk/rpm output packages. So in this case input recipe is 'kbd' so when building you would do
bitbake kbd
but then when adding what you need into image you have to add the names of output packages generated from build. Hopefully that explains the crucial difference between recipe and package, what you add into IMAGE_INSTALL is name of output package. So in this case you will still add
IMAGE_INSTALL_append = " kbd-keymaps"
this would result in building kbd recipe and the use the kbd-keymaps package ( ipk/rpm/deb ) from it.
Hope that helps.
You can also use oe-pkgdata-util utility to inspect the recipes and packages.

Trying to make Host sFlow for XenServer 7.0

I spent all day trying to make Host sFlow 2.0.6-1 from sources (https://github.com/sflow/host-sflow/releases) for XenServer 7.0 using the XenServer DDK from this site: http://xenserver.org/overview-xenserver-open-source-virtualization/download.html
First I had to make 2 changes to the file hsflowd-xen.spec:
Changed line 3 to: "Version: 2.0.6" (it was still 2.0.1)
Changed line 20 to: "%setup -n hsflowd-2.0.6-1" (added the name because the default one was wrong).
Now my problem is that I dont have the xenstore.h file. After long searches I found that it's in the package libxen-dev (or libxen-devel) but I couldn't find it with its dependecies anywhere.
The four most probable solutions I think are :
1. (The lazy one) Get the iso file for Host sFlow already built for XenServer 7.0 (the official site stopped building at 6.5)
Set up a proper yum repository that will contain libxen-dev and its dependencies. I can't even connect to the official CentOS repositories because the files in /etc/yum.repos.d/ have a bad URL.
This is the content of /etc/centos-release: "XenServer DDK release 7.0.0-125770c (xenenterprise)"
Somehow manage to use 'xenstore.a' instead of 'xenstore.h'. I changed the code in src/Linux/mod_xen.c to include 'xenstore.a' instead of 'xenstore.h' but when I build it, it creates a new file with the old code and ignores my changes. I probably changed the wrong files because there are different copies of the whole code. I'm not even sure it would work though even if I did manage to include 'xenstore.a'.
Make xenstore from sources. I didn't try it because I only found old sources and I figured I'd miss the dependencies too.
PS: I'm n00b at CentOS and Makefiles in general so the solution might be obvious and I just don't know it.
With gratitude to lagange, I updated the host-sflow project with a XenServer 7 build. I also added a Docker recipe so you can replace all these steps with just "./docker_build_on xenserver". Please raise issues on https://github.com/sflow/host-sflow.
I finally succeeded in building it. That's what I had to do step by step:
Import the XenServer DDK 7.0.0 into XenCenter.
Extend xvda1 following these steps: https://support.citrix.com/article/CTX125405
Make these changes to hsflowd-xen.spec:
3rd line: Version: 2.0.6
20th line: %setup -n hsflowd-2.0.6-1
Add these two lines before %description:
%define debug_package %{nil}
%define _unpackaged_files_terminate_build 0
Change file /etc/yum.repos.d/CentOS-Base
Change all occurrences of "$releasever" to "7".
Change all occurrences of "$basearch" to "x86_64".
Change "enabled=0" to "enabled=1" for each repository.
Uncomment baseurl lines for each repository.
Mount the Development packages (binpkg.iso available on the xenserver.org download page) and add a file for it in /etc/yum.repos.d/
Mine looks like it:
[binpkg]
name=CitrixXenServer7
enabled=1
baseurl=file:///mnt/binpkg/
gpgcheck=0
Install the two following packages with Yum (dependencies should install correctly now):
xen-libs-devel.x86_64
xen-dom0-libs-devel.x86_64
Make the file and install it using this tutorial: https://raw.githubusercontent.com/sflow/host-sflow/v2.0.4/INSTALL.XenServer

How to do a Go project workspace to work with dependencies tools and go tools?

I have a project with packages inside:
project package "root": a/b/c (eg github/b/c)
in a/b/c we have a lot of packages (p1, p2 ...)
project is managed according to How to Write Go Code official recommendations. The local project path is: $GOPATH/src/a/b/c. Also all imports are "not relative".
the project has go get-able dependencies
Now I want to use some dependency manager tool like gom or godep. Each of this tool creates an extra directory in repository and puts all vendor dependencies there. Also it plays with GOPATH and sets it to that vendor directory. Let's assume that the tool will put all vendors in path_to_project/.vendor - becoming a new GOPATH.
I want to use one of the go tools (gofmt, gorename, ...) being aware about packages in my projects and vendor directory. The problem is that if GOPATH=path_to_project/.vendor (godep does this) then tools are not aware about packages in my project.
One idea for this is to set a GOPATH=path_to_project/.vendor:GOPATH in a shell end editors. Or call every command with gom exec (gom sets a GOPATH in the above proposition)
Is there any ready and automatic solution for this?
Final goal is to bundle go project with specified dependencies versions (like git commits) and make tools + editors (vim/emacs) working with this tools.
If you are using godep, you can just prefix the go command with godep like this:
godep go build
or
godep go fmt

Haxelib Dependency to a git library

I would like to know if that's possible to declare a dependency to a library via GIT. My usecase is simple, I have some tools, that I would like to share between my projects, but I don't want to add them to haxelib (because this tools are not really interesting for someone else). Otherwise, I would like that people who will install my lib, get my tools too (without the need to use manually haxelib git ....).
Is it possible ? (I didn't read anything about that in documentation)
This is currently not supported in Haxelib, though it would be great to see, and not too hard to implement. If you're interested in working on Haxelib, it's not too hard, open an Issue on the Haxelib Github project and perhaps we can help you figure out how to contribute.
One alternative if you need a workaround is to create a "run" script, so you can do:
# Run the project's run.n file
haxelib run mylib
# Your "run.n" file could have a "setup" command that runs
# the "haxelib git" commands for the user
haxelib run mylib setup
It's a bit of a hack, but it could work in the interim. See http://haxe.org/doc/haxelib/using_haxelib#runnable-project for more info on how to have a run script for your haxelib.
As of 2016, this is now natively supported by Haxelib. You can see the PR here.
As mentioned in the PR, you can use the one of these two:
haxelib git:<url> (similar to cloning the git repository).
haxelib git:<url>#commit-ish (clones to a specific commit, specify the hash.
Shameless plug, BUT you can checkout my http://lib.haxe.org/p/hxmlinstall/
1. Add -lib hxmlinstall to your hxml.
2. Annotate your tools like so
#git https://github.com/you/tools commithash
-lib forkedlib:git
On build you will be warned if your lib repository is not on specified %commithash%
Run haxelib run hxmlinstall to install / pull / update all dependencies

unattended cygwin setup without setup.ini

I´m doin a unattended cygwin installation and I was wondering if there will occure any problems without a setup.ini.
Following: my "install-folder" includes a setup.exe and a subfolder release (within all the packages packed).
I´m starting the setup silent (with Nsis) and install the packages. In NSIS I define the Root, the location of the packages etc.
I think it works so far (I´m not sure because i´ve got a curious error in cmake). There are many instructions how to modify the whole setup for an offline installation. But I don´t get the point why I have to modify it at all.
I hope anyone has got experience with this issue!
#Daniel Le cygwin installs the packages without the .ini (all of them). And there has nothing to be downloaded because the packages are on the local machine.
I believe the setup.ini is essential to the setup process, as it indicates which packages to be downloaded and installed.
The Ini file is so far only a description for file locations and paths to be set as default. It is not necessary to have the ini file if you wanna install some packages!
That´s my conclusion.

Resources