Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addinig directory structure to samples for #312
* Created expert, good and simple subdirectories. * Moved relevent samples to their own directory. * Allow samples to be visible in the root directory. * Shared files are in the root directory.
- Loading branch information
Showing
51 changed files
with
24 additions
and
24 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 23 additions & 23 deletions
46
samples/simple-sqlite3.rb → samples/simple/simple-sqlite3.rb
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
require 'sqlite3' | ||
require 'fileutils' | ||
tmpdir = File.join(LIB_DIR,"sample-data") | ||
mkdir_p tmpdir | ||
dbfile = File.join(tmpdir, "simple-sqlite3.db") | ||
if File.exists? dbfile | ||
# this has a bad habit of failing on Windows | ||
rm dbfile | ||
end | ||
Shoes.app :width => 350, :height => 130 do | ||
info dbfile | ||
db = SQLite3::Database.new dbfile | ||
db.execute "create table t1 (t1key INTEGER PRIMARY KEY,data " \ | ||
"TEXT,num double,timeEnter DATE)" | ||
db.execute "insert into t1 (data,num) values ('This is sample data',3)" | ||
db.execute "insert into t1 (data,num) values ('More sample data',6)" | ||
#db.execute "insert into t1 (data,num) values ('Aurélio, Küng, Stärk, Uña, Łuksza',6)" | ||
db.execute "insert into t1 (data,num) values ('Aurlio, Kng, Strk, Ua, uksza',6)" | ||
db.execute "insert into t1 (data,num) values ('And a little more',9)" | ||
rows = db.execute "select * from t1" | ||
rows.each{|k, d, n| para "#{k} : #{d} : #{n}\n"} | ||
end | ||
require 'sqlite3' | ||
require 'fileutils' | ||
tmpdir = File.join(LIB_DIR,"sample-data") | ||
mkdir_p tmpdir | ||
dbfile = File.join(tmpdir, "simple-sqlite3.db") | ||
if File.exists? dbfile | ||
# this has a bad habit of failing on Windows | ||
rm dbfile | ||
end | ||
Shoes.app :width => 350, :height => 130 do | ||
info dbfile | ||
db = SQLite3::Database.new dbfile | ||
db.execute "create table t1 (t1key INTEGER PRIMARY KEY,data " \ | ||
"TEXT,num double,timeEnter DATE)" | ||
db.execute "insert into t1 (data,num) values ('This is sample data',3)" | ||
db.execute "insert into t1 (data,num) values ('More sample data',6)" | ||
#db.execute "insert into t1 (data,num) values ('Aurélio, Küng, Stärk, Uña, Łuksza',6)" | ||
db.execute "insert into t1 (data,num) values ('Aurlio, Kng, Strk, Ua, uksza',6)" | ||
db.execute "insert into t1 (data,num) values ('And a little more',9)" | ||
rows = db.execute "select * from t1" | ||
rows.each{|k, d, n| para "#{k} : #{d} : #{n}\n"} | ||
end | ||
|
File renamed without changes.