From b81e28e006accfa1f0339c9900a742c2325c5a3f Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 21 Feb 2012 21:10:20 -0800 Subject: [PATCH] Add the initial framework for running/developing Twist --- Gemfile | 5 +++++ Rakefile | 5 +++++ app.rb | 28 ++++++++++++++++++++++++++++ index.html | 20 ++++++++++++++++++++ js/Twist.deploy.js | 4 ++++ js/Twist.js | 4 ++++ st/Twist.st | 5 +++++ 7 files changed, 71 insertions(+) create mode 100644 Gemfile create mode 100644 Rakefile create mode 100644 app.rb create mode 100644 index.html create mode 100644 js/Twist.deploy.js create mode 100644 js/Twist.js create mode 100644 st/Twist.st diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..86b1c53 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source :gemcutter + +gem 'rake' +gem 'sinatra' +gem 'shotgun' diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ea3f316 --- /dev/null +++ b/Rakefile @@ -0,0 +1,5 @@ + + +task :server do + sh "shotgun app.rb" +end diff --git a/app.rb b/app.rb new file mode 100644 index 0000000..5a24138 --- /dev/null +++ b/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 diff --git a/index.html b/index.html new file mode 100644 index 0000000..fa7ee48 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + Twi.st + + + + +
+

Twi.st

+ +
+ + diff --git a/js/Twist.deploy.js b/js/Twist.deploy.js new file mode 100644 index 0000000..f8bdcde --- /dev/null +++ b/js/Twist.deploy.js @@ -0,0 +1,4 @@ +smalltalk.addPackage('Twist', {}); +smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist'); + + diff --git a/js/Twist.js b/js/Twist.js new file mode 100644 index 0000000..f8bdcde --- /dev/null +++ b/js/Twist.js @@ -0,0 +1,4 @@ +smalltalk.addPackage('Twist', {}); +smalltalk.addClass('TwistModel', smalltalk.Object, [], 'Twist'); + + diff --git a/st/Twist.st b/st/Twist.st new file mode 100644 index 0000000..6ad591b --- /dev/null +++ b/st/Twist.st @@ -0,0 +1,5 @@ +Smalltalk current createPackage: 'Twist' properties: #{}! +Object subclass: #TwistModel + instanceVariableNames: '' + category: 'Twist'! +