- Learn to use a software development tool about Source Code Management (git, mercurial, etc)
- Build your development enviroment with vagrant ( could learn puppet or chef)
- Create a new branch for the new feature
- Write a feature (vim, Pair Programming) and Testing your feature (TDD or BDD)
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
API::Application.routes.draw do | |
namespace :api, defaults: {format: 'json'} do | |
namespace :v1 do | |
resources :packs, :except => [:new] do | |
resources :designs, :only => [:create] | |
end | |
end | |
end | |
mount Resque::Server, :at => "/resque" |
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
When I send a POST request for "/api/v1/packs" with the values: # features/step_definitions/api_steps.rb:18 | |
""" | |
pack_design_id=1&qty=100&buttons=1,2&address=ad1,ad2&button_type=pin | |
""" | |
undefined method `orders' for #<Item:0x000000058687d8> (NoMethodError) | |
./app/models/pack.rb:37:in `create_pack' | |
./app/models/pack.rb:20:in `record' | |
./app/controllers/api/v1/packs_controller.rb:12:in `create' | |
./features/step_definitions/api_steps.rb:19:in `/^I send a POST request for "(.*?)" with the values:$/' | |
features/v1/packs_descriptions.feature:16:in `When I send a POST request for "/api/v1/packs" with the values:' |
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 Appointment < ActiveRecord::Base | |
# - Relationships - # | |
belongs_to :doctor | |
belongs_to :patient | |
# - Validations - # | |
validates_presence_of :doctor_id | |
validates_presence_of :patient_id | |
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
class Pack < ActiveRecord::Base | |
attr_accessible :pack_design_id, :exec_callback | |
attr_accessor :exec_callback | |
has_one :pack_design | |
has_and_belongs_to_many :buttons | |
after_create :create_pack | |
after_save :update_pack | |
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
@api | |
Feature: Packs API service | |
In order to create a pack with a specific pack design and more stuff | |
As a API consumer | |
I want to provide a resource for interacting with packs | |
Scenario: Get packs by app | |
Given I send a GET request for "/api/v1/packs" | |
Then The response status code should be "200" |
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
if [ -d $HOME/.rbenv ]; then | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
fi | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |
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
server { | |
listen 80; | |
server_name phpmyadmin.dev; | |
root /home/vagrant/project/phpmyadmin; | |
access_log /var/log/nginx/phpmyadmin.dev.access.log; | |
error_log /var/log/nginx/phpmyadmin.dev.error.log; | |
location / { | |
index index.html index.htm index.php; |
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
location ~ .php$ { | |
try_files $uri =404; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
include /etc/nginx/fastcgi_params; | |
} |