highlight --font-size 20 --font Inconsolata --style fine_blue -W -J 140 --src-lang ruby -O rtf highlight.rb | pbcopy
View .drone.yml
This file contains 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
pipeline: | |
build: | |
image: ruby:2.4.2 | |
commands: | |
- bundle install | |
- bundle exec rspec spec | |
slack: | |
image: plugins/slack | |
channel: codebuilds | |
webhook: https://hooks.slack.com/services/xxx |
View agent-deployment.yml
This file contains 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: agent | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
name: agent |
View drone-server.yml
This file contains 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: server | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
name: server |
View docker-machine-use-nfs.sh
This file contains 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 | |
# | |
# This script will mount /Users in the boot2docker VM using NFS (instead of the | |
# default vboxsf). It's probably not a good idea to run it while there are | |
# Docker containers running in boot2docker. | |
# | |
# Usage: sudo ./boot2docker-use-nfs.sh | |
# |
View initializer.rb
This file contains 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
Tod.configure do |config| | |
config.repo = TasksRepository::ActiveRecord | |
end |
View active_record.rb
This file contains 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 TasksRepository::ActiveRecord | |
def persist(task_entity) | |
task = Task.create({ title: task_entity.title }) | |
serialize task | |
end | |
def count | |
Task.count | |
end |
View in_memory.rb
This file contains 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
module Tod | |
module TasksRepository | |
class InMemory | |
def initialize | |
@tasks = {} | |
@id = 0 | |
end | |
def persist(task) | |
@id += 1 |
View task.rb
This file contains 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
module Tod | |
module Entities | |
class Task | |
attr_accessor :id | |
attr_reader :title | |
def initialize(title: '') | |
@title = title | |
end |
View add_task.rb
This file contains 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
module Tod | |
module UseCases | |
class AddTask | |
def self.add(title) | |
task = Entities::Task.new(title: title) | |
if task.valid? | |
Tod.repo.persist(task) | |
else | |
false |
NewerOlder