aurita-gui 0.3.7 → 0.5.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/spec/element.rb CHANGED
@@ -47,8 +47,8 @@ describe Aurita::GUI::Element, "basic rendering" do
47
47
  end
48
48
 
49
49
  it "should be able to render to string" do
50
- @e1.to_s.should == '<tagname />'
51
- @e1.string.should == '<tagname />'
50
+ @e1.to_s.should == '<tagname></tagname>'
51
+ @e1.string.should == '<tagname></tagname>'
52
52
  end
53
53
 
54
54
  it "should have enclosed content that is an array" do
@@ -88,7 +88,7 @@ describe Aurita::GUI::Element, "basic rendering" do
88
88
 
89
89
  it "should render parameters as tag attributes" do
90
90
  e = Element.new(:tag => :foo, :some_param => :the_value)
91
- e.to_s.should == '<foo some_param="the_value" />'
91
+ e.to_s.should == '<foo some_param="the_value"></foo>'
92
92
  end
93
93
 
94
94
  it "should be possible to retreive original parameter values" do
@@ -105,7 +105,7 @@ describe Aurita::GUI::Element, "basic rendering" do
105
105
 
106
106
  it "should accept content as block, maintaining object identity" do
107
107
  test_obj_identity = 'lorem_ipsum'
108
- e = Element.new(:tag => :jada) { test_obj_identity }
108
+ e = Element.new(:tag => :jada) { test_obj_identity }
109
109
  e.get_content.should == [ test_obj_identity ]
110
110
  e.tag.should == :jada
111
111
  end
data/spec/table.rb ADDED
@@ -0,0 +1,53 @@
1
+
2
+ require('rubygems')
3
+ require('aurita-gui/table')
4
+
5
+ include Aurita::GUI
6
+
7
+ describe Aurita::GUI::Table, "basic rendering" do
8
+
9
+ it "should provide headers" do
10
+ table = Table.new(:headers => [ :username, :email, 'last login' ],
11
+ :class => 'spectable')
12
+ table.to_s.should == '<table class="spectable"><tr><th>username</th><th>email</th><th>last login</th></tr></table>'
13
+ end
14
+
15
+ it "should be possible to add rows" do
16
+ table = Table.new(:headers => [ :username, :email, 'last login' ],
17
+ :class => 'spectable')
18
+ table.add_row('a','b','c')
19
+ table.to_s.should == '<table class="spectable"><tr><th>username</th><th>email</th><th>last login</th></tr><tr><td>a</td><td>b</td><td>c</td></tr></table>'
20
+ end
21
+
22
+ it "should be possible to change cell values" do
23
+ table = Table.new(:class => 'spectable')
24
+ table.add_row('a','b','c')
25
+ table[0][1] = 'changed'
26
+ table.to_s.should == '<table class="spectable"><tr><td>a</td><td>changed</td><td>c</td></tr></table>'
27
+ end
28
+
29
+ it "should be possible to modify Table_Cell elements" do
30
+ table = Table.new(:column_css_classes => [ :c1, :c2, :c3 ] )
31
+ table.add_row('a','b','c')
32
+ table.to_s.should == '<table><tr><td class="c1">a</td><td class="c2">b</td><td class="c3">c</td></tr></table>'
33
+ table.add_row('a','b','c')
34
+ table[0].add_css_class(:gnarg)
35
+ table[0][1].add_css_class(:knorg)
36
+ table.to_s.should == '<table><tr class="gnarg"><td class="c1">a</td><td class="c2 knorg">b</td><td class="c3">c</td></tr><tr><td class="c1">a</td><td class="c2">b</td><td class="c3">c</td></tr></table>'
37
+ end
38
+
39
+ it "should be possible to set CSS classes for columns" do
40
+ table = Table.new(:class => 'spectable', :column_css_classes => [ :c1, :c2, :c3 ] )
41
+ table.add_row('a','b','c')
42
+ table.to_s.should == '<table class="spectable"><tr><td class="c1">a</td><td class="c2">b</td><td class="c3">c</td></tr></table>'
43
+ end
44
+
45
+ it "should be possible to set CSS classes for rows" do
46
+ table = Table.new(:class => 'spectable', :row_css_classes => :trow )
47
+ table.add_row('a','b','c')
48
+ table.add_row('a','b','c')
49
+ table.to_s.should == '<table class="spectable"><tr class="trow"><td>a</td><td>b</td><td>c</td></tr><tr class="trow"><td>a</td><td>b</td><td>c</td></tr></table>'
50
+ end
51
+
52
+ end
53
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aurita-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Fuchs
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-03 00:00:00 +01:00
12
+ date: 2009-08-23 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: arrayfields
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -30,60 +31,60 @@ extensions: []
30
31
  extra_rdoc_files: []
31
32
 
32
33
  files:
34
+ - test
35
+ - README.txt
33
36
  - spec
34
- - History.txt
35
- - lib
37
+ - TODO
36
38
  - samples
37
- - README
38
39
  - aurita-gui.gemspec
40
+ - lib
39
41
  - bin
40
- - TODO
41
- - test
42
42
  - LICENSE
43
- - lib/aurita-gui
44
43
  - lib/aurita-gui.rb
45
- - lib/aurita-gui/marshal.rb
46
- - lib/aurita-gui/javascript.rb
47
- - lib/aurita-gui/button.rb
48
- - lib/aurita-gui/form.rb
44
+ - lib/aurita-gui
45
+ - lib/aurita-gui/element_fixed.rb
49
46
  - lib/aurita-gui/html.rb
50
- - lib/aurita-gui/builtest.rb
51
- - lib/aurita-gui/table.rb
52
- - lib/aurita-gui/form
47
+ - lib/aurita-gui/form.rb
48
+ - lib/aurita-gui/widget.rb
49
+ - lib/aurita-gui/button.rb
53
50
  - lib/aurita-gui/element.rb
54
- - lib/aurita-gui/selection_list_test.rb
55
- - lib/aurita-gui/form/password_field.rb
56
- - lib/aurita-gui/form/options_field.rb
57
- - lib/aurita-gui/form/file_field.rb
58
- - lib/aurita-gui/form/form_error.rb
51
+ - lib/aurita-gui/form
52
+ - lib/aurita-gui/javascript.rb
53
+ - lib/aurita-gui/marshal.rb
54
+ - lib/aurita-gui/table.rb
55
+ - lib/aurita-gui/form/datetime_field.rb
56
+ - lib/aurita-gui/form/input_field.rb
57
+ - lib/aurita-gui/form/radio_field.rb
59
58
  - lib/aurita-gui/form/checkbox_field.rb
59
+ - lib/aurita-gui/form/time_field.rb
60
+ - lib/aurita-gui/form/date_field.rb
60
61
  - lib/aurita-gui/form/form_field.rb
62
+ - lib/aurita-gui/form/options_field.rb
63
+ - lib/aurita-gui/form/password_field.rb
64
+ - lib/aurita-gui/form/text_field.rb
61
65
  - lib/aurita-gui/form/textarea_field.rb
62
- - lib/aurita-gui/form/datetime_field.rb
63
- - lib/aurita-gui/form/boolean_field.rb
64
- - lib/aurita-gui/form/time_field.rb
65
- - lib/aurita-gui/form/fieldset.rb
66
- - lib/aurita-gui/form/selection_list.rb
67
66
  - lib/aurita-gui/form/select_field.rb
68
- - lib/aurita-gui/form/radio_field.rb
67
+ - lib/aurita-gui/form/file_field.rb
69
68
  - lib/aurita-gui/form/hidden_field.rb
70
- - lib/aurita-gui/form/text_field.rb
71
69
  - lib/aurita-gui/form/template_helper.rb
72
- - lib/aurita-gui/form/input_field.rb
73
- - lib/aurita-gui/form/date_field.rb
70
+ - lib/aurita-gui/form/boolean_field.rb
71
+ - lib/aurita-gui/form/form_error.rb
72
+ - lib/aurita-gui/form/fieldset.rb
73
+ - lib/aurita-gui/form/selection_list.rb
74
74
  - samples/putstest.rb
75
75
  - samples/recurse.rb
76
76
  - samples/cheatsheet.rb
77
77
  - samples/valuetest.rb
78
78
  - samples/pushtest.rb
79
- - spec/marshal.rb
80
- - spec/javascript.rb
81
- - spec/form.rb
82
- - spec/init_code.rb
83
79
  - spec/html.rb
80
+ - spec/form.rb
81
+ - spec/element.rb
84
82
  - spec/options.rb
83
+ - spec/javascript.rb
84
+ - spec/marshal.rb
85
85
  - spec/selection_list.rb
86
- - spec/element.rb
86
+ - spec/init_code.rb
87
+ - spec/table.rb
87
88
  has_rdoc: true
88
89
  homepage: http://aurita.wortundform.de/
89
90
  post_install_message:
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  requirements: []
111
112
 
112
113
  rubyforge_project: aurita
113
- rubygems_version: 1.1.1
114
+ rubygems_version: 1.3.1
114
115
  signing_key:
115
116
  specification_version: 2
116
117
  summary: Dead-simple object-oriented creation of HTML elements, including forms, tables and many more.
data/History.txt DELETED
@@ -1,85 +0,0 @@
1
-
2
- == 0.3.6 / 2009-01-31
3
-
4
- * Added Selection_List_Field.
5
- * Several minor fixes in Options_Field, and Form
6
- * Added more specs.
7
-
8
- == 0.3.5 / 2009-01-27
9
-
10
- * Element instances now behave like arrays (nested content is delegated).
11
- * Object trees now can be iterated recursively via Element#recurse { |element| ... }
12
- * Added more specs.
13
-
14
- === 0.3.4 / 2009-01-26
15
-
16
- * Added retreiving elements from object tree
17
- via DOM id:
18
-
19
- x = HTML.build {
20
- div {
21
- p {
22
- span(:id => :nested) { 'content before' }
23
- }
24
- }
25
- }
26
-
27
- x[:nested].content = 'content after'
28
-
29
- Also added replacing elements in tree:
30
-
31
- x[:nested] = HTML.div { 'other element' }
32
-
33
- * Added marshalling of element hierarchies:
34
-
35
- e = HTML.build { div.outer(:onclick => js.alert('message')) { p.inner 'nested content' } }
36
- e.to_s == Element.marshal_load(e.marshal_dump)
37
-
38
- and thus
39
-
40
- Element.marshal_load(e.marshal_dump)[0].onclick
41
- --> "alert('message');"
42
- Element.marshal_load(e.marshal_dump)[0][0].class
43
- --> 'inner'
44
-
45
- This is useful for caching object hierarchies.
46
-
47
-
48
- * Extended API by convenience shortcuts:
49
- Content for elements can be set markaby-like now:
50
-
51
- HTML.div 'content here' :class => :highlighted
52
-
53
- === 0.3.3 / 2009-01-25
54
-
55
- * Added form helpers for template rendering.
56
- * Extended API by convenience shortcuts:
57
- Content for elements can be set markaby-like now:
58
-
59
- HTML.div 'content here' :class => :highlighted
60
-
61
- * Minor bug fixes.
62
-
63
- === 0.3.1 / 2009-01-15
64
-
65
- * Added specs for Element and HTML.
66
- * Polished rendering.
67
-
68
- === 0.2.0 / 2009-01-12
69
-
70
- * Added magic:
71
-
72
- HTML.div {
73
- ul(:class => :list) {
74
- li { 'first' }
75
- li { 'second' }
76
- }
77
- }
78
-
79
- === 0.1.0 / 2009-01-07
80
-
81
- * First commit.
82
- * Added base classes Element and HTML.
83
- * Added API for forms.
84
- * Added API for tables.
85
-
data/README DELETED
@@ -1,10 +0,0 @@
1
-
2
- Current documentation is online at
3
-
4
- http://intra.wortundform.de/aurita-gui
5
-
6
- Mail your requests to fuchs@wortundform.de,
7
- i'll respond within 24 hours.
8
-
9
- have fun!
10
- Tobi
@@ -1,15 +0,0 @@
1
-
2
- require 'rubygems'
3
- require 'aurita-gui'
4
-
5
- include Aurita::GUI
6
-
7
- puts Builder.new {
8
- div.outer {
9
- div.header {
10
- h2 { 'header here' }
11
- div.content { 'content here' }
12
- }
13
- }
14
- }.to_s
15
-
@@ -1,12 +0,0 @@
1
-
2
- require('aurita')
3
- Aurita.load_project :default
4
- Aurita.import_module :gui, :custom_form_elements
5
-
6
- include Aurita::GUI
7
-
8
- sl = Selection_List_Field.new(:name => :the_list,
9
- :value => ['10','30' ]
10
- :options => { '10' => :blue, '20' => :red, '30' => :green }
11
-
12
- puts sl.to_s.gsub('><',">\n<")