such 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/such/parts.rb +11 -4
- data/lib/such/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa58153d86bf6074ae44f9ddb9b0d75f2974425
|
4
|
+
data.tar.gz: b62521c79d8f591ce2bfd0cd7365ab419c8bb99c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784228d9e8176604fcb782f4a4ebca93d58e80292b261cf624659f1d5595e9cb089aa8f21dcabb106ef41eb3d44dc2ca8e3c020e6bacc682b325b86bff02abe7
|
7
|
+
data.tar.gz: 3298e0be3b96149b0433fc59cd54b9934338ecb7cd1befeff07e3153c45d2671ebd48bf34b468194861bcab16791b49e2f16ea846dfd68fbc9e7909a7bdc0fd7
|
data/lib/such/parts.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
module Such
|
2
2
|
module Parts
|
3
3
|
def self.make(part, thing, *plugs)
|
4
|
-
raise "
|
5
|
-
plugs.each
|
6
|
-
|
7
|
-
|
4
|
+
raise "Such::#{thing} not defined." unless Object.const_defined?("Such::#{thing}")
|
5
|
+
plugs.each do |plug|
|
6
|
+
if /^[^\W_]+_(?<klass>[^\W_]+)$/=~plug
|
7
|
+
next unless $VERBOSE
|
8
|
+
unless Object.const_defined?("Such::#{klass}")
|
9
|
+
$stderr.puts "Warning: Such::#{klass} not defined yet."
|
10
|
+
end
|
11
|
+
else
|
12
|
+
raise "Plugs must have the form key_class: #{plug}"
|
13
|
+
end
|
14
|
+
end
|
8
15
|
Such.subclass part, thing, <<-EOT
|
9
16
|
attr_accessor :#{plugs.join(', :')}
|
10
17
|
def self.plugs
|
data/lib/such/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: such
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carlosjhr64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Wraps Ruby's Gtk widgets with an alternate constructor
|