In this guide we will cover two main cases:
- Ember specific library
- vendor library
The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
end |
# Useage: select2("value to select", from: "label text") | |
module Capybara | |
module Select2 | |
def select2(value, options={}) | |
select_name = options[:from] | |
select2_container = first("label", text: select_name).find(:xpath, "..").find(".select2-container") | |
select2_container.find(".select2-choice").click | |
find(:xpath, "//body").find(".select2-drop li", text: value).click | |
end |
require('config/adapters/faye-adapter'); | |
export default DS.FayeAdapter.extend(); |
{ | |
"name": "Root", | |
"children": [ | |
{ | |
"name": "Branch 1", | |
"children": [ | |
{"name": "Leaf 3"}, | |
{"name": "Leaf 4"} | |
] | |
}, |
class Service | |
class TransactionWrapper | |
TransactionFailed = Class.new(StandardError) | |
attr_reader :sequence | |
delegate :append, :prepend, to: :sequence | |
def initialize(sequence, connection) | |
@sequence = sequence | |
@connection = connection |
#!/usr/bin/env bash | |
# Author: Sasha Nikiforov | |
# source of inspiration | |
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions | |
# Detect platform | |
if [ "$(uname)" == "Darwin" ]; then | |
# MacOS |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
module Commands | |
module Meeting | |
AcceptSchema = Dry::Validation.Schema do | |
required(:user_id).filled | |
required(:status).value(eql?: :scheduled) | |
end | |
class Accept < Command | |
def call | |
return validate if validate.failure? |
# frozen_string_literal: true | |
require_relative '../system/my_app/container' | |
module MyApp | |
module Tests | |
class Container < Dry::System::Container | |
use :env, inferrer: -> { 'test' } | |
configure do |