green_shoes 0.221.0 → 0.226.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +25 -20
- data/VERSION +1 -1
- data/lib/shoes/basic.rb +1 -1
- data/lib/shoes/helper_methods.rb +4 -0
- data/lib/shoes/ruby.rb +1 -0
- data/lib/shoes/slot.rb +3 -1
- data/lib/shoes/text.rb +14 -4
- metadata +3 -3
data/README.md
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
Green Shoes
|
2
2
|
===========
|
3
3
|
|
4
|
-
|
4
|
+
> Let's have fun with Ruby and Shoes! :-D
|
5
|
+
>
|
6
|
+
> [ashbb](#)
|
7
|
+
|
8
|
+
Green Shoes is a Ruby domain specific language for beautiful Desktop Applications.
|
9
|
+
The Green Shoes dsl is so simple, even your pointy haired boss can understand it.
|
5
10
|
The Green Shoes project is based on _why-the-lucky-stiff's Shoes, except for the following:
|
6
11
|
|
7
|
-
* Green Shoes
|
8
|
-
* Green Shoes
|
9
|
-
* Green Shoes is green.
|
12
|
+
* Green Shoes source code is all Ruby, so even you can contribute.
|
13
|
+
* Green Shoes takes the Ruby DSL block-style approach, so all you have to do is write what you know: Ruby.
|
10
14
|
|
11
|
-
> Let's have fun with Ruby and Shoes! :-D
|
12
|
-
> - *ashbb*
|
13
15
|
|
14
16
|
Examples
|
15
17
|
========
|
16
18
|
|
17
19
|
Here is a quick example to get the juices flowing:
|
18
20
|
|
19
|
-
|
21
|
+
require 'green_shoes'
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
Shoes.app( :width => 250, :height => 250 ) do
|
24
|
+
para 'Hello, world!'
|
25
|
+
image 'images/shoes.png'
|
26
|
+
end
|
25
27
|
|
26
28
|
There are a lot of samples [here in the sample box](https://github.com/ashbb/green_shoes/tree/master/samples).
|
27
29
|
|
@@ -29,14 +31,13 @@ There are a lot of samples [here in the sample box](https://github.com/ashbb/gre
|
|
29
31
|
Installation
|
30
32
|
============
|
31
33
|
|
32
|
-
|
33
|
-
This requires three working dependencies:
|
34
|
+
Since Green Shoes is a Ruby Gem, all you need to install are:
|
34
35
|
|
35
36
|
1. [Ruby](http://ruby-lang.org) 1.9 or above
|
36
37
|
2. [Gems](http://rubygems.org) 1.5 or above
|
37
38
|
3. [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) 0.90.7 or above
|
38
39
|
|
39
|
-
Once you have all three requirements, you can simply install
|
40
|
+
Once you have all three requirements, you can simply install with this command:
|
40
41
|
|
41
42
|
gem install green_shoes
|
42
43
|
|
@@ -44,13 +45,17 @@ Once you have all three requirements, you can simply install the gem via Gems:
|
|
44
45
|
Documentation
|
45
46
|
=============
|
46
47
|
|
47
|
-
|
48
|
+
Read the [Manual](http://ashbb.github.com/green_shoes/) for all sorts of shoe-like good-ness
|
49
|
+
|
50
|
+
Check the [Wiki](http://github.com/ashbb/green_shoes/wiki) for extra documentation and details.
|
51
|
+
|
52
|
+
Please contribute to documentation whenever you can.
|
48
53
|
|
49
54
|
|
50
55
|
Bugs & Requests
|
51
56
|
===============
|
52
57
|
|
53
|
-
See [
|
58
|
+
See [Issues](http://github.com/ashbb/green_shoes/issues) for any bugs or feature requests.
|
54
59
|
|
55
60
|
|
56
61
|
License
|
@@ -101,7 +106,7 @@ SOFTWARE.
|
|
101
106
|
Credits
|
102
107
|
=======
|
103
108
|
|
104
|
-
_why-the-lucky-stiff, for coming up with the idea and the original shoes.
|
105
|
-
ashbb, for
|
106
|
-
|
107
|
-
|
109
|
+
* [_why-the-lucky-stiff](https://github.com/shoes/shoes), for coming up with the idea and the original shoes.
|
110
|
+
* [ashbb](https://github.com/ashbb), for developing Green Shoes.
|
111
|
+
* [zzak](https://github.com/zacharyscott), for creating fantastic logo and [web site](http://gshoes.heroku.com/).
|
112
|
+
* [krainboltgreene](https://github.com/krainboltgreene), for being terribly handsome.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.226.0
|
data/lib/shoes/basic.rb
CHANGED
data/lib/shoes/helper_methods.rb
CHANGED
data/lib/shoes/ruby.rb
CHANGED
data/lib/shoes/slot.rb
CHANGED
@@ -24,7 +24,7 @@ class Shoes
|
|
24
24
|
BASIC_ATTRIBUTES_DEFAULT.merge! hidden: true
|
25
25
|
SLOT_ATTRIBUTES_DEFAULT.merge! hidden: true
|
26
26
|
@hidden_flag = true unless @parent.instance_variable_get '@hidden'
|
27
|
-
|
27
|
+
end
|
28
28
|
yield
|
29
29
|
if @hidden_flag
|
30
30
|
BASIC_ATTRIBUTES_DEFAULT.delete :hidden
|
@@ -75,8 +75,10 @@ class Shoes
|
|
75
75
|
def fix_size; end
|
76
76
|
|
77
77
|
def clear &blk
|
78
|
+
@app.delete_mouse_events self
|
78
79
|
@contents.each &:clear
|
79
80
|
@contents.each{|e| @app.mlcs.delete e; @app.mhcs.delete e}
|
81
|
+
@contents = []
|
80
82
|
if blk
|
81
83
|
args = {}
|
82
84
|
initials.keys.each{|k| args[k] = instance_variable_get "@#{k}"}
|
data/lib/shoes/text.rb
CHANGED
@@ -15,8 +15,8 @@ class Shoes
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def link str, &blk
|
19
|
-
Link.new "#{LINK_DEFAULT}#{str}</span>", &blk
|
18
|
+
def link str, arg = {}, &blk
|
19
|
+
Link.new "#{LINK_DEFAULT}#{str}</span>", arg, &blk
|
20
20
|
end
|
21
21
|
|
22
22
|
def font name
|
@@ -32,8 +32,18 @@ class Shoes
|
|
32
32
|
end
|
33
33
|
|
34
34
|
class Link < Text
|
35
|
-
def initialize str, &blk
|
36
|
-
@link_proc
|
35
|
+
def initialize str, arg, &blk
|
36
|
+
@link_proc = if blk
|
37
|
+
blk
|
38
|
+
elsif arg[:click].is_a? String
|
39
|
+
proc{Shoes.APPS.first.app.visit arg[:click]}
|
40
|
+
elsif arg[:click].nil?
|
41
|
+
proc{}
|
42
|
+
else
|
43
|
+
arg[:click]
|
44
|
+
end
|
45
|
+
|
46
|
+
@pos, @index, @link_hover = nil, nil, false
|
37
47
|
super str
|
38
48
|
end
|
39
49
|
attr_reader :link_proc
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 226
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.226.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- ashbb
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-05
|
17
|
+
date: 2011-06-05 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|