panels_for 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d8242e1d0a285d314bbd8a6579e3a0c94da705d
4
- data.tar.gz: 691b775513a957ab9e67c599743f3679d257b3da
3
+ metadata.gz: f2b5a6275dc5062ad1b751054a1a9c51ae086187
4
+ data.tar.gz: 5da8604f67d68f9267d024d0a491a7d643370404
5
5
  SHA512:
6
- metadata.gz: 6cf99f3ad078b83d299f0d28b64ee6b4ebde677013a8521902102c1dca8ba39948c9d6be47428807ee7002b2bd9a88dcf780eb52becd90e29c28d2fa938a6ccc
7
- data.tar.gz: 273f1050f5d792ef10c482a21232eeac803d2744d50dee5495eec83aecaa8cbaef4e49e6b2cfcf9f01fa090f43fb3bcf81eee9bcb426cd194f68cac33971d232
6
+ metadata.gz: a98787296d1e28da3f0a032397e667dfd7db9e171feeebb55ae9cad15b349065fa814e14efcdad5f234bede0aa54fac926bb4890144f6b84ebc64dedb8648769
7
+ data.tar.gz: 1f248d59de87c4783268d4f6452ab3e9afcac1440a8c24936bbc70bdc26d4fad006a1629d579464fcfdf275b4c5006cd662a48d3426a5ee9d5a947fde4d5cd81
@@ -27,7 +27,11 @@ module PanelsFor
27
27
  private
28
28
 
29
29
  def panel_default(title, options = {}, &block)
30
- content_tag(:div, class: 'panel panel-default') do
30
+ html_options = {}
31
+ html_options[:id] = options.delete(:id) if options.key?(:id)
32
+ html_options.reverse_merge!({ class: 'panel panel-default' })
33
+
34
+ content_tag(:div, html_options) do
31
35
  concat(panel_heading(title, options))
32
36
  concat(panel_body(title, options, &block))
33
37
  end
@@ -1,3 +1,3 @@
1
1
  module PanelsFor
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -1689,3 +1689,114 @@ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_wi
1689
1689
  PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1690
1690
  ---------------------------------------------------------------------------------------------------------------------------
1691
1691
   (0.1ms) rollback transaction
1692
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1693
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1694
+  (0.1ms) select sqlite_version(*)
1695
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1696
+  (0.2ms) SELECT version FROM "schema_migrations"
1697
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1698
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1699
+  (0.1ms) begin transaction
1700
+ -------------------------------------------------------------------------------------------------
1701
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1702
+ -------------------------------------------------------------------------------------------------
1703
+  (0.1ms) rollback transaction
1704
+  (0.1ms) begin transaction
1705
+ -----------------------------------------------------------------------------
1706
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1707
+ -----------------------------------------------------------------------------
1708
+  (0.1ms) rollback transaction
1709
+  (0.1ms) begin transaction
1710
+ ---------------------------------------------------------------------------------------------------------------------------
1711
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1712
+ ---------------------------------------------------------------------------------------------------------------------------
1713
+  (0.1ms) rollback transaction
1714
+  (0.1ms) begin transaction
1715
+ ------------------------------------------------------------------------------------------------------
1716
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1717
+ ------------------------------------------------------------------------------------------------------
1718
+  (0.1ms) rollback transaction
1719
+  (0.0ms) begin transaction
1720
+ ---------------------------------------------------------------------------------------------------
1721
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1722
+ ---------------------------------------------------------------------------------------------------
1723
+  (0.1ms) rollback transaction
1724
+  (0.1ms) begin transaction
1725
+ -------------------------
1726
+ PanelsForTest: test_truth
1727
+ -------------------------
1728
+  (0.2ms) rollback transaction
1729
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1730
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1731
+  (0.1ms) select sqlite_version(*)
1732
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1733
+  (0.1ms) SELECT version FROM "schema_migrations"
1734
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1735
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1736
+  (0.1ms) begin transaction
1737
+ -------------------------------------------------------------------------------------------------
1738
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1739
+ -------------------------------------------------------------------------------------------------
1740
+  (0.1ms) rollback transaction
1741
+  (0.1ms) begin transaction
1742
+ ---------------------------------------------------------------------------------------------------------------------------
1743
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1744
+ ---------------------------------------------------------------------------------------------------------------------------
1745
+  (0.1ms) rollback transaction
1746
+  (0.1ms) begin transaction
1747
+ ------------------------------------------------------------------------------------------------------
1748
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1749
+ ------------------------------------------------------------------------------------------------------
1750
+  (0.1ms) rollback transaction
1751
+  (0.1ms) begin transaction
1752
+ ---------------------------------------------------------------------------------------------------
1753
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1754
+ ---------------------------------------------------------------------------------------------------
1755
+  (0.1ms) rollback transaction
1756
+  (0.0ms) begin transaction
1757
+ -----------------------------------------------------------------------------
1758
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1759
+ -----------------------------------------------------------------------------
1760
+  (0.1ms) rollback transaction
1761
+  (0.2ms) begin transaction
1762
+ -------------------------
1763
+ PanelsForTest: test_truth
1764
+ -------------------------
1765
+  (0.0ms) rollback transaction
1766
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1767
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1768
+  (0.1ms) select sqlite_version(*)
1769
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1770
+  (0.2ms) SELECT version FROM "schema_migrations"
1771
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1772
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1773
+  (0.1ms) begin transaction
1774
+ ------------------------------------------------------------------------------------------------------
1775
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:icon]_draws_panel_with_icon_prefixed_title
1776
+ ------------------------------------------------------------------------------------------------------
1777
+  (0.1ms) rollback transaction
1778
+  (0.1ms) begin transaction
1779
+ ---------------------------------------------------------------------------------------------------------------------------
1780
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_and_options[:collapsed]_generates_a_collapsable_panel
1781
+ ---------------------------------------------------------------------------------------------------------------------------
1782
+  (0.1ms) rollback transaction
1783
+  (0.1ms) begin transaction
1784
+ ---------------------------------------------------------------------------------------------------
1785
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:collapse]_generates_a_collapsable_panel
1786
+ ---------------------------------------------------------------------------------------------------
1787
+  (0.1ms) rollback transaction
1788
+  (0.2ms) begin transaction
1789
+ -----------------------------------------------------------------------------
1790
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_draws_a_panel_with_content
1791
+ -----------------------------------------------------------------------------
1792
+  (0.1ms) rollback transaction
1793
+  (0.1ms) begin transaction
1794
+ -------------------------------------------------------------------------------------------------
1795
+ PanelsFor::Rails::PanelsForHelperTest: test_#panel_options[:id]_creates_a_panel_with_the_given_id
1796
+ -------------------------------------------------------------------------------------------------
1797
+  (0.2ms) rollback transaction
1798
+  (0.0ms) begin transaction
1799
+ -------------------------
1800
+ PanelsForTest: test_truth
1801
+ -------------------------
1802
+  (0.0ms) rollback transaction
@@ -30,6 +30,13 @@ class PanelsFor::Rails::PanelsForHelperTest < ActionView::TestCase
30
30
  end
31
31
  end
32
32
 
33
+ test "#panel options[:id] creates a panel with the given id" do
34
+ expected = "<div class=\"panel panel-default\" id=\"graphs\"><div class=\"panel-heading\"><h4 class=\"panel-title\">Graphs</h4></div><div class=\"panel-body\">Content</div></div>"
35
+ assert_panel_for(expected, object) do |b|
36
+ b.panel(:graphs, id: :graphs) { "Content" }
37
+ end
38
+ end
39
+
33
40
  private
34
41
 
35
42
  def object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panels_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ole J. Rosendahl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-25 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails