html_format 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/html_format/control.sass +5 -2
  3. data/lib/html_format/version.rb +1 -1
  4. data/test/dummy/app/controllers/welcome_controller.rb +14 -54
  5. data/test/dummy/db/test.sqlite3 +0 -0
  6. data/test/dummy/log/development.log +145 -5501
  7. data/test/dummy/log/test.log +33 -359
  8. data/test/dummy/tmp/cache/assets/sprockets/v3.0/28/28WBJbJKd-H8Wqcd4A6tTiOD78obAue5GYTSndiXexk.cache +0 -0
  9. data/test/dummy/tmp/cache/assets/sprockets/v3.0/57/57jcDOH2p73LzW9ZlwFocje_zdn7iYMbRCJfVuRH-lk.cache +1 -0
  10. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8H/8HdbvA0guEob-NZaFXoo4cLPeGqZ9GXG5nHz_7z1mVM.cache +0 -0
  11. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8m/8mEi50e-_IfPcg9_Q6uce5HaxcaIC_t4_G-SNlr0-bo.cache +0 -0
  12. data/test/dummy/tmp/cache/assets/sprockets/v3.0/FJ/FJl1UD38XH2JuEwJbCugg6RfNGwUJNVb92ux6j3G3xQ.cache +1 -0
  13. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Gd/Gd8tiswPWckNiWDjg3SyX1qjgCWx9hTWyk3aEUIni_0.cache +0 -0
  14. data/test/dummy/tmp/cache/assets/sprockets/v3.0/I_/I_enjBstUZvxQsIsnIsfO4W4qNJvPmQRBB_UfTJG1vc.cache +0 -0
  15. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Kr/Kryd7RKOUX6w6jhfqgtLTA8I5NdFyYmOYIlY9LEBSco.cache +1 -0
  16. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Lh/LhA95F-8G9mIXijiZusQqSH09nth2iF4geHYjt7KGhE.cache +0 -0
  17. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Lr/Lrl-fcPwt6PsiweJJuXCk6C8alUay2BpiMZqM88v7hE.cache +0 -0
  18. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Lr/lrcqvvGfM1-mUUK3kTWo2F54foSVoLLNrsLC9iWz6EI.cache +0 -0
  19. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nf/NfYF2U5gmm2dwIlECVS_vYceSYZeHJ8JDl8_VOfl4sQ.cache +1 -0
  20. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pj/pJ8SDaM4R1YNFknx9zyLFHFIhN2XF1JY5CCQngjhzBI.cache +3 -0
  21. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pn/PnXyemE_pqjfE3gCVYWG-Qbrs1h6rYQ3iFMJCtyMWug.cache +1 -0
  22. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Q4/Q4FHxylzDGeBXjn_zOuozwG8-MdVLKy2sMRu2owbunA.cache +0 -0
  23. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qk/QkN6ads4-Z5Nk_3d7xv7LO5qUmwH0ith_FfdLD6DEgI.cache +1 -0
  24. data/test/dummy/tmp/cache/assets/sprockets/v3.0/S-/S-bvJGlt7mI2Pf4a8MtOkyu_HL3JWpRYUXRQqBtQ3P8.cache +1 -0
  25. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Sl/SlIX7TOEWHfrpsdpKojJj_k4GatCxg-kr8bISYN1THk.cache +1 -0
  26. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ys/YsSsqMMojgs0niLu4WD5Be3f1P2g1R7DClMsG-HvIJM.cache +0 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ai/aILCdU3MobAj5Yg4u5zkiu9h4W5yP40rGDc7OnEliU8.cache +1 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hF/hFqZ5ceMQxhEHp_JzCzD4zShL0NG4jKMWZ5GnUcli60.cache +0 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pt/ptmkSKHwup2ZYrhVRKYvT6UZNLSnjRxOjEAREHiOMPY.cache +0 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qP/QpwpLzKgtzGh7XsqIoy0U5lUD1OmSj8yrJg4I7ngeZs.cache +0 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rF/rFSKf2K8lIa7Cpqg_QjhFYZgA5ge4bXuQjn6NOCl6OQ.cache +1 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tH/tH_1K5dkJYUm2Js41MSTr_fSZJZ1FtWESfbrbj22bXI.cache +0 -0
  33. data/test/dummy/tmp/cache/assets/sprockets/v3.0/uH/uH2ThmZzB7Gx2jmb8vMx_tEHsAKr5Yoz9xnIPGDUOl0.cache +1 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v3.0/uj/ujlJnrNLol_eSt40b1EkTa-fs32SNP9MQ9HzZKt6y5Q.cache +0 -0
  35. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wE/wE9Y4aCCeFL7bx51AbHOAUZZsi-I3N_tuYxTzcxmAzw.cache +1 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wJ/wJc0YflkNN4gyM0P0nIwkggBr2wz6MK0PsZtL4AOSUw.cache +1 -0
  37. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xz/xzP0C4SZQ2FkMHAIC_DxoHzjVDrSMbORqzCl92SRnu8.cache +1 -0
  38. data/test/dummy/tmp/pids/server.pid +1 -1
  39. metadata +54 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15a5d06beaa01fe23e72b23952879b4f7bf3ec3e
4
- data.tar.gz: a9e44f86a7b748196a541462ff2a15e82ae80725
3
+ metadata.gz: c30e2fe060e3712226a6caa8b7f7082cbf94d9ee
4
+ data.tar.gz: e00d7b03df889aafa04a590fd9011b48386b27d4
5
5
  SHA512:
6
- metadata.gz: 8d127c1a85828f90491cc1bebbc7343837bc15ce30ac08f6442cf2bfccec535782d60d352c5b484067b38393e3c1f25615d77b4b7abd7574e1954c1a6273224e
7
- data.tar.gz: 4de2bef2f5ecd4f9f8c49325985c19e8e17b64ea9736da8ee18adc1b3095a631644bffc1ac1592cf8a0b9559c7c06e37e2dd91b45d4a9d1dfc65ea1a040c9e9f
6
+ metadata.gz: ecb8dae073040ea9dffcc7f4acbeffd56724c3c665f04718d88f629098d2a07fd439c61dcc0d1a6daa42f7c416f7603607a523b6132c90b130bb5e4563b1c1c8
7
+ data.tar.gz: e74aea6f37296d6b1189db4799aad9ec628c3b1f09897470c145c0b9f65a45e48d77ec1577036a825a7b75e6b0dc05bbc9cdcb9b5da41c009201f33566f119a1
@@ -10,8 +10,11 @@
10
10
  white-space: normal
11
11
 
12
12
  /* When hash is displayed (type with key in the left column), right key the key
13
- table.html_format_type_hash > tbody > tr > th
14
- text-align: right
13
+ table.html_format_type_hash > tbody > tr
14
+ > th
15
+ text-align: right
16
+ > td
17
+ text-align: left
15
18
 
16
19
  /* If th in the header is tight, gaps are increased so header can be changed to a new line
17
20
  table.html_format_type_array_of_hash thead
@@ -1,3 +1,3 @@
1
1
  module HtmlFormat
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -3,8 +3,8 @@ class WelcomeController < ApplicationController
3
3
  body = view_context.instance_eval do
4
4
  [
5
5
  {
6
- :name => "Array Of Hash",
7
- :code => <<~EOT,
6
+ name: "Array Of Hash",
7
+ code: <<~EOT,
8
8
  [
9
9
  {id: 1, name: "alice", created_at: "2000-01-01"},
10
10
  {id: 2, name: "bob", created_at: "2000-01-02"},
@@ -13,12 +13,12 @@ class WelcomeController < ApplicationController
13
13
  EOT
14
14
  },
15
15
  {
16
- :name => "Hash",
17
- :code => %({id: 1, name: "alice", created_at: "2000-01-01"}.to_html),
16
+ name: "Hash",
17
+ code: %({id: 1, name: "alice", created_at: "2000-01-01"}.to_html),
18
18
  },
19
19
  {
20
- :name => "Array Of Array",
21
- :code => <<~EOT,
20
+ name: "Array Of Array",
21
+ code: <<~EOT,
22
22
  [
23
23
  [1, 2, 3],
24
24
  [4, 5, 6],
@@ -27,60 +27,20 @@ EOT
27
27
  EOT
28
28
  },
29
29
  {
30
- :name => "Array",
31
- :code => %([1, 2, 3].to_html),
30
+ name: "Array",
31
+ code: %([1, 2, 3].to_html),
32
32
  },
33
33
  ].collect { |e|
34
34
  out = []
35
- out << content_tag(:div, content_tag(:h2, e[:name]), :class => "page-header")
36
- out << content_tag(:div, "CODE", :class => "label label-info")
35
+ out << content_tag(:div, content_tag(:h2, e[:name]), class: "page-header")
36
+ out << content_tag(:div, "CODE", class: "label label-info")
37
37
  out << content_tag(:pre, e[:code])
38
- out << content_tag(:div, "OUTPUT", :class => "label label-success")
38
+ out << content_tag(:div, "OUTPUT", class: "label label-info")
39
39
  out << tag(:br)
40
- out << tag(:br)
41
- out << eval(e[:code])
42
- }.join
40
+ out << content_tag(:div, eval(e[:code]), class: "text-center")
41
+ }.join.html_safe
43
42
  end
44
43
 
45
- # #
46
- # # / = data.to_html(title: "Array of Hash")
47
- # # / = data.first.values.to_html(title: "Array")
48
- # # / = [[:id, :name, :created_at], *data.collect(&:values)].to_html(title: "Array of Array")
49
- # #
50
- # # / = :a.to_html(title: :a)
51
- # # / {:a => 1, :b => 1} } %>
52
- # # / [{:a => 1, :b => 2}, {:a => 3, :b => 4}] } %>
53
- # # / [[:a, :b], [ 1, 2], [ 3, 4]] } %>
54
- # # / [:a, :b] } %>
55
- # # / :a } %>
56
- # #
57
- # #
58
- # # / <%- long = "あ(%)" * 20 %>
59
- # # / <%- long2 = "あ(%)" * 10 %>
60
- # # /
61
- # # / <%#= html_format(options) { [{"項目" => :id, "値" => [{:a => 1, :b => 2}, {:a => 1, :b => 2}]}] } %>
62
- # # / <%#= html_format(options) { {:a => 1, :b => 1} } %>
63
- # # / <%#= html_format(options) { [[:a, :b], [ 1, 2], [ 3, 4]] } %>
64
- # # / <%#= {:a => 1, :b => 2}.to_html %>
65
- # # / <%= [{long => long2}, {long => long2}, {long => long2}, {long => long2}].to_html %>
66
- # # / <%#= nil.to_html %>
67
- # # /
68
- # # / <% if true %>
69
- # # / <%= html_format(options) {} %>
70
- # # / <%= html_format(options) { :a } %>
71
- # # / <%= html_format(options) { {:a => 1, :b => 1} } %>
72
- # # / <%= html_format(options) { [{:a => 1, :b => 2}, {:a => 3, :b => 4}] } %>
73
- # # / <%= html_format(options) { [[:a, :b], [ 1, 2], [ 3, 4]] } %>
74
- # # / <%= html_format(options) { [:a, :b] } %>
75
- # # / <%= html_format(options) { :a } %>
76
- # # /
77
- # # / <%= html_format(options.merge(:responsive => true, :title => "title")) { "あ" * 100 } %>
78
- # # / <%= html_format(options.merge(:responsive => true, :caption => "caption")) { "あ" * 100 } %>
79
- # # /
80
- # # / <% v1 = [{:a => 1, :b => 2}, {:a => 3, :b => 4}] %>
81
- # # / <%= html_format(options) { [{:a => v1}] } %>
82
- # # / <% end %>
83
-
84
- render inline: body, layout: true
44
+ render html: body, layout: true
85
45
  end
86
46
  end
Binary file