such 0.2.1 → 0.3.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.
- checksums.yaml +4 -4
- data/README.rdoc +5 -6
- data/lib/such/such.rb +10 -4
- data/lib/such/thing.rb +1 -1
- data/lib/such/things.rb +13 -3
- data/lib/such/version.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4afc36d6359d3c503b0d03515002407d49ea8481
|
4
|
+
data.tar.gz: 9ac2e9cfb23196cc7a4b8617e225e0d8f7acc361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c860f4ab47f32acb9423f370ef7233f22361139c69f14f711f3c3fc1396fed3f1a57daffd4384b385995a145a9fdaf9864bd4e3ab0c17048e2edcbd43f1db8d
|
7
|
+
data.tar.gz: de85415afe96746685132700cff1c31329a606cee99ef12500c74ed37e29b585690c4f3ab370eac90f188360884a01ad8cdca957793811b08ba8910b06ba35e6
|
data/README.rdoc
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
== DESCRIPTION:
|
4
4
|
|
5
|
-
Wraps
|
5
|
+
Wraps widgets with an alternate constructor
|
6
6
|
which factors out the configuration and assembly procedures into metadata.
|
7
|
-
|
8
|
-
|
9
|
-
although currently only _Gtk3_ widgets is supported.
|
7
|
+
Can be used to wrap any class with the alternate constructor,
|
8
|
+
although currently only Gtk3 widgets is supported.
|
10
9
|
|
11
10
|
== SYNOPSIS:
|
12
11
|
|
@@ -78,14 +77,14 @@ ZetCode.com[http://zetcode.com/gui/rubygtk/].
|
|
78
77
|
== But wait! One more thing:
|
79
78
|
|
80
79
|
See link:examples/such_parts_demo in the examples directory
|
81
|
-
and link:test/tc_part for hints on how to use the much
|
80
|
+
and link:test/tc_part for hints on how to use the much powerful
|
82
81
|
Such::Part module link:lib/such/part.rb
|
83
82
|
|
84
83
|
== LICENSE:
|
85
84
|
|
86
85
|
(The MIT License)
|
87
86
|
|
88
|
-
Copyright (c)
|
87
|
+
Copyright (c) 2015
|
89
88
|
|
90
89
|
Permission is hereby granted, free of charge, to any person obtaining
|
91
90
|
a copy of this software and associated documentation files (the
|
data/lib/such/such.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
module Such
|
2
2
|
def self.subclass(clss, sprclss="Gtk::#{clss}", body='include Such::Thing')
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
code = <<-CODE
|
4
|
+
class #{clss} < #{sprclss}
|
5
|
+
#{body}
|
6
|
+
end
|
7
7
|
CODE
|
8
|
+
begin
|
9
|
+
eval code
|
10
|
+
rescue Exception
|
11
|
+
warn code
|
12
|
+
raise $!
|
13
|
+
end
|
8
14
|
end
|
9
15
|
end
|
data/lib/such/thing.rb
CHANGED
data/lib/such/things.rb
CHANGED
@@ -1,11 +1,21 @@
|
|
1
1
|
module Such
|
2
2
|
module Things
|
3
|
-
def self.list(
|
4
|
-
ObjectSpace.each_object(Class).select{|k| k <
|
3
|
+
def self.list(klss)
|
4
|
+
ObjectSpace.each_object(Class).select{|k| k < klss}
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.in(klass)
|
8
|
+
Things.list(klass).each do |clss|
|
9
|
+
begin
|
10
|
+
Such.subclass(clss.name.sub(/^.*::/, ''))
|
11
|
+
rescue Exception
|
12
|
+
warn "#{$!.class}:\t#{clss}"
|
13
|
+
end
|
14
|
+
end
|
5
15
|
end
|
6
16
|
|
7
17
|
def self.gtk_widget
|
8
|
-
Things.
|
18
|
+
Things.in(Gtk::Widget)
|
9
19
|
end
|
10
20
|
end
|
11
21
|
end
|
data/lib/such/version.rb
CHANGED
metadata
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: such
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carlosjhr64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
|
-
Wraps
|
14
|
+
Wraps widgets with an alternate constructor
|
15
15
|
which factors out the configuration and assembly procedures into metadata.
|
16
|
-
|
17
|
-
|
18
|
-
although currently only _Gtk3_ widgets is supported.
|
16
|
+
Can be used to wrap any class with the alternate constructor,
|
17
|
+
although currently only Gtk3 widgets is supported.
|
19
18
|
email: carlosjhr64@gmail.com
|
20
19
|
executables: []
|
21
20
|
extensions: []
|
@@ -51,12 +50,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
50
|
- !ruby/object:Gem::Version
|
52
51
|
version: '0'
|
53
52
|
requirements:
|
54
|
-
- 'ruby: ruby 2.
|
53
|
+
- 'ruby: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]'
|
55
54
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.4.1
|
55
|
+
rubygems_version: 2.4.5.1
|
57
56
|
signing_key:
|
58
57
|
specification_version: 4
|
59
|
-
summary: Wraps
|
60
|
-
|
58
|
+
summary: Wraps widgets with an alternate constructor which factors out the configuration
|
59
|
+
and assembly procedures into metadata. Can be used to wrap any class with the alternate
|
60
|
+
constructor, although currently only Gtk3 widgets is supported.
|
61
61
|
test_files: []
|
62
|
-
has_rdoc:
|