Skip to content

Commit

Permalink
got DSL working properly. next up: functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
listrophy committed Oct 14, 2008
1 parent 2d9fb2c commit cefe492
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion lib/suprails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,43 @@ def write_prefs
end

class Gems
def update *gems
puts "gems.update: #{gems}"
end
def config *gems
puts "gems.config: #{gems}"
end
def unpack
puts "gems.config"
end
end

class DB
attr_reader :development, :test, :production
class Environment
def initialize db_type
@db_type = db_type
end
def adapter adapter
puts "db.#{@db_type}.adapter #{adapter}"
end
def db db
puts "db.#{@db_type}.db #{db}"
end
def timeout to
puts "db.#{@db_type}.timeout #{to}"
end
end
def initialize
@development = Environment.new 'development'
@test = Environment.new 'test'
@production = Environment.new 'production'
end

def create
puts 'db.create'
end

end

class Runner
Expand All @@ -67,7 +101,10 @@ def initialize(runfile = "~/.suprails")
end

def run
load @runfile
gems = Gems.new
db = DB.new
text = File.read(@runfile).split('\n')
text.each {|l| instance_eval(l)}
end

def sources sourcefile
Expand Down

0 comments on commit cefe492

Please sign in to comment.