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
seed_data = [ | |
{model_name: "somename", image:"my_image.jpg"}, | |
#... | |
] | |
thin_server = Thread.start do | |
Thin::Server.start('0.0.0.0', 4567) do | |
run Rack::Directory.new( File.join(Dir.pwd,"seed-images") ) | |
end | |
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
thin_server.kill |
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
seed_data = [ | |
{model_name: "somename", image:"my_image.jpg"}, | |
... | |
] | |
seed_data.each do |seed| | |
model = Model.find_by_name(seed[:model_name]) | |
model.remote_image_url="http://localhost:4567/#{model[:image]}" | |
model.save | |
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
thin_server = Thread.start do | |
Thin::Server.start('0.0.0.0', 4567) do | |
run Rack::Directory.new( File.join(Dir.pwd,"seed-images") ) | |
end | |
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
#!/usr/bin/env bash | |
# repository | |
cd /tmp | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
rpm -Uvh epel-release-6-8.noarch.rpm | |
# system update | |
yum -y update | |
yum -y groupinstall "Development Tools" | |
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick |
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
compat.version=RUBY1_9 |
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
export JRUBY_OPTS=--1.9 |
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
export RUBYOPT="--1.9" |
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
ruby --1.9 |
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::Matchers.define :be_less_than do |expected| | |
match do |actual| | |
result = actual<expected | |
result &&=actual>@low_value unless @low_value.nil? | |
result | |
end | |
chain :and_greater_than do |low_value| | |
@low_value=low_value | |
end | |
description do |