browser_gui 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +38 -0
- data/examples/simple_haml.rb +0 -1
- data/examples/simple_slim.rb +32 -0
- data/lib/browser_gui/version.rb +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -145,6 +145,44 @@ get "/link/:id" do
|
|
145
145
|
end
|
146
146
|
```
|
147
147
|
|
148
|
+
### A simple [Slim](http://slim-lang.com/) example
|
149
|
+
|
150
|
+
```
|
151
|
+
#!/usr/bin/env ruby
|
152
|
+
|
153
|
+
require "sinatra"
|
154
|
+
require "browser_gui"
|
155
|
+
require "slim"
|
156
|
+
|
157
|
+
SLIM =<<EOF
|
158
|
+
h1 Hello from Slim
|
159
|
+
form action="/action" method="post"
|
160
|
+
| Name:
|
161
|
+
input type="text" name="text" size=30
|
162
|
+
br
|
163
|
+
input type="submit"
|
164
|
+
ul
|
165
|
+
- (1..3).each do |i|
|
166
|
+
li
|
167
|
+
- href = "/link/" + i.to_s
|
168
|
+
a href=href
|
169
|
+
= (i == 1) ? "Click me!" : "No, click me!"
|
170
|
+
EOF
|
171
|
+
|
172
|
+
get "/" do
|
173
|
+
slim SLIM
|
174
|
+
end
|
175
|
+
|
176
|
+
post "/action" do
|
177
|
+
params.inspect
|
178
|
+
end
|
179
|
+
|
180
|
+
get "/link/:id" do
|
181
|
+
"You clicked link #{params[:id]}"
|
182
|
+
end
|
183
|
+
```
|
184
|
+
|
185
|
+
|
148
186
|
## Using command-line options
|
149
187
|
|
150
188
|
```
|
data/examples/simple_haml.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "sinatra"
|
4
|
+
require "browser_gui"
|
5
|
+
require "slim"
|
6
|
+
|
7
|
+
SLIM =<<EOF
|
8
|
+
h1 Hello from Slim
|
9
|
+
form action="/action" method="post"
|
10
|
+
| Name:
|
11
|
+
input type="text" name="text" size=30
|
12
|
+
br
|
13
|
+
input type="submit"
|
14
|
+
ul
|
15
|
+
- (1..3).each do |i|
|
16
|
+
li
|
17
|
+
- href = "/link/" + i.to_s
|
18
|
+
a href=href
|
19
|
+
= (i == 1) ? "Click me!" : "No, click me!"
|
20
|
+
EOF
|
21
|
+
|
22
|
+
get "/" do
|
23
|
+
slim SLIM
|
24
|
+
end
|
25
|
+
|
26
|
+
post "/action" do
|
27
|
+
params.inspect
|
28
|
+
end
|
29
|
+
|
30
|
+
get "/link/:id" do
|
31
|
+
"You clicked link #{params[:id]}"
|
32
|
+
end
|
data/lib/browser_gui/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser_gui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Use with Sinatra to create command-line scripts that open the browser
|
15
15
|
as a GUI.
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- examples/simple_form.rb
|
32
32
|
- examples/simple_haml.rb
|
33
33
|
- examples/simple_markdown.rb
|
34
|
+
- examples/simple_slim.rb
|
34
35
|
- lib/browser_gui.rb
|
35
36
|
- lib/browser_gui/version.rb
|
36
37
|
homepage: ''
|