nitro 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/ChangeLog +284 -0
  2. data/{LICENCE → LICENSE} +1 -1
  3. data/README +13 -17
  4. data/RELEASES +13 -1
  5. data/Rakefile +1 -9
  6. data/bin/cluster.rb +5 -5
  7. data/examples/blog/README +45 -0
  8. data/examples/blog/apache.conf +0 -0
  9. data/examples/blog/app.rb +21 -0
  10. data/examples/blog/config.rb +88 -0
  11. data/examples/blog/lib/blog.rb +104 -0
  12. data/examples/blog/log/app.log +117 -0
  13. data/examples/blog/root/comments.xhtml +38 -0
  14. data/examples/blog/root/entry_form.xhtml +18 -0
  15. data/examples/blog/root/index.xhtml +43 -0
  16. data/examples/blog/root/login.xhtml +24 -0
  17. data/examples/blog/root/m/bubbles.gif +0 -0
  18. data/examples/blog/root/m/comments_curve.gif +0 -0
  19. data/examples/blog/root/m/down.gif +0 -0
  20. data/examples/blog/root/m/footer_bg.gif +0 -0
  21. data/examples/blog/root/m/garrow.gif +0 -0
  22. data/examples/blog/root/m/gbull.gif +0 -0
  23. data/examples/blog/root/m/grbull.gif +0 -0
  24. data/examples/blog/root/m/h1_bg.gif +0 -0
  25. data/examples/blog/root/m/header_bg.gif +0 -0
  26. data/examples/blog/root/m/obull.gif +0 -0
  27. data/examples/blog/root/m/page_bg.gif +0 -0
  28. data/examples/blog/root/m/side_title_bg.gif +0 -0
  29. data/examples/blog/root/m/sidebar_bg.gif +0 -0
  30. data/examples/blog/root/recent_posts.xhtml +14 -0
  31. data/examples/blog/root/style.css +201 -0
  32. data/examples/blog/root/style.xsl +118 -0
  33. data/examples/blog/root/view_entry.xhtml +29 -0
  34. data/examples/og/run.rb +27 -29
  35. data/examples/tiny/README +3 -4
  36. data/examples/tiny/app.rb +6 -16
  37. data/examples/tiny/config.rb +30 -0
  38. data/examples/tiny/log/app.log +23 -0
  39. data/examples/tiny/root/{index.sx → index.xhtml} +3 -6
  40. data/lib/{n/std.rb → nitro.rb} +9 -4
  41. data/lib/{n → nitro}/application.rb +13 -7
  42. data/lib/{n → nitro}/config.rb +38 -8
  43. data/lib/{n → nitro}/events.rb +1 -1
  44. data/lib/{n → nitro}/l10n.rb +1 -1
  45. data/lib/{n → nitro}/logger.rb +8 -8
  46. data/lib/{n → nitro}/macros.rb +3 -3
  47. data/lib/{n → nitro}/mixins.rb +1 -1
  48. data/lib/nitro/properties.rb +301 -0
  49. data/lib/{n → nitro}/server.rb +2 -2
  50. data/lib/{n → nitro}/server/appserver.rb +14 -5
  51. data/lib/{n → nitro}/server/cluster.rb +5 -5
  52. data/lib/{n → nitro}/server/cookie.rb +1 -1
  53. data/lib/nitro/server/dispatcher.rb +66 -0
  54. data/lib/{n → nitro}/server/filters.rb +7 -7
  55. data/lib/{n → nitro}/server/filters/autologin.rb +3 -3
  56. data/lib/{n → nitro}/server/fragment.rb +3 -3
  57. data/lib/{n → nitro}/server/handlers.rb +3 -3
  58. data/lib/nitro/server/render.rb +200 -0
  59. data/lib/{n → nitro}/server/request.rb +6 -6
  60. data/lib/{n → nitro}/server/requestpart.rb +5 -5
  61. data/lib/{n → nitro}/server/script.rb +3 -3
  62. data/lib/{n → nitro}/server/server.rb +4 -4
  63. data/lib/{n → nitro}/server/session.rb +3 -3
  64. data/lib/nitro/server/shaders.rb +165 -0
  65. data/lib/{n → nitro}/server/user.rb +1 -1
  66. data/lib/nitro/server/webrick.rb +175 -0
  67. data/lib/nitro/service.rb +25 -0
  68. data/lib/{n → nitro}/sitemap.rb +2 -2
  69. data/lib/{n → nitro}/ui/date-select.rb +0 -0
  70. data/lib/{n → nitro}/ui/pager.rb +1 -1
  71. data/lib/{n → nitro}/ui/popup.rb +1 -1
  72. data/lib/{n → nitro}/ui/select.rb +1 -1
  73. data/lib/{n → nitro}/ui/tabs.rb +1 -1
  74. data/lib/{n → nitro}/utils/array.rb +1 -1
  75. data/lib/{n → nitro}/utils/cache.rb +1 -1
  76. data/lib/{n → nitro}/utils/gfx.rb +1 -1
  77. data/lib/{n → nitro}/utils/hash.rb +1 -1
  78. data/lib/{n → nitro}/utils/html.rb +1 -1
  79. data/lib/{n → nitro}/utils/http.rb +1 -1
  80. data/lib/{n → nitro}/utils/mail.rb +1 -1
  81. data/lib/{n → nitro}/utils/number.rb +1 -1
  82. data/lib/{n → nitro}/utils/pool.rb +1 -1
  83. data/lib/{n → nitro}/utils/string.rb +19 -95
  84. data/lib/{n → nitro}/utils/template.rb +0 -0
  85. data/lib/{n → nitro}/utils/time.rb +1 -1
  86. data/lib/{n → nitro}/utils/uri.rb +3 -3
  87. data/lib/nitro/version.rb +11 -0
  88. data/lib/{n/og.rb → og.rb} +61 -31
  89. data/lib/{n/og → og}/backend.rb +13 -7
  90. data/lib/{n/og → og}/backends/mysql.rb +43 -39
  91. data/lib/{n/og → og}/backends/psql.rb +42 -38
  92. data/lib/{n/og → og}/connection.rb +21 -9
  93. data/lib/{n/og → og}/meta.rb +18 -12
  94. data/lib/xsl/base.xsl +11 -88
  95. data/test/n/server/tc_cookie.rb +1 -1
  96. data/test/n/server/tc_filters.rb +1 -1
  97. data/test/n/server/tc_request.rb +3 -3
  98. data/test/n/server/tc_requestpart.rb +2 -2
  99. data/test/n/server/tc_session.rb +1 -1
  100. data/test/n/tc_events.rb +1 -1
  101. data/test/n/tc_og.rb +16 -18
  102. data/test/n/tc_properties.rb +22 -18
  103. data/test/n/tc_sitemap.rb +2 -2
  104. data/test/n/ui/tc_pager.rb +4 -4
  105. data/test/n/utils/tc_cache.rb +1 -1
  106. data/test/n/utils/tc_hash.rb +1 -1
  107. data/test/n/utils/tc_html.rb +1 -1
  108. data/test/n/utils/tc_http.rb +1 -1
  109. data/test/n/utils/tc_number.rb +1 -1
  110. data/test/n/utils/tc_strings.rb +1 -46
  111. data/test/n/utils/tc_uri.rb +1 -1
  112. metadata +101 -108
  113. data/examples/simple/README +0 -42
  114. data/examples/simple/app.rb +0 -31
  115. data/examples/simple/conf/apache.conf +0 -100
  116. data/examples/simple/conf/config.rb +0 -72
  117. data/examples/simple/conf/debug-config.rb +0 -26
  118. data/examples/simple/conf/live-config.rb +0 -26
  119. data/examples/simple/conf/requires.rb +0 -43
  120. data/examples/simple/ctl +0 -32
  121. data/examples/simple/env.rb +0 -32
  122. data/examples/simple/install.rb +0 -12
  123. data/examples/simple/lib/articles/entities.rb +0 -37
  124. data/examples/simple/lib/articles/lc-en.rb +0 -36
  125. data/examples/simple/lib/articles/methods.rb +0 -55
  126. data/examples/simple/lib/articles/part.rb +0 -57
  127. data/examples/simple/root/add-article.sx +0 -15
  128. data/examples/simple/root/article-form.ss +0 -20
  129. data/examples/simple/root/comments-form.ss +0 -16
  130. data/examples/simple/root/comments.si +0 -30
  131. data/examples/simple/root/index.sx +0 -44
  132. data/examples/simple/root/shader/shader.xsl +0 -100
  133. data/examples/simple/root/shader/style.css +0 -9
  134. data/examples/simple/root/view-article.sx +0 -29
  135. data/examples/tiny/conf/config.rb +0 -62
  136. data/examples/tiny/conf/requires.rb +0 -33
  137. data/examples/tiny/ctl +0 -16
  138. data/lib/n/parts.rb +0 -157
  139. data/lib/n/properties.rb +0 -199
  140. data/lib/n/server/dispatcher.rb +0 -55
  141. data/lib/n/server/handlers/code-handler.rb +0 -182
  142. data/lib/n/server/handlers/page-handler.rb +0 -612
  143. data/lib/n/server/webrick.rb +0 -283
  144. data/lib/n/shaders.rb +0 -166
  145. data/lib/n/sync/clc.rb +0 -110
  146. data/lib/n/sync/handler.rb +0 -229
  147. data/lib/n/sync/server.rb +0 -176
  148. data/lib/p/README +0 -1
@@ -54,20 +54,20 @@ author: gmosx
54
54
  <xsl:apply-templates/>
55
55
  </xsl:template>
56
56
 
57
- <!-- create a new, nested output buffer -->
57
+ <!-- create a new, nested output buffer NOT WORKING -->
58
58
  <xsl:template name="x:ob-start" match="x:ob-start">
59
- <xsl:processing-instruction name='ruby'>
59
+ <ruby>
60
60
  <![CDATA[__out_buffers = [] unless __out_buffers
61
61
  __out_buffers.push(__out)
62
62
  __out = ""]]>
63
- </xsl:processing-instruction>
63
+ </ruby>
64
64
  </xsl:template>
65
65
 
66
- <!-- close a nested output buffer -->
66
+ <!-- close a nested output buffer NOT WORKING -->
67
67
  <xsl:template name="x:ob-end" match="x:ob-end">
68
- <xsl:processing-instruction name='ruby'>
68
+ <ruby>
69
69
  <![CDATA[__out == __out_buffers.pop()]]>
70
- </xsl:processing-instruction>
70
+ </ruby>
71
71
  </xsl:template>
72
72
 
73
73
  <!-- NOT WORKING YET -->
@@ -79,103 +79,26 @@ author: gmosx
79
79
 
80
80
  <!-- form errors temlate -->
81
81
  <xsl:template name='x:form-errors' match='x:form-errors'>
82
- <xsl:processing-instruction name='ruby'>
83
- <![CDATA[if errors = request.errors_to_a()
84
- __out << %{ <div class="errors"><b>ERRORS:</b><br />#{errors.join("<br />")}</div>}
85
- end]]>
86
- </xsl:processing-instruction>
82
+ <ruby>if errors = request.errors_to_a()</ruby>
83
+ <div class="errors"><b>ERRORS:</b><br />#{errors.join("<br />")}</div>
84
+ <ruby>end</ruby>
87
85
  </xsl:template>
88
86
 
89
87
  <xsl:template match='x:cell'>
90
88
  <xsl:apply-templates/>
91
89
  </xsl:template>
92
90
 
93
- <!-- better use css :) -->
94
- <xsl:template name="x:vblank" match="x:vblank">
95
- <xsl:param name="height"><xsl:value-of select="@height"/></xsl:param>
96
- <img src="d.gif" width="0" height="{$height}"/>
97
- </xsl:template>
98
-
99
- <xsl:template name="x:hblank" match="x:hblank">
100
- <xsl:param name="width"><xsl:value-of select="@width"/></xsl:param>
101
- <img src="d.gif" height="0" width="{$width}"/>
102
- </xsl:template>
103
-
104
- <!-- button links -->
105
-
106
- <!--
107
- ex:
108
- <x:link class="m/delete.gif" title="Delete" href="r/glue/c/cmd.rb?oid=2" />
109
- TODO: handle onclick too!
110
- -->
111
- <xsl:template match="x:link">
112
- <xsl:param name="class"><xsl:value-of select="@class" /></xsl:param>
113
- <xsl:param name="href"><xsl:value-of select="@href" /></xsl:param>
114
- <xsl:param name="onclick"><xsl:value-of select="@onclick" /></xsl:param>
115
- <a href="{$href}" class="{$class}">
116
- <span><xsl:value-of select="@title" /></span>
117
- <xsl:apply-templates />
118
- </a>
119
- </xsl:template>
120
-
121
- <!--
122
- ex:
123
- <x:link class="m/delete.gif" title="Delete" onclick="javascript: alert('3')" />
124
- -->
125
- <xsl:template match="x:jslink">
126
- <xsl:param name="class"><xsl:value-of select="@class"/></xsl:param>
127
- <xsl:param name="onclick"><xsl:value-of select="@onclick"/></xsl:param>
128
- <a href="#" onclick="{$onclick}" class="{$class}">
129
- <span><xsl:value-of select="@title" /></span>
130
- <xsl:apply-templates />
131
- </a>
132
- </xsl:template>
133
-
134
- <!--
135
- emit some extra divs to allow greater flexibility in css styling.
136
- use those divs to add extra pictures and fancy stuff!
137
-
138
- TODO:
139
- find a better name.
140
- -->
141
- <xsl:template name="x:extra-divs" match="x:extra-divs">
142
- <div id="extra0"><span></span></div>
143
- <div id="extra1"><span></span></div>
144
- <div id="extra2"><span></span></div>
145
- <div id="extra3"><span></span></div>
146
- <div id="extra4"><span></span></div>
147
- <div id="extra5"><span></span></div>
148
- <div id="extra6"><span></span></div>
149
- <div id="extra7"><span></span></div>
150
- </xsl:template>
151
-
152
91
  <xsl:template match="x:clear" name="x:clear">
153
92
  <div class="clear">.</div>
154
93
  </xsl:template>
155
94
 
156
- <!-- check for admin rights, gmosx: not really usefull I think -->
157
- <xsl:template name='x:if-admin' match='x:if-admin'>
158
- <xsl:processing-instruction name='ruby'>
159
- <![CDATA[if admin]]>
160
- </xsl:processing-instruction>
161
- <xsl:apply-templates />
162
- <xsl:processing-instruction name='ruby'>
163
- <![CDATA[end]]>
164
- </xsl:processing-instruction>
165
- </xsl:template>
166
-
167
-
168
95
  <!-- admin ui -->
169
96
  <xsl:template name='x:admin-ui' match='x:admin-ui'>
170
- <xsl:processing-instruction name='ruby'>
171
- <![CDATA[if admin]]>
172
- </xsl:processing-instruction>
97
+ <ruby>if admin</ruby>
173
98
  <span class="admin">
174
99
  <xsl:apply-templates />
175
100
  </span>
176
- <xsl:processing-instruction name='ruby'>
177
- <![CDATA[end]]>
178
- </xsl:processing-instruction>
101
+ <ruby>end</ruby>
179
102
  </xsl:template>
180
103
 
181
104
  <!-- transaction form -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/server/cookie"
5
+ require "nitro/server/cookie"
6
6
 
7
7
  include N
8
8
 
@@ -1,6 +1,6 @@
1
1
  require "test/unit"
2
2
 
3
- require "n/server/filters"
3
+ require "nitro/server/filters"
4
4
 
5
5
  class Filter1 < N::ServerFilter
6
6
  # :nodoc: all
@@ -2,10 +2,10 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/logger"; $log = Logger.new(STDERR) unless $log
5
+ require "nitro/logger"; $log = Logger.new(STDERR) unless $log
6
6
 
7
- require "n/server/cookie"
8
- require "n/server/request"
7
+ require "nitro/server/cookie"
8
+ require "nitro/server/request"
9
9
 
10
10
  include N
11
11
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/server/cookie"
6
- require "n/server/request"
5
+ require "nitro/server/cookie"
6
+ require "nitro/server/request"
7
7
 
8
8
  include N
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/server/session"
5
+ require "nitro/server/session"
6
6
 
7
7
  include N
8
8
 
@@ -1,7 +1,7 @@
1
1
  # :nodoc: all
2
2
 
3
3
  require "test/unit"
4
- require "n/events"
4
+ require "nitro/events"
5
5
 
6
6
  class TC_Events < Test::Unit::TestCase
7
7
  # :nodoc: all
@@ -1,14 +1,14 @@
1
1
  require "test/unit"
2
2
 
3
- require "n/logger"; $log = Logger.new(STDERR) unless $log
4
- require "n/og"
3
+ require "nitro/logger"; $log = Logger.new(STDERR) unless $log
4
+ require "og"
5
5
 
6
6
  module Test # :nodoc: all
7
7
 
8
8
  # bug: creates a table that fucksup postgres if not
9
9
  # correctly escaped.
10
10
  class User
11
- prop_accessor String, :name
11
+ prop_accessor :name, String
12
12
 
13
13
  def initialize(name = nil)
14
14
  @name = name
@@ -18,10 +18,10 @@ end
18
18
  class Comment; end
19
19
 
20
20
  class Article
21
- has_many Test::Comment, :comments
22
- prop_accessor String, :title
23
- prop_accessor String, :body
24
- prop_accessor Hash, :options
21
+ prop_accessor :title, String
22
+ prop_accessor :body, String
23
+ prop_accessor :options, Hash
24
+ has_many :comments, Test::Comment
25
25
 
26
26
  def initialize(title = nil, body = nil)
27
27
  @title = title
@@ -43,10 +43,10 @@ class Article
43
43
  end
44
44
 
45
45
  class Comment
46
- belongs_to Test::Article, :article
47
- belongs_to Test::User, :author
48
- prop_accessor String, :body
49
- prop_accessor Time, :create_time
46
+ belongs_to :article, Test::Article
47
+ belongs_to :author, Test::User
48
+ prop_accessor :body, String
49
+ prop_accessor :create_time, Time
50
50
 
51
51
  def initialize(body = nil)
52
52
  @create_time = Time.now
@@ -87,8 +87,8 @@ class TC_N_OG < Test::Unit::TestCase
87
87
  }
88
88
  end
89
89
 
90
- N::Og.drop_db!(config)
91
- $og = N::Og.new(config)
90
+ Og::Database.drop_db!(config)
91
+ $og = Og::Database.new(config)
92
92
  end
93
93
 
94
94
  def teardown
@@ -102,8 +102,6 @@ class TC_N_OG < Test::Unit::TestCase
102
102
 
103
103
  $og.get_connection()
104
104
 
105
- $og.manage_classes(Article, Comment, User)
106
-
107
105
  article = Article.new("Title", "Here comes the body")
108
106
  $og << article
109
107
 
@@ -112,7 +110,7 @@ class TC_N_OG < Test::Unit::TestCase
112
110
 
113
111
  $og.pupdate("body='Hello'", article)
114
112
 
115
- article.pupdate! "body='Hello'"
113
+ article.update_properties "body='Hello'"
116
114
 
117
115
  another = Article[1]
118
116
  assert_equal(1, another.oid)
@@ -133,9 +131,9 @@ class TC_N_OG < Test::Unit::TestCase
133
131
  user = User.new("gmosx")
134
132
  user.save!
135
133
 
136
- another = User["gmosx"]
134
+ user = User["gmosx"]
137
135
 
138
- assert_equal("gmosx", another.name)
136
+ assert_equal("gmosx", user.name)
139
137
 
140
138
  users1 = $og.select("name='gmosx' ORDER BY oid", User)
141
139
 
@@ -1,18 +1,20 @@
1
1
  require "test/unit"
2
2
 
3
- require "n/logger"; $log = Logger.new(STDERR) unless $log
3
+ require "nitro/logger"; $log = Logger.new(STDERR) unless $log
4
4
 
5
- require "n/properties"
5
+ require "nitro/properties"
6
6
 
7
7
  module Test # :nodoc: all
8
8
 
9
- class Message
10
- prop_accessor Fixnum, :owner_oid
11
- prop_accessor Fixnum, "smallint", :val1, :val2, :val3
12
- prop_accessor String, :title, :body
13
- prop_accessor String, "char(10) NOT NULL", :test
14
- prop_accessor Fixnum, :count
15
- prop_accessor Time, :create_time
9
+ class Msg
10
+ include Og::Unmanageable
11
+
12
+ prop Fixnum, :owner_oid
13
+ prop_accessor :val1, :val2, :val3, Fixnum, :sql => "smallint"
14
+ prop_accessor :title, :body, String
15
+ prop_accessor :test, String, :sql => "char(10) NOT NULL"
16
+ prop_accessor :count, Fixnum
17
+ prop_accessor :create_time, Time
16
18
 
17
19
  # a marshaled property
18
20
  prop_accessor Array, :options
@@ -24,16 +26,19 @@ class Message
24
26
 
25
27
  end
26
28
 
27
- class SubMessage < Message
29
+ class SubMsg < Msg
30
+ # to avoid conflicts with tc_og.rb
31
+ include Og::Unmanageable
32
+
28
33
  inherit_meta(superclass)
29
- # duplicate definition
30
- prop_accessor Float, :count
34
+ # duplicate definition with different type!
35
+ prop_accessor :count, Float
31
36
  end
32
37
 
33
38
  class TC_N_Properties < Test::Unit::TestCase
34
39
 
35
40
  def setup
36
- @msg1 = Message.new
41
+ @msg1 = Msg.new
37
42
  end
38
43
 
39
44
  def teardown
@@ -42,15 +47,14 @@ class TC_N_Properties < Test::Unit::TestCase
42
47
 
43
48
  def test_props
44
49
 
45
-
46
50
  # bug: props for subclasses.
47
51
 
48
- assert(SubMessage.__props)
49
- assert_equal(Message.__props.size(), SubMessage.__props.size())
52
+ assert(SubMsg.__props)
53
+ assert_equal(Msg.__props.size(), SubMsg.__props.size())
50
54
 
51
55
  # bug: duplicate definition
52
-
53
- assert_equal(Float, SubMessage.__props.find { |p| :count == p.symbol }.klass)
56
+
57
+ assert_equal(Float, SubMsg.__props.find { |p| :count == p.symbol }.klass)
54
58
 
55
59
  # dont force conversion
56
60
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/logger"; $log = Logger.new(STDERR) unless $log
5
+ require "nitro/logger"; $log = Logger.new(STDERR) unless $log
6
6
 
7
- require "n/sitemap"
7
+ require "nitro/sitemap"
8
8
 
9
9
  class TC_N_SiteMap < Test::Unit::TestCase
10
10
  include N
@@ -2,10 +2,10 @@
2
2
 
3
3
  require "test/unit"
4
4
 
5
- require "n/logger"; $log = Logger.new(STDERR) unless $log
5
+ require "nitro/logger"; $log = Logger.new(STDERR) unless $log
6
6
 
7
- require "n/og"
8
- require "n/ui/pager"
7
+ require "og"
8
+ require "nitro/ui/pager"
9
9
 
10
10
  class RequestMock < Hash
11
11
  def get(k, default)
@@ -17,7 +17,7 @@ class TC_N_UI_Pager < Test::Unit::TestCase
17
17
 
18
18
  def setup
19
19
  =begin
20
- $og = N::Og.new(
20
+ $og = Og::Database.new(
21
21
  :addres => "localhost",
22
22
  :database => "testdb",
23
23
  :user => "root",
@@ -1,7 +1,7 @@
1
1
  # :nodoc: all
2
2
 
3
3
  require "test/unit"
4
- require "n/utils/cache"
4
+ require "nitro/utils/cache"
5
5
 
6
6
  class TC_N_Utils_Cache < Test::Unit::TestCase
7
7
  # :nodoc: all
@@ -1,7 +1,7 @@
1
1
  # :nodoc: all
2
2
 
3
3
  require "test/unit"
4
- require "n/utils/cache"
4
+ require "nitro/utils/cache"
5
5
 
6
6
  class TC_N2_Utils_Cache < Test::Unit::TestCase
7
7
  # :nodoc: all
@@ -1,6 +1,6 @@
1
1
 
2
2
  require "test/unit"
3
- require "n/utils/html"
3
+ require "nitro/utils/html"
4
4
 
5
5
  include N
6
6
 
@@ -1,5 +1,5 @@
1
1
  require "test/unit"
2
- require "n/utils/http"
2
+ require "nitro/utils/http"
3
3
 
4
4
  class TC_HttpUtils < Test::Unit::TestCase
5
5
  # :nodoc: all
@@ -1,7 +1,7 @@
1
1
  # :nodoc: all
2
2
 
3
3
  require "test/unit"
4
- require "n/utils/number"
4
+ require "nitro/utils/number"
5
5
 
6
6
  class TC_N_NumberUtils < Test::Unit::TestCase
7
7
  # :nodoc: all
@@ -1,7 +1,7 @@
1
1
  # :nodoc: all
2
2
 
3
3
  require "test/unit"
4
- require "n/utils/string"
4
+ require "nitro/utils/string"
5
5
 
6
6
  class TC_StringUtilsUtils < Test::Unit::TestCase
7
7
  # :nodoc: all
@@ -77,45 +77,6 @@ class TC_StringUtilsUtils < Test::Unit::TestCase
77
77
  assert_equal("", StringUtils::wrap("", 4, " "))
78
78
  assert_equal(nil, StringUtils::wrap(nil, 4, " "))
79
79
  end
80
-
81
- def test_extension_from_path
82
- assert_equal(nil, StringUtils.extension_from_path(nil))
83
- assert_equal(nil, StringUtils.extension_from_path("this is a dymy text!"))
84
- assert_equal("gif", StringUtils.extension_from_path("gmosx.gif"))
85
- assert_equal("gif", StringUtils.extension_from_path("/n/images/gmosx.gif"))
86
- assert_equal(nil, StringUtils.extension_from_path("/n/images/gmosx."))
87
- assert_equal("rx", StringUtils.extension_from_path("/n/images/gmosx.gif.rx"))
88
- assert_equal("rx", StringUtils.extension_from_path("*parts/polls/poll-box.rx"))
89
- assert_equal("rx", StringUtils.extension_from_path("../n1/web/parts/polls/poll-box.rx"))
90
- end
91
-
92
- def test_filename_from_path
93
- assert_equal("gmosx", StringUtils.filename_from_path("gmosx.gif"))
94
- filename = StringUtils.filename_from_path("/n/images/gmosx.gif")
95
- assert_equal("/n/images/gmosx", filename)
96
- filename = StringUtils.filename_from_path(nil)
97
- assert_equal("", filename)
98
- filename = StringUtils.filename_from_path("/n/images/gmosx")
99
- assert_equal("/n/images/gmosx", filename)
100
- end
101
-
102
- def test_file_from_path
103
- file = StringUtils.file_from_path("/n/images/gmosx.gif")
104
- assert_equal("gmosx.gif", file)
105
- file = StringUtils.file_from_path(nil)
106
- assert_equal("", file)
107
- file = StringUtils.file_from_path("/n/images/gmosx")
108
- assert_equal("gmosx", file)
109
- end
110
-
111
- def test_directory_from_path
112
- directory = StringUtils.directory_from_path("/n/images/gmosx.gif")
113
- assert_equal("/n/images", directory)
114
- directory = StringUtils.directory_from_path(nil)
115
- assert_equal("", directory)
116
- directory = StringUtils.directory_from_path("/n/images/gmosx")
117
- assert_equal("/n/images", directory)
118
- end
119
80
 
120
81
  def test_rationalize_filename
121
82
  filename = StringUtils.rationalize_filename("hello my friend!.gif")
@@ -137,12 +98,6 @@ class TC_StringUtilsUtils < Test::Unit::TestCase
137
98
  assert(s1.size == s2.size)
138
99
  end
139
100
 
140
- def test_unicode_to_iso88597
141
- # check that dup works.
142
- s = "Original"
143
- assert_equal("Original", StringUtils.unicode_to_iso88597(s))
144
- end
145
-
146
101
  def teardown
147
102
  @s = nil
148
103
  end