cheri 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,6 +30,11 @@ Types = Hash[
30
30
  :t! => TextElem,
31
31
  :esc! => EscElem,
32
32
  :proc! => ProcElem,
33
+ :comment! =>CommentElem
34
+ ]
35
+ Aliases = Hash[
36
+ :inspect! => :inpect,
37
+ :class! => :class
33
38
  ]
34
39
 
35
40
  end #Xml
data/lib/cheri/cheri.rb CHANGED
@@ -29,7 +29,7 @@ module Cheri
29
29
  module VERSION #:nodoc:
30
30
  MAJOR = 0
31
31
  MINOR = 0
32
- TINY = 5
32
+ TINY = 6
33
33
  STRING = [MAJOR, MINOR, TINY].join('.').freeze
34
34
  end
35
35
  #:stopdoc:
@@ -24,8 +24,10 @@
24
24
 
25
25
  require 'cheri/cheri'
26
26
 
27
- if (defined?JRUBY_VERSION) && 0 == (JRUBY_VERSION =~ /(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/) &&
28
- (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')
27
+ if (defined?JRUBY_VERSION) &&
28
+ ((JRUBY_VERSION =~ /^(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/ &&
29
+ (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')) ||
30
+ (JRUBY_VERSION =~ /^(\d+\.\d+)([-\.A-Z0-9]*)/ && $1 >= '1.1'))
29
31
  require 'cheri/jruby'
30
32
  end
31
33
 
@@ -550,8 +550,10 @@ class RubyExplorer
550
550
  Config::CONFIG
551
551
  end
552
552
 
553
- if (defined?JRUBY_VERSION) && 0 == (JRUBY_VERSION =~ /(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/) &&
554
- (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC2')) || $1 > '1.0.0')
553
+ if (defined?JRUBY_VERSION) &&
554
+ ((JRUBY_VERSION =~ /^(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/ &&
555
+ (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')) ||
556
+ (JRUBY_VERSION =~ /^(\d+\.\d+)([-\.A-Z0-9]*)/ && $1 >= '1.1'))
555
557
 
556
558
  System = ::Java::JavaLang::System
557
559
  Runtime = ::Java::JavaLang::Runtime
@@ -328,13 +328,24 @@ class ConstantResolver < Cheri::Builder::AbstractConstantResolver
328
328
  end #ConstantResolver
329
329
 
330
330
  class GenericClassBuilder < ClassBuilder
331
- def initialize(mod,*args,&block)
332
- super(*args,&block)
331
+ # TODO: eliminate ClassBuilder inheritance?
332
+ def initialize(mod,type,ctx,sym,*args,&block)
333
+ super(ctx,sym,type.clazz,*args,&block)
333
334
  @mod = mod
335
+ @type = type
334
336
  end
335
337
  def mod
336
338
  @mod
337
339
  end
340
+ def parent?
341
+ @type.parent?
342
+ end
343
+ def child?
344
+ @type.child?
345
+ end
346
+ def any?
347
+ @type.any?
348
+ end
338
349
  end #GenericClassBuilder
339
350
 
340
351
 
@@ -360,14 +371,14 @@ end #GenericCheriYieldBuilder
360
371
 
361
372
  class GenericBuilderFactory
362
373
  def initialize(mod,types)
363
- raise Cheri.type_error(types,Hash) unless Hash === types
374
+ raise Cheri.type_error(types,BuildType) unless BuildTypes === types
364
375
  @mod = mod
365
376
  @types = types
366
377
  @inv = types.invert
367
378
  end
368
379
  def builder(ctx,sym,*r,&k)
369
- if (clazz = @types[sym])
370
- GenericClassBuilder.new(@mod,ctx,sym,clazz,*r,&k)
380
+ if (type = @types[sym])
381
+ GenericClassBuilder.new(@mod,type,ctx,sym,*r,&k)
371
382
  elsif @inv[r.first.class]
372
383
  if sym == :cherify
373
384
  GenericCherifyBuilder.new(@mod,ctx,sym,*r,&k)
@@ -383,22 +394,32 @@ class GenericBuilderFactory
383
394
  end #GenericBuilderFactory
384
395
 
385
396
  class PackageFactory
386
- #:stopdoc:
397
+ # :stopdoc:
387
398
  Dot = '.'
388
399
  CJ = Cheri::Java
400
+ BuildType = Cheri::Builder::BuildType
401
+ BuildTypes = Cheri::Builder::BuildTypes
389
402
  #Util = Cheri::Java::Builder::Util
390
- #:startdoc:
403
+ # :startdoc:
391
404
  def initialize(pkg_str,mod)
392
405
  raise Cheri.type_error(pkg_str,String) unless String === pkg_str
393
406
  @pkg = pkg_str.empty? || pkg_str[-1] == ?. ? pkg_str.dup : pkg_str + Dot
394
407
  @mod = mod
395
- @classes = {}
408
+ @types = BuildTypes.new
396
409
  end
397
410
  def builder(ctx,sym,*r,&k)
398
- if (clazz = @classes[sym] ||= (CJ.get_class(@pkg + Util.cc(sym)) rescue :none)) != :none
399
- return GenericClassBuilder.new(@mod,ctx,sym,clazz,*r,&k)
411
+ unless type = @types[sym]
412
+ if clazz = CJ.get_class(@pkg + Util.cc(sym)) rescue nil
413
+ type = @types[sym] = BuildType.new(clazz,sym)
414
+ else
415
+ type = @types[sym] = :none
416
+ end
417
+ end
418
+ unless type == :none
419
+ GenericClassBuilder.new(@mod,type,ctx,sym,*r,&k)
420
+ else
421
+ nil
400
422
  end
401
- nil
402
423
  end
403
424
  end #PackageFactory
404
425
 
data/lib/cheri/jruby.rb CHANGED
@@ -22,8 +22,10 @@
22
22
  #++
23
23
  #
24
24
 
25
- if (defined?JRUBY_VERSION) && 0 == (JRUBY_VERSION =~ /(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/) &&
26
- (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')
25
+ if (defined?JRUBY_VERSION) &&
26
+ ((JRUBY_VERSION =~ /^(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/ &&
27
+ (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')) ||
28
+ (JRUBY_VERSION =~ /^(\d+\.\d+)([-\.A-Z0-9]*)/ && $1 >= '1.1'))
27
29
  require 'java'
28
30
  require 'cheri/cheri'
29
31
  require 'cheri/jruby/jruby'
@@ -21,8 +21,10 @@
21
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  #++
23
23
  #
24
- if (defined?JRUBY_VERSION) && 0 == (JRUBY_VERSION =~ /(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/) &&
25
- (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')
24
+ if (defined?JRUBY_VERSION) &&
25
+ ((JRUBY_VERSION =~ /^(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/ &&
26
+ (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')) ||
27
+ (JRUBY_VERSION =~ /^(\d+\.\d+)([-\.A-Z0-9]*)/ && $1 >= '1.1'))
26
28
 
27
29
  require 'cheri/html'
28
30
  require 'cheri/swing'
data/lib/cheri/swing.rb CHANGED
@@ -22,8 +22,10 @@
22
22
  #++
23
23
  #
24
24
 
25
- if (defined?JRUBY_VERSION) && 0 == (JRUBY_VERSION =~ /(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/) &&
26
- (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')
25
+ if (defined?JRUBY_VERSION) &&
26
+ ((JRUBY_VERSION =~ /^(\d+\.\d+\.\d+)([-\.A-Z0-9]*)/ &&
27
+ (($1 == '1.0.0' && ($2.empty? || $2 >= 'RC3')) || $1 > '1.0.0')) ||
28
+ (JRUBY_VERSION =~ /^(\d+\.\d+)([-\.A-Z0-9]*)/ && $1 >= '1.1'))
27
29
 
28
30
  require 'cheri/awt'
29
31
  require 'cheri/builder/swing/types'
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: cheri
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.5
7
- date: 2007-06-11 00:00:00 -07:00
6
+ version: 0.0.6
7
+ date: 2007-06-19 00:00:00 -07:00
8
8
  summary: Cheri Builder Platform
9
9
  require_paths:
10
10
  - lib
@@ -55,6 +55,7 @@ files:
55
55
  - lib/cheri/builder/html/main.rb
56
56
  - lib/cheri/builder/html/types.rb
57
57
  - lib/cheri/builder/main.rb
58
+ - lib/cheri/builder/markup.rb
58
59
  - lib/cheri/builder/swing
59
60
  - lib/cheri/builder/swing/connecter.rb
60
61
  - lib/cheri/builder/swing/constants.rb