L'objectif est d'apprendre les bases du langage Smalltalk de manière ludique.
Pour charger ProfStef dans votre image, évaluez le code suivant dans un Workspace:
Gofer new
squeaksource: 'ProfStef';
package: 'ProfStef';
load.
Gofer new
squeaksource: 'ProfStef';
package: 'ProfStef';
load.
|aWindow aPanel buttonPanel|
aWindow := SystemWindow labelled: 'My first window'.
aPanel := PluggablePanelMorph new.
aWindow addMorph: aPanel fullFrame: (
LayoutFrame
fractions: (0@0 corner: 1@1)
offsets: (0@0 corner: 0@50 negated)).
aPanel color: (Color blue).
buttonPanel := PluggablePanelMorph new.
aWindow addMorph: buttonPanel fullFrame: (
LayoutFrame
fractions: (0@0.99 corner: 1@1)
offsets: (0@50 negated corner: 0@0)).
buttonPanel color: (Color green).
#(one two three) do: [:label| |aButton|
aButton := PluggableButtonMorph new label: label; yourself.
buttonPanel addMorph: aButton fullFrame: nil.
].
aWindow openInWorld.
git clone git://github.com/qoobaa/sqlite3-ruby.git
cd sqlite3-ruby gem build sqlite3-ruby.gemspec
gem install sqlite3-ruby-1.2.6.gem
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
checking for sqlite3.h... no
C:\Ruby19\sqlite3
|- include
| |- sqlite3.h
|- lib
|- sqlite3.dll
dir_config("sqlite3", "C:\\Ruby19\\sqlite3")
gem build sqlite3-ruby.gemspec gem install sqlite3-ruby-1.2.6.gem
ActionView::TemplateError (incompatible character encodings: ASCII-8BIT and UTF-8)
module ActionView
module Renderable #:nodoc:
private
def compile!(render_symbol, local_assigns)
locals_code = local_assigns.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
source = <<-end_src
def #{render_symbol}(local_assigns)
old_output_buffer = output_buffer;#{locals_code};#{compiled_source}
ensure
self.output_buffer = old_output_buffer
end
end_src
source.force_encoding(Encoding::UTF_8) if source.respond_to?(:force_encoding)
begin
ActionView::Base::CompiledTemplates.module_eval(source, filename, 0)
rescue Errno::ENOENT => e
raise e # Missing template file, re-raise for Base to rescue
rescue Exception => e # errors from template code
if logger = defined?(ActionController) && Base.logger
logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
logger.debug "Function body: #{source}"
logger.debug "Backtrace: #{e.backtrace.join("\n")}"
end
raise ActionView::TemplateError.new(self, {}, e)
end
end
end
end
Rails::Initializer.run do |config|
...
config.after_initialize do
require 'lib/actionview_utf8'
end
end
require "mysql"
class Mysql::Result
def encode(value, encoding = "utf-8")
String === value ? value.force_encoding(encoding) : value
end
def each_utf8(&block)
each_orig do |row|
yield row.map {|col| encode(col) }
end
end
alias each_orig each
alias each each_utf8
def each_hash_utf8(&block)
each_hash_orig do |row|
row.each {|k, v| row[k] = encode(v) }
yield(row)
end
end
alias each_hash_orig each_hash
alias each_hash each_hash_utf8
end
Rails::Initializer.run do |config|
...
config.after_initialize do
require 'lib/actionview_utf8'
require 'lib/mysql_utf8'
end
end