glue 0.31.0 → 0.40.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.
Files changed (46) hide show
  1. data/doc/AUTHORS +1 -1
  2. data/doc/LICENSE +2 -3
  3. data/doc/RELEASES +0 -4
  4. data/lib/glue.rb +3 -3
  5. data/lib/glue/attribute.rb +114 -0
  6. data/lib/glue/attributeutils.rb +117 -0
  7. data/lib/glue/autoreload.rb +0 -4
  8. data/lib/glue/builder.rb +0 -2
  9. data/lib/glue/builder/xml.rb +0 -2
  10. data/lib/glue/cache.rb +3 -5
  11. data/lib/glue/cache/drb.rb +0 -2
  12. data/lib/glue/cache/memory.rb +0 -2
  13. data/lib/glue/cache/og.rb +11 -6
  14. data/lib/glue/configuration.rb +60 -15
  15. data/lib/glue/fixture.rb +3 -5
  16. data/lib/glue/localization.rb +0 -2
  17. data/lib/glue/logger.rb +1 -2
  18. data/lib/glue/mail.rb +0 -2
  19. data/lib/glue/mailer.rb +4 -2
  20. data/lib/glue/mailer/incoming.rb +0 -2
  21. data/lib/glue/mailer/outgoing.rb +3 -5
  22. data/lib/glue/settings.rb +0 -2
  23. data/lib/glue/uri.rb +0 -2
  24. data/lib/glue/validation.rb +6 -8
  25. data/test/glue/builder/tc_xml.rb +3 -2
  26. data/test/glue/tc_attribute.rb +112 -0
  27. data/test/glue/{tc_property_mixins.rb → tc_attribute_mixins.rb} +9 -11
  28. data/test/glue/tc_configuration.rb +1 -1
  29. data/test/glue/tc_fixture.rb +4 -3
  30. data/test/glue/tc_logger.rb +2 -2
  31. data/test/glue/tc_mail.rb +22 -21
  32. data/test/glue/tc_stores.rb +0 -2
  33. data/test/glue/tc_uri.rb +12 -12
  34. data/test/glue/tc_validation.rb +13 -13
  35. metadata +52 -64
  36. data/INSTALL +0 -56
  37. data/ProjectInfo +0 -49
  38. data/README +0 -21
  39. data/lib/glue/markup.rb +0 -123
  40. data/lib/glue/property.rb +0 -290
  41. data/lib/glue/sanitize.rb +0 -48
  42. data/lib/glue/template.rb +0 -219
  43. data/setup.rb +0 -1585
  44. data/test/glue/tc_property.rb +0 -112
  45. data/test/glue/tc_property_type_checking.rb +0 -41
  46. data/test/glue/tc_template.rb +0 -35
@@ -14,5 +14,3 @@ class TC_CachingStores < Test::Unit::TestCase # :nodoc: all
14
14
  end
15
15
 
16
16
  end
17
-
18
- # * George Moschovitis <gm@navel.gr>
data/test/glue/tc_uri.rb CHANGED
@@ -53,10 +53,10 @@ class TC_Uri < Test::Unit::TestCase # :nodoc: all
53
53
  uri = "people/gmosx.sx?koko=1;lala=2"
54
54
  assert_equal("koko=1;lala=2", Glue::UriUtils.get_query_string(uri))
55
55
 
56
- uri = "http://www.navel.gr/people/gmosx.sx?koko=1&lala=2"
56
+ uri = "http://www.nitroproject.org/people/gmosx.sx?koko=1&lala=2"
57
57
  assert_equal("koko=1&lala=2", Glue::UriUtils.get_query_string(uri))
58
58
 
59
- uri = "http://www.navel.gr:8080/people/gmosx.sx?koko=1;lala=2"
59
+ uri = "http://www.nitroproject.org:8080/people/gmosx.sx?koko=1;lala=2"
60
60
  assert_equal("koko=1;lala=2", Glue::UriUtils.get_query_string(uri))
61
61
  end
62
62
 
@@ -67,11 +67,11 @@ class TC_Uri < Test::Unit::TestCase # :nodoc: all
67
67
  uri = "people/gmosx.sx?koko=1;lala=2"
68
68
  assert_equal("people/gmosx.sx", Glue::UriUtils.chomp_query_string(uri))
69
69
 
70
- uri = "http://www.navel.gr/people/gmosx.sx?koko=1&lala=2"
71
- assert_equal("http://www.navel.gr/people/gmosx.sx", Glue::UriUtils.chomp_query_string(uri))
70
+ uri = "http://www.nitroproject.org/people/gmosx.sx?koko=1&lala=2"
71
+ assert_equal("http://www.nitroproject.org/people/gmosx.sx", Glue::UriUtils.chomp_query_string(uri))
72
72
 
73
- uri = "http://www.navel.gr:8080/people/gmosx.sx?koko=1;lala=2"
74
- assert_equal("http://www.navel.gr:8080/people/gmosx.sx", Glue::UriUtils.chomp_query_string(uri))
73
+ uri = "http://www.nitroproject.org:8080/people/gmosx.sx?koko=1;lala=2"
74
+ assert_equal("http://www.nitroproject.org:8080/people/gmosx.sx", Glue::UriUtils.chomp_query_string(uri))
75
75
 
76
76
  assert_equal(nil, Glue::UriUtils.chomp_query_string(nil))
77
77
  end
@@ -81,17 +81,17 @@ class TC_Uri < Test::Unit::TestCase # :nodoc: all
81
81
  hash = {"lala" => 2, "kaka" => 3}
82
82
  assert_equal("ko/index.sx?koko=1;lala=2;kaka=3", Glue::UriUtils.update_query_string(uri, hash))
83
83
 
84
- uri = "http://www.navel.gr:8080/ko/index.sx?koko=1"
84
+ uri = "http://www.nitroproject.org:8080/ko/index.sx?koko=1"
85
85
  hash = {"lala" => 2, "kaka" => 3}
86
- assert_equal("http://www.navel.gr:8080/ko/index.sx?koko=1;lala=2;kaka=3", Glue::UriUtils.update_query_string(uri, hash))
86
+ assert_equal("http://www.nitroproject.org:8080/ko/index.sx?koko=1;lala=2;kaka=3", Glue::UriUtils.update_query_string(uri, hash))
87
87
 
88
- uri = "http://www.navel.gr"
88
+ uri = "http://www.nitroproject.org"
89
89
  hash = {"lala" => 2, "kaka" => 3}
90
- assert_equal("http://www.navel.gr?lala=2;kaka=3", Glue::UriUtils.update_query_string(uri, hash))
90
+ assert_equal("http://www.nitroproject.org?lala=2;kaka=3", Glue::UriUtils.update_query_string(uri, hash))
91
91
 
92
92
  # bug: no ? when passed an empty hash
93
- uri = "http://www.navel.gr"
94
- assert_equal("http://www.navel.gr", Glue::UriUtils.update_query_string(uri, {}))
93
+ uri = "http://www.nitroproject.org"
94
+ assert_equal("http://www.nitroproject.org", Glue::UriUtils.update_query_string(uri, {}))
95
95
  end
96
96
 
97
97
  end
@@ -4,7 +4,7 @@ $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'og', 'lib')
4
4
  require 'test/unit'
5
5
 
6
6
  require 'glue'
7
- require 'glue/property'
7
+ require 'glue/attribute'
8
8
  require 'glue/validation'
9
9
 
10
10
  # Glue::Property.type_checking = false
@@ -16,52 +16,52 @@ class TC_Validation < Test::Unit::TestCase # :nodoc: all
16
16
  Validation::Errors.invalid_format = 'INVALID'
17
17
 
18
18
  module Mixin
19
- prop_accessor :value, String
19
+ attr_accessor :value, String
20
20
  validate_format :value, :format => /123/, :msg => 'mixin error'
21
21
  end
22
22
 
23
23
  class User
24
24
  include Mixin
25
25
 
26
- prop_accessor :name, String
26
+ attr_accessor :name, String
27
27
  validate_format :name, :format => /L.o/, :msg => 'per class override'
28
28
  end
29
29
 
30
30
  class Article
31
- prop_accessor :name, String
31
+ attr_accessor :name, String
32
32
  validate_format :name, :format => /news/
33
33
  end
34
34
 
35
35
  class Dummy1
36
- prop_accessor :test, Fixnum
37
- prop_accessor :str, String
36
+ attr_accessor :test, Fixnum
37
+ attr_accessor :str, String
38
38
  validate_value :test, :str
39
39
  end
40
40
 
41
41
  class Dummy2
42
- prop_accessor :password, String
42
+ attr_accessor :password, String
43
43
  validate_confirmation :password
44
44
  end
45
45
 
46
46
  class Dummy3
47
- prop_accessor :vmin, String
47
+ attr_accessor :vmin, String
48
48
  validate_length :vmin, :min => 2
49
49
 
50
- prop_accessor :vmax, String
50
+ attr_accessor :vmax, String
51
51
  validate_length :vmax, :max => 3, :msg => 'LOOONG'
52
52
 
53
- prop_accessor :vran, String
53
+ attr_accessor :vran, String
54
54
  validate_length :vran, :range => 2..4, :msg_long => 'argh'
55
55
 
56
- prop_accessor :vlen, String
56
+ attr_accessor :vlen, String
57
57
  validate_length :vlen, :length => 3, :msg => 'argh'
58
58
  end
59
59
 
60
60
  class Dummy4
61
- prop_accessor :sex, String
61
+ attr_accessor :sex, String
62
62
  validate_inclusion :sex, :in => %w{ Male Female }, :msg => 'huh?'
63
63
 
64
- prop_accessor :age, Fixnum
64
+ attr_accessor :age, Fixnum
65
65
  validate_inclusion :age, :in => 5..99
66
66
  end
67
67
 
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: glue
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.31.0
7
- date: 2006-07-20 00:00:00 -07:00
8
- summary: Utility methods and classes for Nitro.
6
+ version: 0.40.0
7
+ date: 2006-11-13 10:56:17 +02:00
8
+ summary: Utility methods and classes for Nitro + Og
9
9
  require_paths:
10
10
  - lib
11
- email: gm@navel.gr
11
+ email:
12
12
  homepage: http://www.nitroproject.org
13
13
  rubyforge_project:
14
- description:
14
+ description: Utility methods and classes for Nitro + Og
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -27,79 +27,67 @@ signing_key:
27
27
  cert_chain:
28
28
  post_install_message:
29
29
  authors:
30
- - George Moschovitis
30
+ - George K. Moschovitis
31
31
  files:
32
- - doc
33
- - lib
34
- - test
35
- - .
36
32
  - lib/glue
33
+ - lib/glue.rb
37
34
  - lib/html
35
+ - lib/glue/attributeutils.rb
36
+ - lib/glue/attribute.rb
37
+ - lib/glue/autoreload.rb
38
+ - lib/glue/builder
39
+ - lib/glue/builder.rb
38
40
  - lib/glue/cache
41
+ - lib/glue/cache.rb
42
+ - lib/glue/configuration.rb
43
+ - lib/glue/fixture.rb
44
+ - lib/glue/html.rb
45
+ - lib/glue/localization.rb
46
+ - lib/glue/logger.rb
47
+ - lib/glue/mail.rb
39
48
  - lib/glue/mailer
40
- - lib/glue/builder
41
- - test/glue
42
- - test/fixture
43
- - test/public
44
- - test/glue/builder
45
- - test/public/dummy_mailer
46
- - test/fixture/article.csv
47
- - test/glue/tc_builder.rb
48
- - test/glue/tc_validation.rb
49
+ - lib/glue/mailer.rb
50
+ - lib/glue/settings.rb
51
+ - lib/glue/uri.rb
52
+ - lib/glue/validation.rb
49
53
  - lib/glue/builder/xml.rb
50
- - lib/glue/mailer/incoming.rb
51
- - lib/glue/cache/memory.rb
52
54
  - lib/glue/cache/drb.rb
53
- - test/glue/tc_fixture.rb
54
- - lib/html/tokenizer.rb
55
- - lib/glue/mail.rb
56
- - setup.rb
57
- - lib/html/node.rb
58
- - lib/glue/configuration.rb
59
- - lib/glue.rb
60
- - test/public/dummy_mailer/registration.xhtml
61
- - test/glue/tc_property_mixins.rb
62
- - test/glue/tc_stores.rb
63
- - lib/glue/localization.rb
64
- - doc/LICENSE
65
- - README
66
- - test/glue/tc_aspects.rb
67
- - test/glue/tc_property.rb
68
- - test/glue/tc_property_type_checking.rb
69
- - lib/html/version.rb
55
+ - lib/glue/cache/file.rb
70
56
  - lib/glue/cache/memcached.rb
71
- - lib/glue/settings.rb
72
- - doc/CHANGELOG.1
73
- - test/glue/tc_uri.rb
57
+ - lib/glue/cache/memory.rb
58
+ - lib/glue/cache/og.rb
59
+ - lib/glue/mailer/incoming.rb
74
60
  - lib/glue/mailer/outgoing.rb
75
- - lib/glue/cache.rb
76
- - lib/glue/sanitize.rb
77
- - INSTALL
78
- - test/fixture/user.yml
79
- - test/glue/builder/tc_xml.rb
80
- - test/glue/tc_template.rb
81
- - lib/glue/uri.rb
82
- - lib/glue/autoreload.rb
83
- - lib/glue/markup.rb
61
+ - lib/html/document.rb
62
+ - lib/html/node.rb
63
+ - lib/html/tokenizer.rb
64
+ - lib/html/version.rb
65
+ - test/fixture
66
+ - test/glue
67
+ - test/public
68
+ - test/fixture/article.csv
84
69
  - test/fixture/article.yml
70
+ - test/fixture/user.yml
71
+ - test/glue/builder
72
+ - test/glue/tc_aspects.rb
73
+ - test/glue/tc_attribute_mixins.rb
74
+ - test/glue/tc_attribute.rb
75
+ - test/glue/tc_builder.rb
76
+ - test/glue/tc_configuration.rb
77
+ - test/glue/tc_fixture.rb
85
78
  - test/glue/tc_localization.rb
86
- - lib/glue/html.rb
87
- - lib/glue/property.rb
88
- - doc/RELEASES
89
- - ProjectInfo
90
- - lib/glue/builder.rb
91
- - lib/glue/logger.rb
92
79
  - test/glue/tc_logger.rb
93
80
  - test/glue/tc_mail.rb
94
- - test/glue/tc_configuration.rb
95
- - lib/html/document.rb
96
- - lib/glue/cache/file.rb
97
- - lib/glue/cache/og.rb
98
- - lib/glue/template.rb
99
- - lib/glue/fixture.rb
100
- - lib/glue/mailer.rb
101
- - lib/glue/validation.rb
81
+ - test/glue/tc_stores.rb
82
+ - test/glue/tc_uri.rb
83
+ - test/glue/tc_validation.rb
84
+ - test/glue/builder/tc_xml.rb
85
+ - test/public/dummy_mailer
86
+ - test/public/dummy_mailer/registration.xhtml
102
87
  - doc/AUTHORS
88
+ - doc/CHANGELOG.1
89
+ - doc/LICENSE
90
+ - doc/RELEASES
103
91
  test_files: []
104
92
 
105
93
  rdoc_options: []
data/INSTALL DELETED
@@ -1,56 +0,0 @@
1
- = Instalation with RubyGems
2
-
3
- 1. Download and install RubyGems:
4
-
5
- http://rubygems.rubyforge.org
6
-
7
- 2. Install the distribution:
8
-
9
- gem install glue
10
-
11
- When asked about the dependencies to include, only accept
12
- the dependencies for the RDBMS backends you are planning
13
- to use.
14
-
15
- 3. Set environment variable (required to load RubyGems):
16
-
17
- export RUBYOPT=-rubygems
18
-
19
- You can add this in you .bashrc in Unix.
20
-
21
- Alternatively you can run your applications with the -rubygem
22
- option:
23
-
24
- ruby -rubygem xxx.rb
25
-
26
- = Installation without RubyGems using script.
27
-
28
- Installation without RubyGems is *strongly* discouraged.
29
- However, as Glue is all about freedom and possibilities,
30
- a standard installation script is provided.
31
-
32
- 1. Switch to an administrator account
33
-
34
- For example in Unix:
35
-
36
- $ su -
37
-
38
- 2. Run the installation script.
39
-
40
- $ ruby setup.rb
41
-
42
- This installation script also installs some vendor libraries
43
- that you possibly have allready installed. Use with caution.
44
-
45
- = Manual installation.
46
-
47
- Uncompress your distribution (Unix example):
48
-
49
- $ cd my_dir
50
- $ tar xvfz glue-x.x.x.tar.gz
51
-
52
- Put the libray dir in the Ruby path (Unix example):
53
-
54
- $ export RUBYOPT='-I path/to/glue/lib'
55
-
56
-
data/ProjectInfo DELETED
@@ -1,49 +0,0 @@
1
- --- %YAML:1.0
2
-
3
- TITLE : &title Glue
4
- NAME : &pkg glue
5
- VERSION : '0.31.0'
6
- STATUS : beta
7
-
8
- AUTHOR : George Moschovitis
9
- EMAIL : &email gm@navel.gr
10
- HOMEPAGE : "http://www.nitroproject.org"
11
-
12
- SUMMARY: Utility methods and classes for Nitro.
13
-
14
- DESCRIPTION: >
15
- Utility methods and classes for Nitro.
16
-
17
- RUBYFORGE:
18
- PROJECT: 'nitro'
19
- USERNAME: 'gmosx'
20
-
21
- DEPENDENCIES:
22
- - [ facets, '= 1.4.5' ]
23
-
24
- PACKAGE: !!package
25
- distribute: [ gem, tgz, zip ]
26
-
27
- RDOC: !!rdoc
28
- dir: rdoc
29
- options: ['--all', '--inline-source']
30
- include:
31
- - 'lib/glue/**/*'
32
- - '[A-Z]*'
33
-
34
- TEST: !!test
35
-
36
- ANNOUNCE: !!announce
37
- to: george.moschovitis@gmail.com
38
- from: gm@navel.gr
39
- domain: navel.gr
40
- server: mail
41
- port: 25 #587
42
- account: gm@navel.gr
43
- authtype: login #cram_md5 #plain
44
- sectype: tls # ~, tls, ssl (tls is broke)
45
- file: ANN
46
- slogan: Glue
47
- links:
48
- - http://www.nitroproject.org
49
-
data/README DELETED
@@ -1,21 +0,0 @@
1
- = Glue 0.30.0 README
2
-
3
- Useful utilites and methods.
4
-
5
-
6
- == Purpose
7
-
8
- Useful libraries are stored here. An attempt is made to
9
- graduate smaller libraries to the more general Facets
10
- ruby project.
11
-
12
-
13
- == Licence
14
-
15
- Copyright (c) 2004-2006, George 'gmosx' Moschovitis (http://www.gmosx.com)
16
- Copyright (c) 2004-2006, Navel Ltd (http://www.navel.gr)
17
-
18
- Glue (http://www.rubyforge.org/projects/nitro) is copyrighted free
19
- software created and maintained by George Moschovitis (mailto:gm@navel.gr)
20
- and released under the standard BSD Licence. For details consult
21
- the file LICENCE.
data/lib/glue/markup.rb DELETED
@@ -1,123 +0,0 @@
1
- require 'singleton'
2
- require 'redcloth'
3
- require 'cgi'
4
-
5
- require 'facets/core/module/class_extension'
6
-
7
- require 'glue/sanitize'
8
-
9
- module Glue
10
-
11
- # Generalised Markup transformations.
12
- #
13
- # The expand methods evaluate (expand) the markup
14
- # code to produce the final content. The compact
15
- # methods reverse this process to create the original
16
- # markup code. Not all markup transformations are
17
- # reversible.
18
- #
19
- # When this library is included, the default PropertyUtils
20
- # implementation is overriden to add markup support.
21
- #
22
- # === Examples
23
- #
24
- # Define your custom markup methods like this:
25
- #
26
- # module Markup
27
- # def markup_simple
28
- # ...
29
- # end
30
- # def markup_special
31
- # ...
32
- # end
33
- #
34
- # # maps the {{..}} macro
35
- # alias_method :sanitize, :markup_simple
36
- # # maps the {|..|} macro
37
- # alias_method :markup, :markup_special
38
- # end
39
- #
40
- # here comes the #{obj.body} # => prints the expanded version.
41
- #
42
- # obj.body = markup(@params['body'])
43
-
44
- module Markup
45
- # The default markup method. You should override this method
46
- # in your application to call your custom markup
47
- # methods.
48
-
49
- def expand(str)
50
- if str
51
- xstr = str.dup
52
- xstr.gsub!(/</, '&lt;')
53
- xstr.gsub!(/>/, '&gt;')
54
- xstr.gsub!(/\r/, '<br />')
55
- return String.sanitize(xstr)
56
- end
57
- return nil
58
- end
59
- alias_method :sanitize, :expand
60
-
61
- # ...
62
-
63
- def expand_redcloth(str)
64
- if str
65
- return RedCloth.new(expand(str)).to_html
66
- end
67
- return nil
68
- end
69
- alias_method :markup, :expand_redcloth
70
-
71
- # Compact (reverse) the content to the origial markup
72
- # code. Not all markup transformations are reversible.
73
- # You should override this method in your application
74
- # to call your custom markup methods.
75
- #
76
- # NOT IMPLEMENTED.
77
-
78
- def compact(str, meth = nil)
79
- end
80
-
81
- # Remove markup code from the input string.
82
- #
83
- # NOT IMPLEMENTED.
84
-
85
- def clear(str)
86
- end
87
-
88
- def escape(str)
89
- return nil unless str
90
- CGI.escape(str.gsub(/ /, '_'))
91
- end
92
-
93
- def unescape(str)
94
- CGI.unescape(str.gsub(/_/, ' '))
95
- end
96
-
97
- class_extension do
98
- # Helper method for manipulating the sanitize transformation.
99
-
100
- def setup_sanitize_transform(&block)
101
- self.send :define_method, :sanitize, block
102
- end
103
- alias_method :setup_sanitize_transformation, :setup_sanitize_transform
104
-
105
- # Helper method for manipulating the markup transformation.
106
-
107
- def setup_markup_transform(&block)
108
- self.send :define_method, :markup, block
109
- end
110
- alias_method :setup_markup_transformation, :setup_markup_transform
111
- end
112
- end
113
-
114
- # An abstract Markup class.
115
-
116
- class MarkupKit
117
- extend Markup
118
- include Markup
119
- end
120
-
121
- end
122
-
123
- # * George Moschovitis <gm@navel.gr>