bootstrap_builders 0.0.29 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 928d598c2a05f26dd498653023cff0c55bea8522
4
- data.tar.gz: 31330263588604f16128308f247fd97b9c0090e8
3
+ metadata.gz: d84e412b7027b0e2a0cd541939949d2f9f54c62c
4
+ data.tar.gz: df308c701ab84db160feac10c21a1734f762aa02
5
5
  SHA512:
6
- metadata.gz: cbcff0e97d5d14df0a141adf5024c5d7f57e0a0818914868db682c4c4c3e4752b77bac536858b13b5307b83212df34d2b0e0dec9686136707b1f7986692c6319
7
- data.tar.gz: a58490472ff40e00ffadb47080d4e043b0bbe093844b6a5fd2ca2416e45d255815d8c3a4cccc2a13324074a35a313da25a1833ddf933067d824e6d5ddd4b7afc
6
+ metadata.gz: c504ef03e04e20163e1d81f55e53aa67db34737f37d8abf28782cb5f5ea87169abc5472237ce1038805bf0197633dfc0f3d79c016ca2f1bd37676862c3ec26f1
7
+ data.tar.gz: 3ae3758c104be3de4cf68c0e92826c29c9464074f3d32677af19a4ee028bc24681d1f1ffb3de462411f8bdbc72cd8bf03ff52032a3b25aba63c10a164144b38d
@@ -1,20 +1,24 @@
1
1
  class BootstrapBuilders::Panel
2
2
  attr_accessor :context, :controls
3
3
 
4
- def self.with_parsed_args(*opts, &blk)
5
- title = opts.shift unless opts.first.is_a?(Hash)
6
- width = opts.shift unless opts.first.is_a?(Hash)
7
-
8
- if opts.length == 1 && opts.first.is_a?(Hash)
9
- args = opts.first
10
- title = args.fetch(:title) if args.key?(:title)
11
- width = args[:width] if args.key?(:width)
12
- right = args[:right] if args.key?(:right)
13
- else
14
- args = {}
15
- end
16
-
17
- BootstrapBuilders::Panel.new(args.merge(title: title, width: width, right: right, block: blk))
4
+ def self.with_parsed_args(*args_given, &blk)
5
+ args_parser = BootstrapBuilders::ArgumentsParser.new(
6
+ arguments: args_given,
7
+ short_true_arguments: [
8
+ :table
9
+ ]
10
+ )
11
+ args = args_parser.arguments
12
+ args_hash = args_parser.arguments_hash
13
+
14
+ title = args.shift if args.first.is_a?(String)
15
+ width = args.shift unless args.first.is_a?(Hash)
16
+
17
+ title = args_hash.fetch(:title) if args_hash.key?(:title)
18
+ width = args_hash[:width] if args_hash.key?(:width)
19
+ right = args_hash[:right] if args_hash.key?(:right)
20
+
21
+ BootstrapBuilders::Panel.new(args_hash.merge(title: title, width: width, right: right, block: blk))
18
22
  end
19
23
 
20
24
  def initialize(args)
@@ -1,3 +1,3 @@
1
1
  module BootstrapBuilders
2
- VERSION = "0.0.29".freeze
2
+ VERSION = "0.0.30".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_builders
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj