Skip to content

Instantly share code, notes, and snippets.

@WaYdotNET
WaYdotNET / Vagrantfile
Last active August 29, 2015 14:08 — forked from gasman/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Base box to build off, and download URL for when it doesn't exist on the user's system already
config.vm.box = "wagtail-base-v0.1"
config.vm.box_url = "http://downloads.torchbox.com/wagtail-base-v0.1.box"
# You can also build from a vanilla precise32 box, although it'll take longer
#!/bin/bash
DJANGO_VERSION=1.4
VENV="django$DJANGO_VERSION"
# create virtualenv: "django<version>" e.g. django1.4
mkdir lib
cd lib
virtualenv --system-site-packages $VENV
cd $VENV
class Kalifornium < Padrino::Application
def load_something
@a = 1; @b = 2
end
end
class Kalifornium < Padrino::Application
register Loader
end
# app/models/bar.rb
class Bar
include DataMapper::Resource
# property <name>, <type>
property :id, Serial
property :name, String
# has many to many
has n, :foos, :through => Resource
end
class Component
include DataMapper::Resource
property :id, Serial
property :nome, String
property :descrizione, Text
property :prezzo_base, Float
property :base, Boolean
DataMapper.auto_migrate!
(1..5).each do |n|
PlantType.create(:nome => "nome_#{n}")
ComponentType.create(:nome => "nome_#{n}")
Supplier.create(:nome => "nome_#{n}")
Component.create(:nome => "nome_#{n}", :supplier => Supplier.first, :component_type => ComponentType.first)
end
params = {:supplier=> Supplier.get(1), :component_type => ComponentType.get(1), :nome => "ciao", :plant_types => PlantType.all(:id => "3,4".split(","))}
component = Component.first
DataMapper::Visualizer::Project library
- should add the include directories to the $LOAD_PATH
- should remove the include directories to the $LOAD_PATH
- should require the specified paths
DataMapper::Visualizer::Project rails
- should add the include directories to the $LOAD_PATH
- should remove the include directories to the $LOAD_PATH
- should require all paths that match the specified glob patterns
waydotnet-laptop:~/.rvm/src/rvm (master) $ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
waydotnet-laptop:~/.rvm/src/rvm (master) $ gem list
*** LOCAL GEMS ***
bundler (1.0.2)
rake (0.8.7)
waydotnet-laptop:~/.rvm/src/rvm (master) $ bundle install
Could not locate Gemfile
DataMapper::Visualizer::Visualization full names
- should not demodulize the names of Classes
- should not demodulize the names of Objects (FAILED - 1)
- should not demodulize property type names
- should not demodulize model names
1)
'DataMapper::Visualizer::Visualization full names should not demodulize the names of Objects' FAILED
expected: "DataMapper::Property",
got: "DataMapper::Property::Text" (using ==)