This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export RAILS_ENV=<%= node[:application][:environment] %> | |
export PATH=$PATH:/usr/local/bin | |
APP_ROOT=<%= node[:application][:path] %>/current | |
PID=<%= node[:application][:path] %>/current/tmp/pids/unicorn.pid | |
old_pid="$PID.oldbin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] # faster network | |
vb.memory = 1024 | |
vb.cpus = 2 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(job in jenkins.model.Jenkins.theInstance.getProjects()) { | |
if (job.name != 'project-test-master' && job.name.indexOf('project-test') > -1) { | |
job.delete(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needs_restart = false | |
plugins = { | |
'vagrant-aws' => '0.5.0', | |
'vagrant-s3auth' => '0.1.0', | |
'vagrant-bindfs' => '0.3.2', | |
} | |
plugins.each do |plugin, version| | |
unless Vagrant.has_plugin?(plugin) | |
system("vagrant plugin install #{plugin} --plugin-version #{version}") || exit! | |
needs_restart = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Teamcity hack | |
$LOAD_PATH.push '/Applications/RubyMine.app/Contents/rb/testing/patch/bdd' | |
$LOAD_PATH.push '/Applications/RubyMine.app/Contents/rb/testing/patch/common' | |
require 'teamcity/spec/runner/formatter/teamcity/formatter' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
def initialize(attrs={}) | |
# implement this | |
end | |
def self.find(id) | |
# implements this | |
end | |
def self.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Child < ActiveRecord::Base | |
belongs_to :parent # Child has parent_guid field | |
# ActiveModel::MissingAttributeError: | |
# can't write unknown attribute `parent_id` | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tester | |
def test | |
if false | |
# variable 'var' is now in scope because it's defined syntactically (at parse time) | |
var = 'bar' | |
end | |
# variable 'var' shadows method with the same name. variable 'var' was defined, but never assigned which means it equals nil | |
puts var.inspect # => nil | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV APP_USER app | |
ENV BUNDLE_APP_CONFIG /usr/local/bundle | |
ADD Gemfile $DIR | |
ADD Gemfile.lock $DIR | |
# Force bundler to install all gems to system location (/usr/local/bundle) so that when you run `rake` command | |
# all files are loaded from docker image instead of mounted volume | |
RUN bundle install --deployment --path $BUNDLE_APP_CONFIG | |
RUN chown -R $APP_USER $BUNDLE_APP_CONFIG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Search | |
Scenario: Search for "apple" | |
Given I am on the front page | |
When I search for "apple" | |
Then I should see "apple.com" |