Use the -d flag with run command.
EG:
eval $(docker-machine env feature)
docker-compose -f delivery.docker-compose.yml run -d rails rake db:seed
| class ApplicationController < ActionController::Base | |
| # Includes Authorization mechanism | |
| include Pundit | |
| # Prevent CSRF attacks by raising an exception. | |
| # For APIs, you may want to use :null_session instead. | |
| protect_from_forgery with: :exception | |
| # Globally rescue Authorization Errors in controller. |
| require 'spec_helper' | |
| describe PersonPolicy do | |
| subject { PersonPolicy } | |
| let(:person) { create(:person) } | |
| let(:user) { create(:valid_user) } | |
| context 'given user\'s role activities' do |
| module PgArrayHstoreFix | |
| def self.included(base) | |
| base.class_eval do | |
| before_save :serialize_array_hash | |
| end | |
| def serialize_array_hash | |
| self.class.attribute_names.each do |attribute| | |
| column_definition = self.column_for_attribute(attribute) | |
| if column_definition.array && column_definition.type == :hstore |
| describe "link_with" do | |
| let (:mirror) {create(:relation_kind, label: 'mirror')} | |
| let (:rorrim) {create(:relation_kind, label: 'rorrim')} | |
| it 'link relation kind both ways' do | |
| mirror.link_with(rorrim) | |
| expect(mirror.mirror_relation_kind).to eql rorrim | |
| expect(rorrim.mirror_relation_kind).to eql mirror | |
| end | |
| end |
| class OpenObject::Partner | |
| include OpenObjectModel | |
| set_open_object_model 'res.partner' | |
| ## Where user context is the trinity : {uid: Int , dbname: String , pwd: String} | |
| def my_custom_method(user_context) | |
| OpenObject.rescue_xmlrpc_fault do | |
| response = self.class.connection(user_context).execute(self.class.open_object_model, 'remoteOpenObjectMethod', self.id.to_i) | |
| OpenObject::BackendResponse.new(success: true, content: response) | |
| end |
| require 'spec_helper' | |
| describe Documents::PaymentSummaryPresenter do | |
| describe 'deal_paid_deposits' do | |
| let(:deal) {double()} | |
| let(:deposit) {double()} | |
| let(:presenter) { Documents::PaymentSummaryPresenter.new(deal) } | |
| before(:each) do | |
| deal.stub_chain(:deposits, :paid) {[deposit]} | |
| end |
| # this wont work for immediate values as Fixnum Symbols but there may be workaround | |
| # | |
| module Doublable | |
| def self.extended(base) | |
| case base | |
| when ::Array | |
| base.extend Doublable::Array | |
| when ::String | |
| base.extend Doublable::String |
| pidfile ENV.fetch('PUMA_PID_PATH','/tmp/pid') | |
| # Should not be a solution | |
| worker_timeout Integer(ENV.fetch('PUMA_WORKER_TIMEOUT', 60)) | |
| # Default worker ( OS processes ) is set to 4 ( most machines has 4 cores ) | |
| # But adjust depending on context ( how much CPU are given to my container ? ) | |
| current_cpu_count = begin | |
| Integer(`nproc`) - 1 | |
| rescue | |
| 4 | |
| end |
| module Analysis.GobanState exposing (GobanState, Intersection(..), Stone(..), blank, addStone) | |
| import Matrix exposing (Matrix, repeat, set) | |
| type alias GobanState = Matrix Intersection | |
| type Intersection = Free | Stone | |
| type Stone = Black | White | |
| blank : Int -> GobanState |