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
| require 'bundler/setup' | |
| require 'active_record' | |
| include ActiveRecord::Tasks | |
| db_dir = File.expand_path('../db', __FILE__) | |
| config_dir = File.expand_path('../config', __FILE__) | |
| DatabaseTasks.env = ENV['ENV'] || 'development' |
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
Show hidden characters
| # Get Sublime to use your rvm ruby... Change your Packages/Ruby/Ruby.sublime-build to this, | |
| # or drop it in Packages/User: | |
| { | |
| "env":{ | |
| "PATH":"/home/leemour/.rvm/bin:${PATH}" | |
| }, | |
| "cmd": [ | |
| "/home/leemour/.rvm/bin/rvm-auto-ruby", "$file" | |
| ], | |
| "file_regex": "^(...*?):([0-9]*):?([0-9]*)", |
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
| padrino g project APP -d activerecord -t cucumber -e haml -c sass -s jquery -m mocha --migration_format=timestamp |
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
| # app/constraints/photo_constraint.rb | |
| class PhotoConstraint | |
| def initialize | |
| @types = Photo::TYPES | |
| end | |
| def self.matches?(request) | |
| @types.include?(request.path_parameters[:type]) | |
| 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
| # app/constraints/photo_constraint.rb | |
| class PhotoConstraint | |
| def initialize | |
| @types = Photo::TYPES | |
| end | |
| def self.matches?(request) | |
| @types.include?(request.path_parameters[:type]) | |
| 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
| padrino g project padrino_test -d activerecord -t cucumber -s jquery -e haml -c sass -m mocha |
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
| # bundle exec rails runner "eval(File.read 'lib/scripts/recreate_versions.rb')" | |
| Product.all.each do |p| | |
| %w(photo1 photo2 photo3 photo4 photo5).map(&:to_sym).each do |photo| | |
| p.send(photo).recreate_versions! if p.read_attribute(photo).present? | |
| 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
| { | |
| "color_scheme": "Packages/User/Railscasts.tmTheme", | |
| "font_size": 12, | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": false, |
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
| #!/usr/bin/env bash | |
| # Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
| # Please modify the CONSTANT variables to fit your configurations. | |
| # The script will start with config set by $PUMA_CONFIG_FILE by default | |
| PUMA_CONFIG_FILE=config/puma.rb | |
| PUMA_PID_FILE=tmp/pids/puma.pid | |
| PUMA_SOCKET=tmp/sockets/puma.sock |