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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 273d09f4d688a045d6a70dd875eb512b2241de79
4
- data.tar.gz: 09d23e4dfb1159e745dfe4a36df55de114e44e90
3
+ metadata.gz: 2aa58153d86bf6074ae44f9ddb9b0d75f2974425
4
+ data.tar.gz: b62521c79d8f591ce2bfd0cd7365ab419c8bb99c
5
5
  SHA512:
6
- metadata.gz: eb329b8288a37f2a788fd9992e0235b2b261e305f1f9320413af205b602ec00fb8d52fdf2dd52969ed604154849272eeb79965b0b3426e0c656874314cd08a4d
7
- data.tar.gz: 643ef446c8492324a1863c86ad4ad0724926d32370ec3af73e60b675131233e03dcaebd9ebd854a12343a19195c513683f62c4ba1c491b284aaf9e60b2346774
6
+ metadata.gz: 784228d9e8176604fcb782f4a4ebca93d58e80292b261cf624659f1d5595e9cb089aa8f21dcabb106ef41eb3d44dc2ca8e3c020e6bacc682b325b86bff02abe7
7
+ data.tar.gz: 3298e0be3b96149b0433fc59cd54b9934338ecb7cd1befeff07e3153c45d2671ebd48bf34b468194861bcab16791b49e2f16ea846dfd68fbc9e7909a7bdc0fd7
@@ -1,10 +1,17 @@
1
1
  module Such
2
2
  module Parts
3
3
  def self.make(part, thing, *plugs)
4
- raise "Superclass(#{thing}) must be a Such::Thing" unless Object.const_get(thing) < Such::Thing
5
- plugs.each{|plug|
6
- raise "Plugs must have the form key_class: #{plug}" unless plug=~/^[^\W_]+_[^\W_]+$/
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
@@ -1,3 +1,3 @@
1
1
  module Such
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
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.1.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-15 00:00:00.000000000 Z
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