Run rake tasks from ruby script
require 'rake'
rake = Rake.application
rake.init
# you can import addition *.rake files
# app.add_import 'some/other/file.rake'
rake.load_rakefile
rake['db:test:prepare'].invoke()
Related cards:
Ant handbook
Check conditions example:
<!-- run command -->
<target name="t_name">
<exec executable="command" failonerror="true" outputproperty="exec.out" errorproperty="exec.err" resultproperty="exec.rc" >
<arg value="arg"/>
</exec...
Setting up RubyOnRails environment on Ubuntu 14.04
This tutorial is about setting up environment for RubyOnRails on Ubuntu 14.04.
First of all, update & upgrade your system:
sudo apt-get update
^
sudo apt-get upgrade
^
Install git
and curl
:
sudo apt-get install curl
^
sudo...
Capistrano deploy.rb examples
All examples here for deploy RoR application with unicorn, staging machine (where we deploys) available via ssh by ssh_key.
-
Deploy via remote_cache:
require 'rvm/capistrano' require 'bundler/capistrano' set :applicat...
Jasmine - how to run specific it or describe block?
Just mark needed describes
and its
as ddiscribe
and iit
, and next time you run tests only ddiscribes and iits will be executed. In Jasmine version >= 2.0 use fit
and fdescribe
respectively.
Install gems without those which in production group
For that purpose, just use these command:
bundle install --without production
Rspec + Capybara + Rails4 + Spork (intergation tests setup with selenium and poltergeist)
Add in Gemfile:
group :development, :test do
gem 'rspec-rails'
gem 'spork-rails'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'email_spec'
gem 'poltergeist'
gem 'launchy'
gem 'selenium-webdriver'
end
Run ...
Ubuntu 12.04 TeamCity build agent installation
Download build agent archive from your TeamCity server:
wget http://your_teamcity.server.com:8111/update/buildAgent.zip
Unzip it in separate directory:
mkdir buildAgent
^
mv buildAgent.zip buildAgent
^
cd buildAgent
^
un...
Setup postgresql for RoR
Assume your database.yml file looks like this:
{: .yaml}
development:
adapter: postgresql
host: localhost
encoding: unicode
database: proj_development
pool: 5
username: proj
password:
...
Setting up Javascript environment with NVM on Ubuntu 14.04
NVM provides you more convenient way to manage and set up your Javascript(Node.js) environment.
First install NVM, note git
must be installed on your sistem:
^
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git check...
Reset RabbitMQ (Manjaro linux)
To reset RabbitMQ Mnesia database ensure that RabbitMQ process is running on your system. Then stop the running application:
sudo rabbitmqctl stop_app
After that run the command:
sudo rabbitmqctl reset
And then start the app:
`...