Skip to content

Instantly share code, notes, and snippets.

version: 2
jobs:
build:
parallelism: 3
docker:
- image: circleci/ruby:2.4.2-node
environment:
PGHOST: 127.0.0.1
PGUSER: user
RAILS_ENV: test
RSpec.configure do |config|
config.before(:each, type: :system) do
driven_by :rack_test
end
config.before(:each, type: :system, js: true) do
driven_by :selenium_chrome_headless
end
end
displayEditable : Editable -> HTML
displayEditable editable =
case editable of
BeingEdited old new ->
textarea [] [ text new ]
NotBeingEdited value ->
div [] [ text value ]
save : Editable -> Editable
save x =
case x of
BeingEdited _ new ->
NotBeingEdited new
NotBeingEdited _ ->
x
edit : Editable -> Editable
edit x =
case x of
BeingEdited old new ->
x
NotBeingEdited value ->
BeingEdited value value
type Editable
= BeingEdited String String
| NotBeingEdited String
class Editable {
constructor(text) {
@text = text
@originalText = ""
@status = "notEditing"
}
startEdit {
@status = "editing"
# Rubocop file I use for book code
# Note, this is code I work on by myself, so some. things that I don't do I may not have covered
AllCops:
Exclude:
- "db/schema.rb"
- ".bundle/**/*"
- "bin/**/*"
- "vendor/**/*"
AllCops:
Exclude:
- "db/schema.rb" # You can't touch this
- ".bundle/**/*" # Auto-generated
- "bin/**/*" # Auto-generated
- "vendor/**/*" # We cannot solve the world's problems
TargetRubyVersion: 2.3
Rails:
Enabled: true
PriceCalculator
def initialize(*items)
end
def calculate
200
end
end