wbzyl-datamapper-tutorial 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +9 -7
- data/Rakefile +8 -8
- data/VERSION.yml +4 -0
- data/config.ru +0 -5
- data/lib/config.ru +12 -0
- data/lib/datamapper-tutorial.rb +20 -5
- data/lib/public/doc/plain-text-files/contacts.yaml +11 -0
- data/lib/public/doc/plain-text-files/contacts_g.rb +105 -0
- data/lib/public/doc/plain-text-files/contacts_g_test.rb +51 -0
- data/lib/public/doc/plain-text-files/contacts_y.rb +57 -0
- data/lib/public/doc/plain-text-files/contacts_y_test.rb +39 -0
- data/lib/public/doc/plain-text-files/gdbm-example.rb +22 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Ja/305/233_Ma/305/202gosia/extras +0 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Ja/305/233_Ma/305/202gosia/home +0 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Ja/305/233_Ma/305/202gosia/work +0 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/extras +0 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/home +0 -0
- data/lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/work +0 -0
- data/lib/public/doc/using-plain-text-files-for-data-persistence.pdf +0 -0
- data/lib/public/images/datamapper.png +0 -0
- data/lib/public/images/datamapper.svg +95 -0
- data/lib/public/stylesheets/datamapper.css +160 -0
- data/lib/public/stylesheets/fonts/Cyklop-Italic.otf +0 -0
- data/lib/public/stylesheets/ie.css +1 -0
- data/lib/public/stylesheets/screen.css +48 -66
- data/lib/public/stylesheets/uv.css +121 -0
- data/lib/views/intro.rdiscount +10 -0
- data/lib/views/layout.rdiscount +28 -7
- data/lib/views/main.rdiscount +16 -6
- data/lib/views/using-plain-text-files-for-data-persistence.rdiscount +53 -0
- metadata +32 -12
- data/lib/public/Onyx_Mother_O_Pearl.html +0 -122
- data/lib/public/stylesheets/application.css +0 -113
- data/lib/public/stylesheets/coderay.css +0 -99
data/lib/views/layout.rdiscount
CHANGED
@@ -2,16 +2,37 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
5
|
-
<link rel="stylesheet" href="/stylesheets/screen.css" type="text/css" media="screen" charset="utf-8">
|
6
|
-
<link rel="stylesheet" href="/stylesheets/print.css" type="text/css" media="print" charset="utf-8">
|
7
|
-
<link rel="stylesheet" href="/stylesheets/coderay.css" type="text/css" media="screen" charset="utf-8">
|
8
|
-
<link rel="stylesheet" href="/stylesheets/application.css" type="text/css" media="screen" charset="utf-8">
|
9
5
|
|
10
|
-
|
6
|
+
<%= stylesheet_link_tag "/stylesheets/screen.css", "/stylesheets/uv.css", "/stylesheets/datamapper.css" %>
|
7
|
+
<%= stylesheet_link_tag "/stylesheets/print.css", :media => "print" %>
|
8
|
+
<!--[if IE]>
|
9
|
+
<%= stylesheet_link_tag "css/blueprint/ie.css" %>
|
10
|
+
<![endif]-->
|
11
|
+
|
12
|
+
<title><%= "WB_Datamapper" + page_title %></title>
|
11
13
|
</head>
|
12
14
|
<body>
|
13
|
-
<div class="
|
14
|
-
|
15
|
+
<div class="span-21" id="header">
|
16
|
+
<div class="push-1 span-7">
|
17
|
+
<a href="/datamapper/"><span id="wb">WB</span>@<span id="tutorial">Datamapper</span></a>
|
18
|
+
</div>
|
19
|
+
<div class="span-13 last">
|
20
|
+
<div class="append-1" id="links">
|
21
|
+
<a href="http://wbzyl.ug.edu.pl/">home</a>
|
22
|
+
<a href="http://wbzyl.ug.edu.pl/galeria">galeria</a>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="span-21 container"><!-- showgrid -->
|
28
|
+
<div class="push-1 span-12" id="content">
|
29
|
+
|
30
|
+
<%= yield %>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
<div class="span-8 last">
|
34
|
+
</div>
|
15
35
|
</div>
|
36
|
+
|
16
37
|
</body>
|
17
38
|
</html>
|
data/lib/views/main.rdiscount
CHANGED
@@ -1,9 +1,19 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# Samouczek
|
2
|
+
|
3
|
+
1. {%= link_to "Rozkład jazdy", "/intro" %}
|
4
|
+
1. {%= link_to "Pliki tekstowe dla data persistence", "/using-plain-text-files-for-data-persistence" %}
|
5
|
+
|
6
|
+
## Datamapper
|
7
|
+
|
8
|
+
<blockquote>
|
9
|
+
{%= image_tag "/images/conan_doyle.jpg", :alt => "[Sir Arthur Conan Doyle]" %}
|
10
|
+
<p>
|
11
|
+
I never guess. It is a capital mistake to theorize before one has
|
12
|
+
data. Insensibly one begins to twist facts to suit theories, instead
|
13
|
+
of theories to suit facts.
|
14
|
+
</p>
|
15
|
+
<p class="author">— Sir Arthur Conan Doyle</p>
|
16
|
+
</blockquote>
|
7
17
|
|
8
18
|
## Instalacja
|
9
19
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#### {% title "Zapamiętywanie danych" %}
|
2
|
+
|
3
|
+
# Pliki tekstowe
|
4
|
+
|
5
|
+
Sesja irb:
|
6
|
+
|
7
|
+
:::ruby
|
8
|
+
hash = { :one => 1, :two => 2, :colors => ["red", "green", "blue"] }
|
9
|
+
require 'yaml'
|
10
|
+
puts hash.to_yaml
|
11
|
+
y_hash = hash.to_yaml
|
12
|
+
new_hash = YAML.load(y_hash)
|
13
|
+
new_hash == hash #=> true
|
14
|
+
|
15
|
+
<b>You need a way</b> to automate the storage and retrieval of professional
|
16
|
+
and personal contacts (an address book), but you want it to be in
|
17
|
+
plain text so that you can edit the entries in a text editor as well
|
18
|
+
as alter them <i>programmatically</i>.
|
19
|
+
|
20
|
+
### Rozwiązanie
|
21
|
+
|
22
|
+
Zobacz, `/doc/...`
|
23
|
+
|
24
|
+
|
25
|
+
## Proste bazy danych
|
26
|
+
|
27
|
+
You want a simple contact manager, and you need to share the files
|
28
|
+
with someone who may not have access to YAML.
|
29
|
+
|
30
|
+
### Rozwiązanie
|
31
|
+
|
32
|
+
Our hypothetical YAML crisis provides a chance to look at a gdbm-based
|
33
|
+
solution. We'll aim for something that's as close as possible to
|
34
|
+
the YAML version of the contact manager, and the best way to guarantee
|
35
|
+
that closeness is to use a similar test suite.
|
36
|
+
|
37
|
+
|
38
|
+
## Stone: Dead-Simple Data Persistence
|
39
|
+
|
40
|
+
To może być ciekawe [Dead-Simple Data Persistence] [stone].
|
41
|
+
|
42
|
+
[stone]: http://stone.rubyforge.org/ "Dead-Simple Data Persistence"
|
43
|
+
|
44
|
+
For small applications, a database can be overkill for storing your
|
45
|
+
data in a consistent and organized manner. Therefore, Stone was built
|
46
|
+
to provide plug-and-play data persistence for any application or
|
47
|
+
framework. It is fast, and it is easy… therefore it is good.
|
48
|
+
|
49
|
+
Instalacja:
|
50
|
+
|
51
|
+
sudo gem install stone
|
52
|
+
|
53
|
+
Czy to będzie działać z Sinatrą? Przykład: Fortunka?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wbzyl-datamapper-tutorial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wlodek Bzyl
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-02 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: "0"
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
|
-
name: sinatra-rdiscount
|
46
|
+
name: wbzyl-sinatra-rdiscount
|
47
47
|
type: :runtime
|
48
48
|
version_requirement:
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
version: "0"
|
54
54
|
version:
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: codehighlighter-middleware
|
56
|
+
name: wbzyl-codehighlighter-middleware
|
57
57
|
type: :runtime
|
58
58
|
version_requirement:
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: "0"
|
74
74
|
version:
|
75
|
-
description: Moje
|
75
|
+
description: Moje notatki do Datamappera.
|
76
76
|
email: matwb@univ.gda.pl
|
77
77
|
executables: []
|
78
78
|
|
@@ -83,13 +83,30 @@ extra_rdoc_files:
|
|
83
83
|
- TODO
|
84
84
|
files:
|
85
85
|
- Rakefile
|
86
|
+
- TODO
|
87
|
+
- VERSION.yml
|
86
88
|
- config.ru
|
89
|
+
- lib/config.ru
|
87
90
|
- lib/datamapper-tutorial.rb
|
88
|
-
- lib/public/
|
91
|
+
- lib/public/doc/plain-text-files/contacts.yaml
|
92
|
+
- lib/public/doc/plain-text-files/contacts_g.rb
|
93
|
+
- lib/public/doc/plain-text-files/contacts_g_test.rb
|
94
|
+
- lib/public/doc/plain-text-files/contacts_y.rb
|
95
|
+
- lib/public/doc/plain-text-files/contacts_y_test.rb
|
96
|
+
- lib/public/doc/plain-text-files/gdbm-example.rb
|
97
|
+
- "lib/public/doc/plain-text-files/gdbm_contacts/Ja\xC5\x9B_Ma\xC5\x82gosia/extras"
|
98
|
+
- "lib/public/doc/plain-text-files/gdbm_contacts/Ja\xC5\x9B_Ma\xC5\x82gosia/home"
|
99
|
+
- "lib/public/doc/plain-text-files/gdbm_contacts/Ja\xC5\x9B_Ma\xC5\x82gosia/work"
|
100
|
+
- lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/extras
|
101
|
+
- lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/home
|
102
|
+
- lib/public/doc/plain-text-files/gdbm_contacts/Joe_Smith/work
|
103
|
+
- lib/public/doc/using-plain-text-files-for-data-persistence.pdf
|
89
104
|
- lib/public/favicon.ico
|
90
105
|
- lib/public/images/conan_doyle.jpg
|
91
|
-
- lib/public/
|
92
|
-
- lib/public/
|
106
|
+
- lib/public/images/datamapper.png
|
107
|
+
- lib/public/images/datamapper.svg
|
108
|
+
- lib/public/stylesheets/datamapper.css
|
109
|
+
- lib/public/stylesheets/fonts/Cyklop-Italic.otf
|
93
110
|
- lib/public/stylesheets/icons/cross.png
|
94
111
|
- lib/public/stylesheets/icons/doc.png
|
95
112
|
- lib/public/stylesheets/icons/email.png
|
@@ -108,12 +125,15 @@ files:
|
|
108
125
|
- lib/public/stylesheets/src/grid.png
|
109
126
|
- lib/public/stylesheets/src/make_background_images.sh
|
110
127
|
- lib/public/stylesheets/src/shattered_mirror.png
|
128
|
+
- lib/public/stylesheets/uv.css
|
129
|
+
- lib/views/intro.rdiscount
|
111
130
|
- lib/views/layout.rdiscount
|
112
131
|
- lib/views/main.rdiscount
|
132
|
+
- lib/views/using-plain-text-files-for-data-persistence.rdiscount
|
113
133
|
- README.markdown
|
114
|
-
- TODO
|
115
134
|
has_rdoc: false
|
116
|
-
homepage: http://github.com/wbzyl/tutorial
|
135
|
+
homepage: http://github.com/wbzyl/datamapper-tutorial
|
136
|
+
licenses:
|
117
137
|
post_install_message:
|
118
138
|
rdoc_options:
|
119
139
|
- --charset=UTF-8
|
@@ -134,9 +154,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
154
|
requirements: []
|
135
155
|
|
136
156
|
rubyforge_project: datamapper-tutorial
|
137
|
-
rubygems_version: 1.
|
157
|
+
rubygems_version: 1.3.5
|
138
158
|
signing_key:
|
139
159
|
specification_version: 3
|
140
|
-
summary: Prosta aplikacja Sinatry
|
160
|
+
summary: Prosta aplikacja Sinatry.
|
141
161
|
test_files: []
|
142
162
|
|
@@ -1,122 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
-
<title>COLOURlovers - Onyx Mother O Pearl</title>
|
6
|
-
<style type="text/css"><!--
|
7
|
-
|
8
|
-
html {
|
9
|
-
padding: 0px;
|
10
|
-
margin: 0px;
|
11
|
-
}
|
12
|
-
|
13
|
-
body {
|
14
|
-
background-color: #161616;
|
15
|
-
font-size: 10px;
|
16
|
-
font-family: Verdana, Arial, SunSans-Regular, Sans-Serif;
|
17
|
-
color: #cccccc;
|
18
|
-
padding: 0px;
|
19
|
-
margin: 0px;
|
20
|
-
margin-top: 20px;
|
21
|
-
}
|
22
|
-
|
23
|
-
h1 {
|
24
|
-
font-size: 16px;
|
25
|
-
text-align: center;
|
26
|
-
}
|
27
|
-
|
28
|
-
a {
|
29
|
-
font-size: 12px;
|
30
|
-
}
|
31
|
-
a:link {
|
32
|
-
color: #cccccc;
|
33
|
-
}
|
34
|
-
|
35
|
-
a:visited {
|
36
|
-
color: #cccccc;
|
37
|
-
}
|
38
|
-
|
39
|
-
a:hover {
|
40
|
-
color: #cccccc;
|
41
|
-
}
|
42
|
-
|
43
|
-
a:active {
|
44
|
-
color: #cccccc;
|
45
|
-
}
|
46
|
-
|
47
|
-
.border
|
48
|
-
{
|
49
|
-
border: 1px solid #cccccc;
|
50
|
-
float: left;
|
51
|
-
margin: 5px;
|
52
|
-
padding: 1px;
|
53
|
-
}
|
54
|
-
|
55
|
-
.center {
|
56
|
-
text-align: center;
|
57
|
-
}
|
58
|
-
|
59
|
-
.color
|
60
|
-
{
|
61
|
-
display: block;
|
62
|
-
height: 120px;
|
63
|
-
width: 120px;
|
64
|
-
}
|
65
|
-
|
66
|
-
.colorcontainer {
|
67
|
-
margin: 0px auto;
|
68
|
-
width: 670px;
|
69
|
-
text-align: center;
|
70
|
-
}
|
71
|
-
|
72
|
-
.colorname {
|
73
|
-
text-align: left;
|
74
|
-
}
|
75
|
-
|
76
|
-
--></style>
|
77
|
-
</head>
|
78
|
-
<body>
|
79
|
-
<h1>COLOURlovers - Onyx Mother O Pearl</h1>
|
80
|
-
<div class="center">
|
81
|
-
<div class="colorcontainer">
|
82
|
-
<span class="border" title="#0B030C">
|
83
|
-
<span class="color" style="background-color: #0B030C"></span>
|
84
|
-
<span class="colorname">
|
85
|
-
RGB: 11, 3, 12<br>
|
86
|
-
Hex: #0B030C
|
87
|
-
</span>
|
88
|
-
</span>
|
89
|
-
<span class="border" title="#E3E6F7">
|
90
|
-
<span class="color" style="background-color: #E3E6F7"></span>
|
91
|
-
<span class="colorname">
|
92
|
-
RGB: 227, 230, 247<br>
|
93
|
-
Hex: #E3E6F7
|
94
|
-
</span>
|
95
|
-
</span>
|
96
|
-
<span class="border" title="#FEF9F0">
|
97
|
-
<span class="color" style="background-color: #FEF9F0"></span>
|
98
|
-
<span class="colorname">
|
99
|
-
RGB: 254, 249, 240<br>
|
100
|
-
Hex: #FEF9F0
|
101
|
-
</span>
|
102
|
-
</span>
|
103
|
-
<span class="border" title="#FFE9FD">
|
104
|
-
<span class="color" style="background-color: #FFE9FD"></span>
|
105
|
-
<span class="colorname">
|
106
|
-
RGB: 255, 233, 253<br>
|
107
|
-
Hex: #FFE9FD
|
108
|
-
</span>
|
109
|
-
</span>
|
110
|
-
<span class="border" title="#FCE5C0">
|
111
|
-
<span class="color" style="background-color: #FCE5C0"></span>
|
112
|
-
<span class="colorname">
|
113
|
-
RGB: 252, 229, 192<br>
|
114
|
-
Hex: #FCE5C0
|
115
|
-
</span>
|
116
|
-
</span>
|
117
|
-
|
118
|
-
<a href="http://www.colourlovers.com/palette//Onyx Mother O Pearl" title="Colourlovers Onyx Mother O Pearl">Colourlovers 'Onyx Mother O Pearl' palette</a>
|
119
|
-
</div>
|
120
|
-
</div>
|
121
|
-
</body>
|
122
|
-
</html>
|
@@ -1,113 +0,0 @@
|
|
1
|
-
html {
|
2
|
-
background: #121621 url(src/shattered_mirror.png);
|
3
|
-
}
|
4
|
-
|
5
|
-
body {
|
6
|
-
width: 913px;
|
7
|
-
margin: 40px 0px 0px 42px;
|
8
|
-
padding: 0 0 11px 22px;
|
9
|
-
line-height: 1.6;
|
10
|
-
-moz-border-radius: 11px;
|
11
|
-
border-color: black;
|
12
|
-
border-right: 4px inset;
|
13
|
-
border-bottom: 4px inset;
|
14
|
-
background-color: red;
|
15
|
-
background: transparent url(src/body.png) repeat-y;
|
16
|
-
}
|
17
|
-
|
18
|
-
.container {
|
19
|
-
width: 561px;
|
20
|
-
-moz-border-radius: 11px;
|
21
|
-
background-color: rgb(254, 249, 240);
|
22
|
-
}
|
23
|
-
|
24
|
-
h1 {
|
25
|
-
width: 880px;
|
26
|
-
margin: 0 0 22px -11px;
|
27
|
-
padding: 22px 22px 22px 11px;
|
28
|
-
font-family: Airmole Stripe, Times, serif;
|
29
|
-
font-weight: normal;
|
30
|
-
letter-spacing: 2px;
|
31
|
-
text-transform: uppercase;
|
32
|
-
/* font-variant: small-caps; */
|
33
|
-
background-color: #121621;
|
34
|
-
color: rgb(237,0,86);
|
35
|
-
-moz-border-radius-topright: 7px;
|
36
|
-
}
|
37
|
-
|
38
|
-
h2, h3, h4 {
|
39
|
-
margin-right: 11px;
|
40
|
-
color: black;
|
41
|
-
}
|
42
|
-
|
43
|
-
h2 {
|
44
|
-
border-bottom: 2px dotted black;
|
45
|
-
}
|
46
|
-
|
47
|
-
blockquote {
|
48
|
-
/*
|
49
|
-
width: 341px;
|
50
|
-
margin-left: 561px;
|
51
|
-
*/
|
52
|
-
width: 275px;
|
53
|
-
margin: 0 0 0 583px;
|
54
|
-
padding: 11px 11px 0 11px;
|
55
|
-
position: absolute;
|
56
|
-
background: rgb(252, 229, 192);
|
57
|
-
-moz-border-radius: 8px;
|
58
|
-
}
|
59
|
-
|
60
|
-
blockquote img {
|
61
|
-
margin: 0 auto 11px auto;
|
62
|
-
display: block;
|
63
|
-
}
|
64
|
-
|
65
|
-
blockquote p.author {
|
66
|
-
margin-top: -1.5em;
|
67
|
-
padding-right: 44px;
|
68
|
-
color: black;
|
69
|
-
font-style: italic;
|
70
|
-
text-align: right;
|
71
|
-
}
|
72
|
-
|
73
|
-
pre, code {
|
74
|
-
font-family: Andale Mono, monospace;
|
75
|
-
}
|
76
|
-
|
77
|
-
pre {
|
78
|
-
margin-left: -33px;
|
79
|
-
padding-left: 33px;
|
80
|
-
border-left: 22px solid rgb(237,0,86);
|
81
|
-
}
|
82
|
-
|
83
|
-
pre code, li pre {
|
84
|
-
margin: 0;
|
85
|
-
padding: 0;
|
86
|
-
border: none;
|
87
|
-
}
|
88
|
-
|
89
|
-
code {
|
90
|
-
margin: 0 2px;
|
91
|
-
padding: 0.06em 0.125em;
|
92
|
-
border: 1px solid #403B33;
|
93
|
-
}
|
94
|
-
|
95
|
-
caption {
|
96
|
-
text-align: right;
|
97
|
-
}
|
98
|
-
|
99
|
-
thead th {
|
100
|
-
background-color: #ADD8C7;
|
101
|
-
}
|
102
|
-
|
103
|
-
.table1 {
|
104
|
-
background-color: #EB7C7C;
|
105
|
-
}
|
106
|
-
|
107
|
-
.table2 {
|
108
|
-
background-color: #ECB39F;
|
109
|
-
}
|
110
|
-
|
111
|
-
li ul {
|
112
|
-
margin-bottom: 1.5em;
|
113
|
-
}
|