glue 0.16.0 → 0.17.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/CHANGELOG +20 -0
- data/README +1 -1
- data/Rakefile +2 -2
- data/doc/RELEASES +8 -1
- data/lib/glue/aspects.rb +7 -10
- data/lib/glue/cache.rb +0 -2
- data/lib/glue/number.rb +2 -2
- data/lib/glue/property.rb +7 -12
- data/lib/glue.rb +12 -5
- metadata +13 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
15-05-2005 George Moschovitis <gm@navel.gr>
|
2
|
+
|
3
|
+
* doc/RELEASES: updated.
|
4
|
+
|
5
|
+
01-05-2005 George Moschovitis <gm@navel.gr>
|
6
|
+
|
7
|
+
* lib/glue.rb: nil.blank?
|
8
|
+
|
9
|
+
25-04-2005 George Moschovitis <gm@navel.gr>
|
10
|
+
|
11
|
+
* lib/glue/property.rb (Property): removed name.
|
12
|
+
|
13
|
+
23-04-2005 George Moschovitis <gm@navel.gr>
|
14
|
+
|
15
|
+
* lib/glue/property.rb: properties helper.
|
16
|
+
|
17
|
+
22-04-2005 George Moschovitis <gm@navel.gr>
|
18
|
+
|
19
|
+
* lib/glue/property.rb: include Og::EntityMixin if calling property.
|
20
|
+
|
1
21
|
15-04-2005 George Moschovitis <gm@navel.gr>
|
2
22
|
|
3
23
|
* lib/glue/aspects.rb (#append_features): fixed stupid include bug!
|
data/README
CHANGED
data/Rakefile
CHANGED
@@ -59,8 +59,8 @@ spec = Gem::Specification.new do |s|
|
|
59
59
|
end
|
60
60
|
s.summary = 'Glue utilities'
|
61
61
|
s.description = 'A collection of utilities and useful classes'
|
62
|
-
|
63
|
-
#
|
62
|
+
s.add_dependency 'facets', '>= 0.7.1'
|
63
|
+
#s.add_dependency 'flexmock', '>= 0.0.3'
|
64
64
|
|
65
65
|
s.required_ruby_version = '>= 1.8.2'
|
66
66
|
|
data/doc/RELEASES
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
== Version 0.
|
1
|
+
== Version 0.17.0
|
2
|
+
|
3
|
+
A lot of fucntionality is deprecated. The great Facets library
|
4
|
+
will gradually replace the general utility methods found in
|
5
|
+
Glue.
|
6
|
+
|
7
|
+
|
8
|
+
== Version 0.16.0 was released on 16/04/2005.
|
2
9
|
|
3
10
|
A snapshot of the latest developments. Many, many subtle improvements,
|
4
11
|
new features and a major cleanup of the source code.
|
data/lib/glue/aspects.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# * George Moschovitis <gm@navel.gr>
|
2
|
-
# (c) 2005 Navel, all rights reserved.
|
3
|
-
# $Id: aspects.rb 20 2005-04-15 15:18:36Z gmosx $
|
4
|
-
|
5
1
|
require 'glue/property'
|
6
2
|
|
7
3
|
module Glue
|
@@ -142,8 +138,9 @@ module Aspects
|
|
142
138
|
def self.append_features(base)
|
143
139
|
super
|
144
140
|
base.extend(ClassMethods)
|
141
|
+
|
145
142
|
base.module_eval %{
|
146
|
-
Glue::PropertyUtils.enchant(self)
|
143
|
+
Glue::PropertyUtils.enchant(self)
|
147
144
|
|
148
145
|
def self.advices
|
149
146
|
__meta[:advices] || []
|
@@ -153,15 +150,15 @@ module Aspects
|
|
153
150
|
__meta[:advices] = advices
|
154
151
|
end
|
155
152
|
|
156
|
-
#
|
153
|
+
#def self.inherited(child)
|
157
154
|
# super
|
158
155
|
# child.send(:include, Aspects)
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
156
|
+
#end
|
157
|
+
#
|
158
|
+
#def self.append_features(base)
|
162
159
|
# super
|
163
160
|
# base.send(:include, Aspects)
|
164
|
-
#
|
161
|
+
#end
|
165
162
|
}
|
166
163
|
end
|
167
164
|
|
data/lib/glue/cache.rb
CHANGED
data/lib/glue/number.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# * George Moschovitis <gm@navel.gr>
|
2
2
|
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
-
# $Id: number.rb
|
3
|
+
# $Id: number.rb 35 2005-05-04 07:49:35Z gmosx $
|
4
4
|
|
5
5
|
module Glue;
|
6
6
|
|
@@ -12,7 +12,7 @@ module Glue;
|
|
12
12
|
module NumberUtils
|
13
13
|
|
14
14
|
# Returns the multiple ceil of a number
|
15
|
-
|
15
|
+
|
16
16
|
def self.ceil_multiple(num, multiple)
|
17
17
|
# gmosx: to_f is needed!s
|
18
18
|
# gmosx: IS THERE a more optimized way to do this?
|
data/lib/glue/property.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
# * George Moschovitis <gm@navel.gr>
|
2
|
-
# * Michael Neumann <mneumann@ntecs.de>
|
3
|
-
# (c) 2004-2005 Navel, all rights reserved.
|
4
|
-
# $Id: property.rb 20 2005-04-15 15:18:36Z gmosx $
|
5
|
-
|
6
1
|
require 'glue/attribute'
|
7
2
|
require 'glue/array'
|
8
3
|
require 'glue/hash'
|
@@ -34,10 +29,6 @@ class Property
|
|
34
29
|
|
35
30
|
attr_accessor :symbol
|
36
31
|
|
37
|
-
# The string representation of the symbol.
|
38
|
-
|
39
|
-
attr_accessor :name
|
40
|
-
|
41
32
|
# The class of the property.
|
42
33
|
|
43
34
|
attr_accessor :klass
|
@@ -62,7 +53,6 @@ class Property
|
|
62
53
|
def initialize(symbol, klass, meta = {})
|
63
54
|
@symbol, @klass = symbol, klass
|
64
55
|
@meta = meta
|
65
|
-
@name = @symbol.to_s()
|
66
56
|
end
|
67
57
|
|
68
58
|
def ==(other)
|
@@ -70,7 +60,7 @@ class Property
|
|
70
60
|
end
|
71
61
|
|
72
62
|
def to_s
|
73
|
-
return
|
63
|
+
return @symbol.to_s
|
74
64
|
end
|
75
65
|
|
76
66
|
end
|
@@ -104,6 +94,10 @@ module PropertyUtils
|
|
104
94
|
@__props
|
105
95
|
end
|
106
96
|
|
97
|
+
def self.properties
|
98
|
+
@__props
|
99
|
+
end
|
100
|
+
|
107
101
|
def self.__props=(props)
|
108
102
|
@__props = props
|
109
103
|
end
|
@@ -257,8 +251,9 @@ module PropertyUtils
|
|
257
251
|
def self.include_meta_mixins(target)
|
258
252
|
target.module_eval %{ include Glue::Validation } if defined?(Glue::Validation)
|
259
253
|
# gmosx: TODO, make Og::MetaLanguage equivalent to Validation.
|
260
|
-
target.module_eval %{ extend Og::MetaLanguage } if defined?(Og::MetaLanguage)
|
254
|
+
# target.module_eval %{ extend Og::MetaLanguage } if defined?(Og::MetaLanguage)
|
261
255
|
target.module_eval %{ include Glue::Aspects } if defined?(Glue::Aspects)
|
256
|
+
target.send(:include, Og::EntityMixin) if defined?(Og::EntityMixin)
|
262
257
|
end
|
263
258
|
|
264
259
|
# Resolves the parameters passed to the propxxx macros
|
data/lib/glue.rb
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
#
|
3
3
|
# General libraries used by various projects.
|
4
4
|
#
|
5
|
-
# George Moschovitis
|
6
|
-
# (c) 2004-2005 Navel
|
7
|
-
#
|
5
|
+
# Copyright (c) 2004-2005, George Moschovitis (http://www.gmosx.com)
|
6
|
+
# Copyright (c) 2004-2005, Navel Ltd (http://www.navel.gr)
|
7
|
+
#
|
8
|
+
# Glue is copyrighted free software created and maintained by
|
9
|
+
# George Moschovitis (mailto:gm@navel.gr) and released under the
|
10
|
+
# standard BSD Licence. For details consult the file doc/LICENCE.
|
8
11
|
|
9
12
|
require 'English'
|
10
13
|
require 'pp'
|
@@ -18,7 +21,11 @@ class NilClass
|
|
18
21
|
# a bit dangerous? Will have to rethink this.
|
19
22
|
|
20
23
|
def empty?
|
21
|
-
|
24
|
+
true
|
25
|
+
end
|
26
|
+
|
27
|
+
def blank?
|
28
|
+
true
|
22
29
|
end
|
23
30
|
end
|
24
31
|
|
@@ -53,7 +60,7 @@ module Glue
|
|
53
60
|
|
54
61
|
# The version.
|
55
62
|
|
56
|
-
Version = '0.
|
63
|
+
Version = '0.17.0'
|
57
64
|
|
58
65
|
# Library path.
|
59
66
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
|
|
3
3
|
specification_version: 1
|
4
4
|
name: glue
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.17.0
|
7
|
+
date: 2005-05-16
|
8
8
|
summary: Glue utilities
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -106,4 +106,14 @@ extra_rdoc_files:
|
|
106
106
|
executables: []
|
107
107
|
extensions: []
|
108
108
|
requirements: []
|
109
|
-
dependencies:
|
109
|
+
dependencies:
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: facets
|
112
|
+
version_requirement:
|
113
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
114
|
+
requirements:
|
115
|
+
-
|
116
|
+
- ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 0.7.1
|
119
|
+
version:
|