
Nice, a developer how remember
%~d0einfügen
D:\Programme\CouchDB\bin>couchdb.bat
CouchDB 0.11.0b819947 - prepare to relax...
Eshell V5.7.2 (abort with ^G)
1> Apache CouchDB 0.11.0b819947 (LogLevel=info) is starting.
1> Apache CouchDB has started. Time to relax.
1> [info] [<0.35.0>] Apache CouchDB has started on http://127.0.0.1:5984/
namespace :db do
namespace :migrate do
desc 'Shows installed migrations'
task :installed => :environment do
mt = ActiveRecord::Migrator.new(:up, "db/migrate/")
list = mt.migrations.select{ |mi| mt.migrated.include?(mi.version.to_i) }
print_migration_list(list)
end
desc 'Shows pending migrations'
task :pending => :environment do
mt = ActiveRecord::Migrator.new(:up, "db/migrate/")
print_migration_list(mt.pending_migrations)
end
end
end
def print_migration_list(migrations)
return if migrations.empty?
max_length = migrations.inject(0) {|max, m| [max, m.name.length].max }
puts "Version Name"
puts "---------------" + "-" * max_length
migrations.each do |m|
puts "#{m.version} #{m.name}"
end
end
# Match steps like:
# * And I have projects named A, B, C
Given /^I have .+ named (.+)$/ do |names|
names.split(', ').each do |name|
Factory.create(name)
end
end
# Match steps like:
# * And I should have 1 project
# * And I should have 5 users
Then /^I should have ([0-9]+) (.+)$/ do |count, classes|
Kernel.const_get(classes.singularize.capitalize).count.should == count.to_i
end