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
# rails new my_app_name -J -T -m http://gist.github.com/635287.txt | |
remove_file 'Gemfile' | |
create_file 'Gemfile', <<-GEMFILE | |
source 'http://rubygems.org' | |
source 'http://gems.github.com' | |
gem 'rails' | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
gem 'pg', :group => :production |
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
set :application, "myapp" | |
set :ip_address , "000.000.000.000" | |
set :scm, :git | |
set :repository, "[email protected]:albertoleal/Sinatra-Template.git" | |
set :branch, "master" | |
set :deploy_via, :remote_cache | |
set :user , "sinatra" | |
set :deploy_to, "/home/sinatra/#{application}" |
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 | |
# How to use | |
# my_script_name bd_user db_pass project_name(should be same name on database and project_directory) | |
# by Alfredo Ribeiro: [email protected] | |
# Create the daily backup, delete old backups, and each month, make a copy last backup on a separated directory | |
mysql_user=$1 | |
mysql_pass=$2 | |
project_name=$3 |
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
--colour | |
-I app |
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
$ rspec --format MacVimFormatter --color spec |
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.add_task('write about clean architecture') |
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
require 'spec_helper' | |
describe Tod do | |
describe '.add_task' do | |
let(:repo) { Tod.repo } | |
it 'adds a new task' do | |
expect { Tod.add_task('speak @ Guru-SP') }. | |
to change{ repo.count }.by(1) | |
end |
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 | |
class << self | |
attr_accessor :repo | |
def configure | |
yield self | |
end | |
def repo | |
@repo ||= TasksRepository::InMemory.new |
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 |
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 |
OlderNewer