Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
Add the initial framework for running/developing Twist
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Tyler Croy committed Feb 22, 2012
1 parent 044b4e2 commit b81e28e
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Gemfile
@@ -0,0 +1,5 @@
source :gemcutter

gem 'rake'
gem 'sinatra'
gem 'shotgun'
5 changes: 5 additions & 0 deletions Rakefile
@@ -0,0 +1,5 @@


task :server do
sh "shotgun app.rb"
end
28 changes: 28 additions & 0 deletions app.rb
@@ -0,0 +1,28 @@
require 'rubygems'
require 'sinatra'


set :root, File.dirname(__FILE__)
set :public_folder, File.dirname(__FILE__)
set :static, true
unless ENV['RACK_ENV'] == 'production'
set :logging, true

# Only enable the saving mechanism in test/development
put '/*' do
puts request.path
unless request.body.nil?
path = File.join(File.dirname(__FILE__), request.path)
puts "Commiting changes to #{path}"
File.open(path, 'w') do |fd|
request.body.each do |line|
fd.write(line)
end
end
end
end
end

get '/' do
redirect to('/index.html')
end
20 changes: 20 additions & 0 deletions index.html
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Twi.st</title>
<script src="./amber/js/amber.js" type="text/javascript"></script>
<script type="text/javascript">
loadAmber({
files: ['Twist.js'],
prefix: '../js/', /* This is for some reason relative to the ./amber directory */
ready: function() {
}});
</script>
</head>
<body>
<article>
<h1>Twi.st</h1>
<button onclick="smalltalk.Browser._open()">class browser</button>
</article>
</body>
</html>
4 changes: 4 additions & 0 deletions js/Twist.deploy.js
@@ -0,0 +1,4 @@
smalltalk.addPackage('Twist', {});
smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist');


4 changes: 4 additions & 0 deletions js/Twist.js
@@ -0,0 +1,4 @@
smalltalk.addPackage('Twist', {});
smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist');


5 changes: 5 additions & 0 deletions st/Twist.st
@@ -0,0 +1,5 @@
Smalltalk current createPackage: 'Twist' properties: #{}!
Object subclass: #TwistModel
instanceVariableNames: ''
category: 'Twist'!

0 comments on commit b81e28e

Please sign in to comment.