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
erd = ERDBuilder.new | |
erd.begin_system("Infoamatica") | |
venue = erd.add_entity("Venue") | |
venue.attributes = {name: :string} | |
user = erd.add_entity("User") | |
user.attributes = {email: :string, password: :string} | |
erd.associate(user, venue, {association: :many_to_one, name: "Association"}) |
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 'rubygems' | |
require 'graphviz' | |
class ERDBuilder | |
attr_reader :name | |
def add_entity(name) | |
ERDEntity.new.tap do |entity| | |
entity.build(graph: graph, name: name) |
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 OnlineEnquiryWizard < EnquiryWizard | |
# Called within the CapacityCheckController to find which step to go to | |
# if 'previous' is pressed on the first step of the first CapacityCheck | |
def step_before_capacity_check | |
if @object.vehicle_selection_method == "none" | |
"select_vehicle" | |
else | |
"duty_of_disclosure" | |
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
let(:vehicle) { FactoryGirl.create(:vehicle, :vehicle_model => vehicle_model, :type_of_sale => type_of_sale) } | |
let(:vehicle_model) { nil } | |
let(:type_of_sale) { "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
let(:vehicle) { FactoryGirl.create(:vehicle, vehicle_attributes) } | |
let(:vehicle_attributes) { {} } | |
describe "#to_s" | |
subject { vehicle.to_s } | |
let(:vehicle_attributes) { {name: "Carzilla"} } | |
it { should == "Carzilla" } | |
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
# Use the rspec generators | |
config.generators do |g| | |
g.view_specs false | |
g.helper_specs false | |
g.test_framework :rspec | |
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
#!/bin/bash | |
echo -e "second\nthird\nfourth" > something.txt | |
echo -e "something.txt\n-------------" | |
cat something.txt | |
printf '%s\n' 0a "first" . w | ed -s something.txt | |
echo -e "\nsomething.txt\n-------------" | |
cat something.txt |
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 | |
echo -e "second\nthird\nfourth" > something.txt | |
echo -e "something.txt\n-------------" | |
cat something.txt | |
echo -e "first" | cat - something.txt > tmp && mv tmp something.txt | |
echo -e "\nsomething.txt\n-------------" | |
cat something.txt |
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 | |
IFS=$'\n' | |
for FILE in `find . -name "*.wma.MP3" -type f` | |
do | |
mv $FILE `echo $FILE | sed s/.wma.MP3/.mp3/g` | |
done |
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 | |
find . -name "*.nfo" -delete | |
find . -name "*.sfv" -delete | |
find . -name "*.m3u" -delete | |
find . -name "*.html" -delete | |
find . -name "*.md5" -delete | |
find . -name "*.pls" -delete |
NewerOlder