line1
line2
line3
line4
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
| POST /api/organizations/35/employees HTTP/1.1 | |
| Host: example.com | |
| X-Api-Version: 1 | |
| Accept: application/vnd.api+json | |
| Content-Type: application/vnd.api+json | |
| Cache-Control: no-cache | |
| { | |
| "data": { | |
| "type": "employees", |
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
| namespace :ci do | |
| desc "Flog it" | |
| task :flog do | |
| max_score = 10.0 | |
| changed_files = `git diff develop --name-only | grep "app/" | grep ".rb" | tr '\n' ' '`.split(' ') | |
| if changed_files.any? | |
| lines = `flog #{changed_files.join(' ')}` | |
| failures = lines.split("\n"). | |
| drop(3). |
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
| namespace :ci do | |
| namespace :heroku do | |
| desc "Validate Heroku Review App ENV configuration" | |
| task :validate_review_app do | |
| # load files in development or CI | |
| env_file = File.exists?("config/application.yml") ? "config/application.yml" : "config/application.yml.example" | |
| env = YAML.load_file(env_file) | |
| env_keys = env.keys.map(&:to_s) - %w(test development staging production) | |
| env_keys += env['development'].keys |
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
| defmodule Documenation.Case do | |
| defmacro __using__(options) do | |
| quote do | |
| use ExUnit.Case, unquote(options) | |
| import Documenation.Case | |
| end | |
| end | |
| defmacro verify(verb, path, http_status, config) do | |
| quote bind_quoted: binding() do |
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
| include DreddHooks::Methods | |
| ENV["RAILS_ENV"] = "test" | |
| require "rubygems" | |
| require "bundler/setup" | |
| unless ENV["SKIP_COVERAGE"] | |
| require "simplecov" | |
| SimpleCov.command_name "Dredd" | |
| SimpleCov.at_exit do |
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
| defmodule Comment do | |
| def changeset(comment, params) do | |
| comment | |
| |> cast(params, @allowed_params) | |
| |> validate_required([:text]) | |
| |> put_assoc(:user, params.user) | |
| end | |
| end | |
| comment = %{text: "Hey, sup?", user: some_user} |
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
| defmodule User do | |
| def changeset(user, params) do | |
| user | |
| |> cast(params, @allowed_params) | |
| |> validate_required(@required_params) | |
| # Account.changeset is inferred by default | |
| |> cast_assoc(:account, required: true, with: &Account.registration_changeset/2) | |
| end | |
| 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
| ((0..9).to_a + ("a".."z").to_a).shuffle.take(8).join('') |
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
| language-elixir | |
| script | |
| build-elixir | |
| elixir-cmd | |
| linter-elixirc | |
| elixir-docs | |
| iex | |
| autocomplete-elixir |