hooch 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: c983987b651132cb265c5856ff3ed79cef4351f5
4
- data.tar.gz: 0ff1c5e46583ba88c61675033aa444ff4e815933
3
+ metadata.gz: 002b7bee6d4c11657c26debfd758de362ce9b194
4
+ data.tar.gz: 51d382d86ef88967ff0fd936f7fd875d756da746
5
5
  SHA512:
6
- metadata.gz: d9d97d3f6c920289ce956a45a9158a39e43ee5a5c42533d40abda87d5f0881b99349a27838797eb4f5d90ee2cbcb4a3511a2f0d2623f9a224c4a03abbc62124f
7
- data.tar.gz: 242c54f8d9e76a2d2c32b14a6884bd4e8c5b9d5c54ec2986a999067474c33daf51841ccd89f588479daeccf6f38c69dc5f503f33427438f6271e4643943e792a
6
+ metadata.gz: 930d09541fec97440ed5aa61397bfb74765f7d33f8b985f0f96ba91ddcfcd2e948e6d7ac01daa0b9d6f86e53918bb174d2942dc07cd6bc4ae5364d5340f2e723
7
+ data.tar.gz: 8b540736e14bd6859578b2902906ecb4edda0dd1e25c8bf62ac2c18e9e8c8ef52d758f8fa02ab58f3af65a0b2bc78ca7c8b982d81c4da15fcbefdba5615f8033
@@ -20,9 +20,10 @@ module Hooch
20
20
  attrs = 'data-tab-id=' + id
21
21
  end
22
22
 
23
- def expander(id, expand_class: nil)
23
+ def expander(id, expand_class: nil, collapse_class: nil)
24
24
  attrs = "data-expander=true data-expand-id=" + id
25
- attrs += "data-expand-class=" + expand_class if expand_class.present?
25
+ attrs += " data-expand-class=" + expand_class if expand_class.present?
26
+ attrs += " data-collapse-class=" + collapse_class if collapse_class.present?
26
27
  attrs
27
28
  end
28
29
 
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -1414,5 +1414,147 @@ HoochHelperTest: test_0025_generates prevent_double_click attrs
1414
1414
   (0.1ms) begin transaction
1415
1415
  ----------------------------------------------------------------
1416
1416
  HoochHelperTest: test_0026_generates prevent_double_click params
1417
+ ----------------------------------------------------------------
1418
+  (0.0ms) rollback transaction
1419
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1420
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
1421
+  (0.1ms) select sqlite_version(*)
1422
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1423
+  (0.1ms) SELECT version FROM "schema_migrations"
1424
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
1425
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1426
+  (0.1ms) begin transaction
1427
+ -------------------------------------------------------
1428
+ HoochHelperTest: test_0001_generates tab set attributes
1429
+ -------------------------------------------------------
1430
+  (0.0ms) rollback transaction
1431
+  (0.0ms) begin transaction
1432
+ -------------------------------------------------------
1433
+ HoochHelperTest: test_0002_generates ajax tab set attrs
1434
+ -------------------------------------------------------
1435
+  (0.0ms) rollback transaction
1436
+  (0.0ms) begin transaction
1437
+ -----------------------------------------------------------------
1438
+ HoochHelperTest: test_0003_generates tab set attrs with a default
1439
+ -----------------------------------------------------------------
1440
+  (0.0ms) rollback transaction
1441
+  (0.0ms) begin transaction
1442
+ ------------------------------------------------------
1443
+ HoochHelperTest: test_0004_generates tab trigger attrs
1444
+ ------------------------------------------------------
1445
+  (0.0ms) rollback transaction
1446
+  (0.0ms) begin transaction
1447
+ ----------------------------------------------------------------------
1448
+ HoochHelperTest: test_0005_generates tab trigger attrs with push state
1449
+ ----------------------------------------------------------------------
1450
+  (0.0ms) rollback transaction
1451
+  (0.0ms) begin transaction
1452
+ ------------------------------------------------------
1453
+ HoochHelperTest: test_0006_generates tab_content attrs
1454
+ ------------------------------------------------------
1455
+  (0.1ms) rollback transaction
1456
+  (0.0ms) begin transaction
1457
+ ---------------------------------------------------
1458
+ HoochHelperTest: test_0007_generates expander attrs
1459
+ ---------------------------------------------------
1460
+  (0.1ms) rollback transaction
1461
+  (0.1ms) begin transaction
1462
+ ----------------------------------------------------------------
1463
+ HoochHelperTest: test_0008_generates expander attrs with classes
1464
+ ----------------------------------------------------------------
1465
+  (0.0ms) rollback transaction
1466
+  (0.0ms) begin transaction
1467
+ ----------------------------------------------------
1468
+ HoochHelperTest: test_0009_generates collapser attrs
1469
+ ----------------------------------------------------
1470
+  (0.0ms) rollback transaction
1471
+  (0.1ms) begin transaction
1472
+ ----------------------------------------------------
1473
+ HoochHelperTest: test_0010_generates collapsed attrs
1474
+ ----------------------------------------------------
1475
+  (0.0ms) rollback transaction
1476
+  (0.0ms) begin transaction
1477
+ ---------------------------------------------------
1478
+ HoochHelperTest: test_0011_generates expanded attrs
1479
+ ---------------------------------------------------
1480
+  (0.0ms) rollback transaction
1481
+  (0.0ms) begin transaction
1482
+ --------------------------------------------------
1483
+ HoochHelperTest: test_0012_generates emptier attrs
1484
+ --------------------------------------------------
1485
+  (0.0ms) rollback transaction
1486
+  (0.0ms) begin transaction
1487
+ --------------------------------------------------
1488
+ HoochHelperTest: test_0013_generates remover attrs
1489
+ --------------------------------------------------
1490
+  (0.0ms) rollback transaction
1491
+  (0.0ms) begin transaction
1492
+ ---------------------------------------------------
1493
+ HoochHelperTest: test_0014_generates revealer attrs
1494
+ ---------------------------------------------------
1495
+  (0.0ms) rollback transaction
1496
+  (0.0ms) begin transaction
1497
+ ----------------------------------------------------
1498
+ HoochHelperTest: test_0015_generates a revealer hash
1499
+ ----------------------------------------------------
1500
+  (0.0ms) rollback transaction
1501
+  (0.0ms) begin transaction
1502
+ ------------------------------------------------------
1503
+ HoochHelperTest: test_0016_generates click proxy attrs
1504
+ ------------------------------------------------------
1505
+  (0.0ms) rollback transaction
1506
+  (0.0ms) begin transaction
1507
+ ------------------------------------------------------------------
1508
+ HoochHelperTest: test_0017_generates click proxy attrs with target
1509
+ ------------------------------------------------------------------
1510
+  (0.0ms) rollback transaction
1511
+  (0.0ms) begin transaction
1512
+ -----------------------------------------------------
1513
+ HoochHelperTest: test_0018_generates click proxy hash
1514
+ -----------------------------------------------------
1515
+  (0.0ms) rollback transaction
1516
+  (0.0ms) begin transaction
1517
+ -------------------------------------------------------
1518
+ HoochHelperTest: test_0019_generates submit proxy attrs
1519
+ -------------------------------------------------------
1520
+  (0.0ms) rollback transaction
1521
+  (0.0ms) begin transaction
1522
+ --------------------------------------------------------
1523
+ HoochHelperTest: test_0020_generates submit proxy params
1524
+ --------------------------------------------------------
1525
+  (0.1ms) rollback transaction
1526
+  (0.0ms) begin transaction
1527
+ -------------------------------------------------------
1528
+ HoochHelperTest: test_0021_generates field filler attrs
1529
+ -------------------------------------------------------
1530
+  (0.0ms) rollback transaction
1531
+  (0.0ms) begin transaction
1532
+ --------------------------------------------------------
1533
+ HoochHelperTest: test_0022_generates field filler params
1534
+ --------------------------------------------------------
1535
+  (0.0ms) rollback transaction
1536
+  (0.0ms) begin transaction
1537
+ -----------------------------------------------
1538
+ HoochHelperTest: test_0023_generates link attrs
1539
+ -----------------------------------------------
1540
+  (0.0ms) rollback transaction
1541
+  (0.0ms) begin transaction
1542
+ ----------------------------------------------------------------
1543
+ HoochHelperTest: test_0024_generates prevent double submit attrs
1544
+ ----------------------------------------------------------------
1545
+  (0.0ms) rollback transaction
1546
+  (0.0ms) begin transaction
1547
+ -----------------------------------------------------------------
1548
+ HoochHelperTest: test_0025_generates prevent_double_submit params
1549
+ -----------------------------------------------------------------
1550
+  (0.0ms) rollback transaction
1551
+  (0.0ms) begin transaction
1552
+ ---------------------------------------------------------------
1553
+ HoochHelperTest: test_0026_generates prevent_double_click attrs
1554
+ ---------------------------------------------------------------
1555
+  (0.1ms) rollback transaction
1556
+  (0.0ms) begin transaction
1557
+ ----------------------------------------------------------------
1558
+ HoochHelperTest: test_0027_generates prevent_double_click params
1417
1559
  ----------------------------------------------------------------
1418
1560
   (0.0ms) rollback transaction
@@ -38,6 +38,11 @@ class HoochHelperTest < ActionView::TestCase
38
38
  attrs.must_equal "data-expander=true data-expand-id=see_more"
39
39
  end
40
40
 
41
+ it "generates expander attrs with classes" do
42
+ attrs = expander('see_more', expand_class: 'expanded', collapse_class: 'collapsed')
43
+ attrs.must_equal "data-expander=true data-expand-id=see_more data-expand-class=expanded data-collapse-class=collapsed"
44
+ end
45
+
41
46
  it "generates collapser attrs" do
42
47
  attrs = collapser('see_less')
43
48
  attrs.must_equal "data-collapser=true data-expand-id=see_less"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
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
  - Eric Draut