This repository has been archived by the owner on Mar 8, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the initial framework for running/developing Twist
- Loading branch information
R. Tyler Croy
committed
Feb 22, 2012
1 parent
044b4e2
commit b81e28e
Showing
7 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source :gemcutter | ||
|
||
gem 'rake' | ||
gem 'sinatra' | ||
gem 'shotgun' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
|
||
task :server do | ||
sh "shotgun app.rb" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
smalltalk.addPackage('Twist', {}); | ||
smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist'); | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
smalltalk.addPackage('Twist', {}); | ||
smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist'); | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Smalltalk current createPackage: 'Twist' properties: #{}! | ||
Object subclass: #TwistModel | ||
instanceVariableNames: '' | ||
category: 'Twist'! | ||
|