haml-edge 3.1.72 → 3.1.73

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.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.72
1
+ 3.1.73
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.72
1
+ 3.1.73
@@ -12,12 +12,12 @@ module Haml
12
12
  # SubsetMap preserves the order of values as they're inserted.
13
13
  #
14
14
  # @example
15
- # ssm = SubsetMap.new
16
- # ssm[Set[1, 2]] = "Foo"
17
- # ssm[Set[2, 3]] = "Bar"
18
- # ssm[Set[1, 2, 3]] = "Baz"
15
+ # ssm = SubsetMap.new
16
+ # ssm[Set[1, 2]] = "Foo"
17
+ # ssm[Set[2, 3]] = "Bar"
18
+ # ssm[Set[1, 2, 3]] = "Baz"
19
19
  #
20
- # ssm[Set[1, 2, 3]] #=> ["Foo", "Bar", "Baz"]
20
+ # ssm[Set[1, 2, 3]] #=> ["Foo", "Bar", "Baz"]
21
21
  class SubsetMap
22
22
  # Creates a new, empty SubsetMap.
23
23
  def initialize
data/lib/haml/util.rb CHANGED
@@ -26,11 +26,10 @@ module Haml
26
26
  end
27
27
 
28
28
  # Converts an array of `[key, value]` pairs to a hash.
29
- # For example:
30
- #
31
- # to_hash([[:foo, "bar"], [:baz, "bang"]])
32
- # #=> {:foo => "bar", :baz => "bang"}
33
29
  #
30
+ # @example
31
+ # to_hash([[:foo, "bar"], [:baz, "bang"]])
32
+ # #=> {:foo => "bar", :baz => "bang"}
34
33
  # @param arr [Array<(Object, Object)>] An array of pairs
35
34
  # @return [Hash] A hash
36
35
  def to_hash(arr)
@@ -38,11 +37,10 @@ module Haml
38
37
  end
39
38
 
40
39
  # Maps the keys in a hash according to a block.
41
- # For example:
42
- #
43
- # map_keys({:foo => "bar", :baz => "bang"}) {|k| k.to_s}
44
- # #=> {"foo" => "bar", "baz" => "bang"}
45
40
  #
41
+ # @example
42
+ # map_keys({:foo => "bar", :baz => "bang"}) {|k| k.to_s}
43
+ # #=> {"foo" => "bar", "baz" => "bang"}
46
44
  # @param hash [Hash] The hash to map
47
45
  # @yield [key] A block in which the keys are transformed
48
46
  # @yieldparam key [Object] The key that should be mapped
@@ -55,11 +53,10 @@ module Haml
55
53
  end
56
54
 
57
55
  # Maps the values in a hash according to a block.
58
- # For example:
59
- #
60
- # map_values({:foo => "bar", :baz => "bang"}) {|v| v.to_sym}
61
- # #=> {:foo => :bar, :baz => :bang}
62
56
  #
57
+ # @example
58
+ # map_values({:foo => "bar", :baz => "bang"}) {|v| v.to_sym}
59
+ # #=> {:foo => :bar, :baz => :bang}
63
60
  # @param hash [Hash] The hash to map
64
61
  # @yield [value] A block in which the values are transformed
65
62
  # @yieldparam value [Object] The value that should be mapped
@@ -72,11 +69,10 @@ module Haml
72
69
  end
73
70
 
74
71
  # Maps the key-value pairs of a hash according to a block.
75
- # For example:
76
- #
77
- # map_hash({:foo => "bar", :baz => "bang"}) {|k, v| [k.to_s, v.to_sym]}
78
- # #=> {"foo" => :bar, "baz" => :bang}
79
72
  #
73
+ # @example
74
+ # map_hash({:foo => "bar", :baz => "bang"}) {|k, v| [k.to_s, v.to_sym]}
75
+ # #=> {"foo" => :bar, "baz" => :bang}
80
76
  # @param hash [Hash] The hash to map
81
77
  # @yield [key, value] A block in which the key-value pairs are transformed
82
78
  # @yieldparam [key] The hash key
@@ -91,11 +87,10 @@ module Haml
91
87
 
92
88
  # Computes the powerset of the given array.
93
89
  # This is the set of all subsets of the array.
94
- # For example:
95
- #
96
- # powerset([1, 2, 3]) #=>
97
- # Set[Set[], Set[1], Set[2], Set[3], Set[1, 2], Set[2, 3], Set[1, 3], Set[1, 2, 3]]
98
90
  #
91
+ # @example
92
+ # powerset([1, 2, 3]) #=>
93
+ # Set[Set[], Set[1], Set[2], Set[3], Set[1, 2], Set[2, 3], Set[1, 3], Set[1, 2, 3]]
99
94
  # @param arr [Enumerable]
100
95
  # @return [Set<Set>] The subsets of `arr`
101
96
  def powerset(arr)
@@ -122,11 +117,10 @@ module Haml
122
117
 
123
118
  # Concatenates all strings that are adjacent in an array,
124
119
  # while leaving other elements as they are.
125
- # For example:
126
- #
127
- # merge_adjacent_strings([1, "foo", "bar", 2, "baz"])
128
- # #=> [1, "foobar", 2, "baz"]
129
120
  #
121
+ # @example
122
+ # merge_adjacent_strings([1, "foo", "bar", 2, "baz"])
123
+ # #=> [1, "foobar", 2, "baz"]
130
124
  # @param enum [Enumerable]
131
125
  # @return [Array] The enumerable with strings merged
132
126
  def merge_adjacent_strings(enum)
@@ -189,11 +183,11 @@ module Haml
189
183
  # @return [Array<Arrays>]
190
184
  #
191
185
  # @example
192
- # paths([[1, 2], [3, 4], [5]]) #=>
193
- # # [[1, 3, 5],
194
- # # [2, 3, 5],
195
- # # [1, 4, 5],
196
- # # [2, 4, 5]]
186
+ # paths([[1, 2], [3, 4], [5]]) #=>
187
+ # # [[1, 3, 5],
188
+ # # [2, 3, 5],
189
+ # # [1, 4, 5],
190
+ # # [2, 4, 5]]
197
191
  def paths(arrs)
198
192
  arrs.inject([[]]) do |paths, arr|
199
193
  flatten(arr.map {|e| paths.map {|path| path + [e]}}, 1)
@@ -7,21 +7,21 @@ module Sass
7
7
  # and passing in a block that's run when the callback is activated.
8
8
  #
9
9
  # @example Define a callback
10
- # class Munger
11
- # extend Sass::Callbacks
12
- # define_callback :string_munged
10
+ # class Munger
11
+ # extend Sass::Callbacks
12
+ # define_callback :string_munged
13
13
  #
14
- # def munge(str)
15
- # res = str.gsub(/[a-z]/, '\1\1')
16
- # run_string_munged str, res
17
- # res
14
+ # def munge(str)
15
+ # res = str.gsub(/[a-z]/, '\1\1')
16
+ # run_string_munged str, res
17
+ # res
18
+ # end
18
19
  # end
19
- # end
20
20
  #
21
21
  # @example Use a callback
22
- # m = Munger.new
23
- # m.on_string_munged {|str, res| puts "#{str} was munged into #{res}!"}
24
- # m.munge "bar" #=> bar was munged into bbaarr!
22
+ # m = Munger.new
23
+ # m.on_string_munged {|str, res| puts "#{str} was munged into #{res}!"}
24
+ # m.munge "bar" #=> bar was munged into bbaarr!
25
25
  module Callbacks
26
26
  protected
27
27
 
data/lib/sass/plugin.rb CHANGED
@@ -21,13 +21,13 @@ module Sass
21
21
  # and they all take a block that's called when the given action occurs.
22
22
  #
23
23
  # @example Using a callback
24
- # Sass::Plugin.on_updating_stylesheet do |template, css|
25
- # puts "Compiling #{template} to #{css}"
26
- # end
27
- # Sass::Plugin.update_stylesheets
28
- # #=> Compiling app/sass/screen.scss to public/stylesheets/screen.css
29
- # #=> Compiling app/sass/print.scss to public/stylesheets/print.css
30
- # #=> Compiling app/sass/ie.scss to public/stylesheets/ie.css
24
+ # Sass::Plugin.on_updating_stylesheet do |template, css|
25
+ # puts "Compiling #{template} to #{css}"
26
+ # end
27
+ # Sass::Plugin.update_stylesheets
28
+ # #=> Compiling app/sass/screen.scss to public/stylesheets/screen.css
29
+ # #=> Compiling app/sass/print.scss to public/stylesheets/print.css
30
+ # #=> Compiling app/sass/ie.scss to public/stylesheets/ie.css
31
31
  module Plugin
32
32
  include Haml::Util
33
33
 
@@ -186,15 +186,14 @@ module Sass::Script
186
186
 
187
187
  # Asserts that the type of a given SassScript value
188
188
  # is the expected type (designated by a symbol).
189
- # For example:
190
- #
191
- # assert_type value, :String
192
- # assert_type value, :Number
193
189
  #
194
190
  # Valid types are `:Bool`, `:Color`, `:Number`, and `:String`.
195
191
  # Note that `:String` will match both double-quoted strings
196
192
  # and unquoted identifiers.
197
193
  #
194
+ # @example
195
+ # assert_type value, :String
196
+ # assert_type value, :Number
198
197
  # @param value [Sass::Script::Literal] A SassScript value
199
198
  # @param type [Symbol] The name of the type the value is expected to be
200
199
  def assert_type(value, type)
@@ -452,11 +451,9 @@ module Sass::Script
452
451
  # Takes a color and an amount between 0 and 1,
453
452
  # and returns a color with the opacity increased by that value.
454
453
  #
455
- # For example:
456
- #
457
- # opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
458
- # opacify(rgba(0, 0, 17, 0.8), 0.2) => #001
459
- #
454
+ # @example
455
+ # opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
456
+ # opacify(rgba(0, 0, 17, 0.8), 0.2) => #001
460
457
  # @param color [Color]
461
458
  # @param amount [Number]
462
459
  # @return [Color]
@@ -472,11 +469,9 @@ module Sass::Script
472
469
  # Takes a color and an amount between 0 and 1,
473
470
  # and returns a color with the opacity decreased by that value.
474
471
  #
475
- # For example:
476
- #
477
- # transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
478
- # transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)
479
- #
472
+ # @example
473
+ # transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
474
+ # transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)
480
475
  # @param color [Color]
481
476
  # @param amount [Number]
482
477
  # @return [Color]
@@ -492,11 +487,9 @@ module Sass::Script
492
487
  # Takes a color and an amount between 0% and 100%,
493
488
  # and returns a color with the lightness increased by that value.
494
489
  #
495
- # For example:
496
- #
497
- # lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30)
498
- # lighten(#800, 20%) => #e00
499
- #
490
+ # @example
491
+ # lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30)
492
+ # lighten(#800, 20%) => #e00
500
493
  # @param color [Color]
501
494
  # @param amount [Number]
502
495
  # @return [Color]
@@ -511,11 +504,9 @@ module Sass::Script
511
504
  # Takes a color and an amount between 0% and 100%,
512
505
  # and returns a color with the lightness decreased by that value.
513
506
  #
514
- # For example:
515
- #
516
- # darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
517
- # darken(#800, 20%) => #200
518
- #
507
+ # @example
508
+ # darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
509
+ # darken(#800, 20%) => #200
519
510
  # @param color [Color]
520
511
  # @param amount [Number]
521
512
  # @return [Color]
@@ -530,11 +521,9 @@ module Sass::Script
530
521
  # Takes a color and an amount between 0% and 100%,
531
522
  # and returns a color with the saturation increased by that value.
532
523
  #
533
- # For example:
534
- #
535
- # saturate(hsl(120, 30%, 90%), 20%) => hsl(120, 50%, 90%)
536
- # saturate(#855, 20%) => #9e3f3f
537
- #
524
+ # @example
525
+ # saturate(hsl(120, 30%, 90%), 20%) => hsl(120, 50%, 90%)
526
+ # saturate(#855, 20%) => #9e3f3f
538
527
  # @param color [Color]
539
528
  # @param amount [Number]
540
529
  # @return [Color]
@@ -549,11 +538,9 @@ module Sass::Script
549
538
  # Takes a color and an amount between 0% and 100%,
550
539
  # and returns a color with the saturation decreased by that value.
551
540
  #
552
- # For example:
553
- #
554
- # desaturate(hsl(120, 30%, 90%), 20%) => hsl(120, 10%, 90%)
555
- # desaturate(#855, 20%) => #726b6b
556
- #
541
+ # @example
542
+ # desaturate(hsl(120, 30%, 90%), 20%) => hsl(120, 10%, 90%)
543
+ # desaturate(#855, 20%) => #726b6b
557
544
  # @param color [Color]
558
545
  # @param amount [Number]
559
546
  # @return [Color]
@@ -568,12 +555,10 @@ module Sass::Script
568
555
  # Takes a color and a number of degrees (usually between -360deg and 360deg),
569
556
  # and returns a color with the hue rotated by that value.
570
557
  #
571
- # For example:
572
- #
573
- # adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
574
- # adjust-hue(hsl(120, 30%, 90%), 060deg) => hsl(60, 30%, 90%)
575
- # adjust-hue(#811, 45deg) => #886a11
576
- #
558
+ # @example
559
+ # adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
560
+ # adjust-hue(hsl(120, 30%, 90%), 060deg) => hsl(60, 30%, 90%)
561
+ # adjust-hue(#811, 45deg) => #886a11
577
562
  # @param color [Color]
578
563
  # @param amount [Number]
579
564
  # @return [Color]
@@ -596,12 +581,10 @@ module Sass::Script
596
581
  # 25% means that a quarter of the first color
597
582
  # and three quarters of the second color should be used.
598
583
  #
599
- # For example:
600
- #
601
- # mix(#f00, #00f) => #7f007f
602
- # mix(#f00, #00f, 25%) => #3f00bf
603
- # mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)
604
- #
584
+ # @example
585
+ # mix(#f00, #00f) => #7f007f
586
+ # mix(#f00, #00f, 25%) => #3f00bf
587
+ # mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)
605
588
  # @overload mix(color1, color2, weight = 50%)
606
589
  # @param color1 [Color]
607
590
  # @param color2 [Color]
@@ -680,8 +663,8 @@ module Sass::Script
680
663
  # @raise [ArgumentError] if `str` isn't a string
681
664
  # @see #quote
682
665
  # @example
683
- # unquote("foo") => foo
684
- # unquote(foo) => foo
666
+ # unquote("foo") => foo
667
+ # unquote(foo) => foo
685
668
  def unquote(str)
686
669
  assert_type str, :String
687
670
  Sass::Script::String.new(str.value, :identifier)
@@ -695,23 +678,22 @@ module Sass::Script
695
678
  # @raise [ArgumentError] if `str` isn't a string
696
679
  # @see #unquote
697
680
  # @example
698
- # quote("foo") => "foo"
699
- # quote(foo) => "foo"
681
+ # quote("foo") => "foo"
682
+ # quote(foo) => "foo"
700
683
  def quote(str)
701
684
  assert_type str, :String
702
685
  Sass::Script::String.new(str.value, :string)
703
686
  end
704
687
 
705
688
  # Inspects the type of the argument, returning it as an unquoted string.
706
- # For example:
707
- #
708
- # type-of(100px) => number
709
- # type-of(asdf) => string
710
- # type-of("asdf") => string
711
- # type-of(true) => bool
712
- # type-of(#fff) => color
713
- # type-of(blue) => color
714
689
  #
690
+ # @example
691
+ # type-of(100px) => number
692
+ # type-of(asdf) => string
693
+ # type-of("asdf") => string
694
+ # type-of(true) => bool
695
+ # type-of(#fff) => color
696
+ # type-of(blue) => color
715
697
  # @param obj [Literal] The object to inspect
716
698
  # @return [String] The unquoted string name of the literal's type
717
699
  def type_of(obj)
@@ -720,14 +702,13 @@ module Sass::Script
720
702
 
721
703
  # Inspects the unit of the number, returning it as a quoted string.
722
704
  # Complex units are sorted in alphabetical order by numerator and denominator.
723
- # For example:
724
- #
725
- # unit(100) => ""
726
- # unit(100px) => "px"
727
- # unit(3em) => "em"
728
- # unit(10px * 5em) => "em*px"
729
- # unit(10px * 5em / 30cm / 1rem) => "em*px/cm*rem"
730
705
  #
706
+ # @example
707
+ # unit(100) => ""
708
+ # unit(100px) => "px"
709
+ # unit(3em) => "em"
710
+ # unit(10px * 5em) => "em*px"
711
+ # unit(10px * 5em / 30cm / 1rem) => "em*px/cm*rem"
731
712
  # @param number [Literal] The number to inspect
732
713
  # @return [String] The unit(s) of the number
733
714
  # @raise [ArgumentError] if `number` isn't a number
@@ -737,11 +718,10 @@ module Sass::Script
737
718
  end
738
719
 
739
720
  # Inspects the unit of the number, returning a boolean indicating if it is unitless.
740
- # For example:
741
- #
742
- # unitless(100) => true
743
- # unitless(100px) => false
744
721
  #
722
+ # @example
723
+ # unitless(100) => true
724
+ # unitless(100px) => false
745
725
  # @param number [Literal] The number to inspect
746
726
  # @return [Bool] Whether or not the number is unitless
747
727
  # @raise [ArgumentError] if `number` isn't a number
@@ -751,12 +731,11 @@ module Sass::Script
751
731
  end
752
732
 
753
733
  # Returns true if two numbers are similar enough to be added, subtracted, or compared.
754
- # For example:
755
- #
756
- # comparable(2px, 1px) => true
757
- # comparable(100px, 3em) => false
758
- # comparable(10cm, 3mm) => true
759
734
  #
735
+ # @example
736
+ # comparable(2px, 1px) => true
737
+ # comparable(100px, 3em) => false
738
+ # comparable(10cm, 3mm) => true
760
739
  # @param number1 [Number]
761
740
  # @param number2 [Number]
762
741
  # @return [Bool] indicating if the numbers can be compared.
@@ -768,10 +747,9 @@ module Sass::Script
768
747
  end
769
748
 
770
749
  # Converts a decimal number to a percentage.
771
- # For example:
772
- #
773
- # percentage(100px / 50px) => 200%
774
750
  #
751
+ # @example
752
+ # percentage(100px / 50px) => 200%
775
753
  # @param value [Number] The decimal number to convert to a percentage
776
754
  # @return [Number] The percentage
777
755
  # @raise [ArgumentError] If `value` isn't a unitless number
@@ -783,11 +761,10 @@ module Sass::Script
783
761
  end
784
762
 
785
763
  # Rounds a number to the nearest whole number.
786
- # For example:
787
- #
788
- # round(10.4px) => 10px
789
- # round(10.6px) => 11px
790
764
  #
765
+ # @example
766
+ # round(10.4px) => 10px
767
+ # round(10.6px) => 11px
791
768
  # @param value [Number] The number
792
769
  # @return [Number] The rounded number
793
770
  # @raise [Sass::SyntaxError] if `value` isn't a number
@@ -796,11 +773,10 @@ module Sass::Script
796
773
  end
797
774
 
798
775
  # Rounds a number up to the nearest whole number.
799
- # For example:
800
- #
801
- # ciel(10.4px) => 11px
802
- # ciel(10.6px) => 11px
803
776
  #
777
+ # @example
778
+ # ciel(10.4px) => 11px
779
+ # ciel(10.6px) => 11px
804
780
  # @param value [Number] The number
805
781
  # @return [Number] The rounded number
806
782
  # @raise [Sass::SyntaxError] if `value` isn't a number
@@ -809,11 +785,10 @@ module Sass::Script
809
785
  end
810
786
 
811
787
  # Rounds down to the nearest whole number.
812
- # For example:
813
- #
814
- # floor(10.4px) => 10px
815
- # floor(10.6px) => 10px
816
788
  #
789
+ # @example
790
+ # floor(10.4px) => 10px
791
+ # floor(10.6px) => 10px
817
792
  # @param value [Number] The number
818
793
  # @return [Number] The rounded number
819
794
  # @raise [Sass::SyntaxError] if `value` isn't a number
@@ -822,11 +797,10 @@ module Sass::Script
822
797
  end
823
798
 
824
799
  # Finds the absolute value of a number.
825
- # For example:
826
- #
827
- # abs(10px) => 10px
828
- # abs(-10px) => 10px
829
800
  #
801
+ # @example
802
+ # abs(10px) => 10px
803
+ # abs(-10px) => 10px
830
804
  # @param value [Number] The number
831
805
  # @return [Number] The absolute value
832
806
  # @raise [Sass::SyntaxError] if `value` isn't a number
@@ -91,10 +91,9 @@ module Sass
91
91
  # that the given selector matches (as well as possibly more).
92
92
  #
93
93
  # @example
94
- # (.foo).superselector?(.foo.bar) #=> true
95
- # (.foo).superselector?(.bar) #=> false
96
- # (.bar .foo).superselector?(.foo) #=> false
97
- #
94
+ # (.foo).superselector?(.foo.bar) #=> true
95
+ # (.foo).superselector?(.bar) #=> false
96
+ # (.bar .foo).superselector?(.foo) #=> false
98
97
  # @param sseq [SimpleSequence]
99
98
  # @return [Boolean]
100
99
  def superselector?(sseq)
@@ -100,9 +100,8 @@ module Sass
100
100
  # that the given selector matches (as well as possibly more).
101
101
  #
102
102
  # @example
103
- # (.foo).superselector?(.foo.bar) #=> true
104
- # (.foo).superselector?(.bar) #=> false
105
- #
103
+ # (.foo).superselector?(.foo.bar) #=> true
104
+ # (.foo).superselector?(.bar) #=> false
106
105
  # @param sseq [SimpleSequence]
107
106
  # @return [Boolean]
108
107
  def superselector?(sseq)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.72
4
+ version: 3.1.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-08-30 00:00:00 -04:00
14
+ date: 2010-09-06 00:00:00 -04:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency