htmlgrid 1.1.3 → 1.1.8

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.
@@ -88,6 +88,9 @@ module InteractionTest
88
88
  end
89
89
  def error(key)
90
90
  end
91
+ def user_agent
92
+ 'user_agent'
93
+ end
91
94
  end
92
95
  class StubCompositeForm < HtmlGrid::Form
93
96
  COMPONENTS = {
@@ -247,9 +250,7 @@ module InteractionTest
247
250
  table = StubComposite4.new(
248
251
  StubCompositeModel.new, StubCompositeSession.new)
249
252
  assert_equal(<<-EXP.gsub(/\n|^\s*/, ''), table.to_html(CGI.new))
250
- <TABLE cellspacing="0">
251
- <TR><TD><A class="standard">brafoo</A></TD></TR>
252
- </TABLE>
253
+ <TABLE cellspacing=\"0\"><TR><TD class=\"dradnats\"><A class=\"standard\">brafoo</A></TD></TR></TABLE>
253
254
  EXP
254
255
  end
255
256
 
@@ -272,8 +273,8 @@ module InteractionTest
272
273
  '<TR><TD>interaction for Marcoumar</TD></TR>',
273
274
  '<TR><TD>interaction for Marcoumar</TD></TR></TABLE> <DIV id="drugs"></DIV><TABLE cellspacing="0">',
274
275
  '<TR><TH>&nbsp;</TH></TR>',
275
- '<TR><TD class="css.info"></TD></TR>',
276
- '<TR><TD class="css.info-bg"></TD></TR></TABLE>',
276
+ '<TR><TD class="css.info">&nbsp;</TD></TR>',
277
+ '<TR><TD class="css.info-bg">&nbsp;</TD></TR></TABLE>',
277
278
  ]
278
279
  html = composite.to_html(CGI.new)
279
280
  expected.each_with_index do |line, idx|
@@ -282,3 +283,4 @@ module InteractionTest
282
283
  end
283
284
  end
284
285
  end
286
+
@@ -28,6 +28,7 @@ $LOAD_PATH << File.dirname(__FILE__)
28
28
 
29
29
  require 'minitest'
30
30
  require 'minitest/autorun'
31
+ require 'flexmock/minitest'
31
32
  require 'stub/cgi'
32
33
  require 'sbsm/lookandfeel'
33
34
  require 'htmlgrid/template'
@@ -44,6 +45,9 @@ class StubTemplateSession
44
45
  end
45
46
  def server_name
46
47
  "testserver.com"
48
+ end
49
+ def server_port
50
+ '80'
47
51
  end
48
52
  alias :default_language :language
49
53
  end
@@ -60,6 +64,7 @@ class StubTemplateLookandfeel < SBSM::Lookandfeel
60
64
  self
61
65
  end
62
66
  end
67
+
63
68
  class Template < HtmlGrid::Template
64
69
  META_TAGS = [
65
70
  {
@@ -86,11 +91,29 @@ class TestTemplate < Minitest::Test
86
91
  result << @template.to_html(CGI.new)
87
92
  expected = [
88
93
  '<TITLE>Test</TITLE>',
89
- "<LINK rel=\"stylesheet\" type=\"text/css\" href=\"http://testserver.com/resources/gcc/test.css\">",
94
+ '<LINK rel="stylesheet" type="text/css" async="true" href="http://testserver.com:80/resources/gcc/test.css">',
90
95
  '<META http-equiv="robots" content="follow, index">',
91
96
  ]
92
97
  expected.each_with_index { |line, idx|
93
98
  assert(result.index(line), "#{idx} Missing: #{line} in #{result}")
94
99
  }
95
100
  end
101
+ def test_to_html_with_inline_css
102
+ @lookandfeel = flexmock('lnf', StubTemplateLookandfeel.new(StubTemplateSession.new))
103
+ @lookandfeel.should_receive(:resource).with(:css).and_return('test/inline.css')
104
+ @lookandfeel.should_receive(:lookup).with(:html_title).and_return('html_title').by_default
105
+ @lookandfeel.should_receive(:lookup).with(any).and_return(nil).by_default
106
+ @template = Template.new(nil, @lookandfeel, nil)
107
+ result = ""
108
+ result << @template.to_html(CGI.new)
109
+ expected = [
110
+ '<TITLE>html_title</TITLE>',
111
+ 'this is a dummy CSS file, which should be inlined',
112
+ '<STYLE rel="stylesheet" type="text/css" async="true">',
113
+ '<META http-equiv="robots" content="follow, index">',
114
+ ]
115
+ expected.each_with_index { |line, idx|
116
+ assert(result.index(line), "#{idx} Missing: #{line} in #{result}")
117
+ }
118
+ end
96
119
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sbsm
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.6.4
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.6.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,8 +156,9 @@ executables: []
156
156
  extensions: []
157
157
  extra_rdoc_files: []
158
158
  files:
159
- - History.txt
160
159
  - Manifest.txt
160
+ - TooltipDialog.txt
161
+ - interaction_no_inline.txt
161
162
  - lib/htmlgrid/booleanvalue.rb
162
163
  - lib/htmlgrid/button.rb
163
164
  - lib/htmlgrid/centeredcomposite.rb
@@ -214,6 +215,7 @@ files:
214
215
  - test/test_component.rb
215
216
  - test/test_composite.rb
216
217
  - test/test_datevalue.rb
218
+ - test/test_dojotoolkit.rb
217
219
  - test/test_form.rb
218
220
  - test/test_formlist.rb
219
221
  - test/test_grid.rb
@@ -244,10 +246,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
246
  - !ruby/object:Gem::Version
245
247
  version: '0'
246
248
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.5.1
249
+ rubygems_version: 3.1.2
249
250
  signing_key:
250
251
  specification_version: 4
251
252
  summary: HtmlGrid is a Html-ToolKit for Ruby Webframeworks.
252
253
  test_files: []
253
- has_rdoc:
@@ -1,72 +0,0 @@
1
- === 1.1.3 / 15.08.2016
2
-
3
- * Add session variable fallback assignment
4
-
5
- === 1.1.2 / 10.08.2016
6
-
7
- * Fix warnings by syntax or coding style
8
- * Fix test errors
9
- * Fix asset (doc) files permission
10
- * Fix installation issues on ruby 2.0.0 and 2.1.9
11
- * Add ruby 2.3.1 as ci target
12
-
13
- === 1.1.1 / 07.07.2016
14
-
15
- * Improve dojotoolkit.rb
16
-
17
- === 1.1.0 / 06.07.2016
18
-
19
- * Rename djConfig to dojoConfig
20
- * Rename dojoType to data-dojo-type
21
- * Remove duplicated dojoConfig (use only data-dojo-config)
22
- * Add package support for onload script
23
-
24
- === 1.0.9 / 05.07.2016
25
-
26
- * Made tooltip work with dojo 1.11
27
- * Only tested with dojo 1.11. Works probably with dojo >= 1.8.
28
-
29
- === 1.0.8 / 10.05.2015
30
-
31
- * Removed C-interface
32
- * Removed obsolete tests for RUBY_VERSION < 1.9
33
- * Ported to Ruby 2.3.0. Updated minitest. Use newer version of sbsm.
34
- * Ruby 1.9.3 is no longer supported
35
-
36
- === 1.0.7 / 03.12.2013
37
-
38
- * Remove LEGACY_INTERFACE. No. LEGACY_INTERFACE was readded before release 1.0.7
39
- * Make travis work just fine.
40
-
41
- === 1.0.6 / 06.04.2012
42
-
43
- * Updated onload problem against dojo 1.7
44
- * Removed old version support
45
-
46
- === 1.0.5 / 23.02.2012
47
-
48
- * trying to get rid of htmlgrid.so
49
-
50
- === 1.0.4 / 23.12.2011
51
-
52
- * Added force_encoding('utf-8') to the return value of Grid#to_html method
53
-
54
- === 1.0.3 / 23.12.2011
55
-
56
- * patch grid.c for Ruby 1.9.3
57
-
58
- === 1.0.2 / 23.12.2011
59
-
60
- * Fix FachinfoDocument encoding error
61
-
62
- === 1.0.1 / 09.12.2011
63
-
64
- * Updated component.rb to be compatible for both Ruby 1.8 and 1.9
65
- * Fixed require grid.o for gem install case
66
-
67
- === 1.0.0 / 16.12.2010
68
-
69
- * htmlgrid is now Ruby 1.9 ready.
70
-
71
- * Birthday!
72
-