SassyStrings 1.0.0 → 1.0.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: 1858e81abf387817256c495624957d607f23ff37
4
- data.tar.gz: 02bde1b71b1f9e115966456f75ca0790f19c96a2
3
+ metadata.gz: 3899887f5222edd4ba1eecc70d5f9050abce8de9
4
+ data.tar.gz: e02a8b4448c9c00d2272a1b1a1d399d9bf4e1f6e
5
5
  SHA512:
6
- metadata.gz: f8aa02689622cc9b8ed86ce1c77a527af828a95a4610919311b90eb72b3fea01490caaeff2fcddbc624ef9a82a1aec802c9d9c95b5a7fa730f5e672111e14369
7
- data.tar.gz: 9336e6f541dbcfd7e549a8aa298c8bad6e1cfbecc99f584bd31e59d513793ee80fae5f313a6c5bd7e89f99ea4a01b72c447b69620eca31da3f1ae2fe27095eef
6
+ metadata.gz: be9b497e564554997e0d12d51bc54b6bc36610bdaf2cebc1a151d0563dcfc643a572b15483bafc10c2000f6324572f09c691fa6a5ea805de1c58f4c3bcf81992
7
+ data.tar.gz: a92dba77ae9cedacc0234a429723f8ac819c1f225d76666196fa73e008c140f306bb844bc651ed389e6ed6af6fe0c87a42030cc92d2a4d4c53f7511c410d897d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # Changelog
2
2
 
3
- * `1.0.0`: stable
4
- * `0.0.1`: initial commit
3
+ * `1.0.1`: fixed a lot of tiny bugs ([#8](https://github.com/HugoGiraudel/SassyStrings/pull/8))
4
+ * `1.0.0`: initial commit
data/README.md CHANGED
@@ -7,7 +7,7 @@ Here is a [Compass Extension](http://compass-style.org/) providing you all funct
7
7
  * `char-at($string, $index)`: returns the character from `$string` at index `$index`
8
8
  * `levenshtein($a, $b)`: returns the Levenshtein distance betwee `$a` and `$b`
9
9
  * `str-count($string, $needle)`: counts number of occurrences of `$needle` in `$string`
10
- * `str-ends-width($string, $needle)`: returns wether `$string` ends with `$needle`
10
+ * `str-ends-with($string, $needle)`: returns wether `$string` ends with `$needle`
11
11
  * `str-explode($string, $separator)`: explodes `$string` on `$separator` occurrences
12
12
  * `str-implode($list)`: implodes `$list` into a string
13
13
  * `str-last-index($string, $needle)`: returns last index of `$needle` in `$string`
@@ -43,3 +43,7 @@ If you feel like an explorer, you can have a look at the code [here](https://git
43
43
  * Compass ~> 1.0
44
44
 
45
45
  Some functions depend on other functions. If you include functions individually, make sure to check for these dependencies in their respective docs.
46
+
47
+ ## Credits
48
+
49
+ Huge thanks to [Marc Mintel](http://twitter.com/marcmintel) for his help.
data/lib/SassyStrings.rb CHANGED
@@ -4,8 +4,8 @@ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
4
4
  Compass::Frameworks.register("SassyStrings", :path => "#{File.dirname(__FILE__)}/..")
5
5
 
6
6
  module SassyStrings
7
- VERSION = "1.0.0"
8
- DATE = "2014-03-22"
7
+ VERSION = "1.0.1"
8
+ DATE = "2014-02-16"
9
9
  end
10
10
 
11
11
  # Sassy String Functions
@@ -10,10 +10,13 @@
10
10
  @import "functions/str-ends-with";
11
11
  @import "functions/str-explode";
12
12
  @import "functions/str-implode";
13
+ @import "functions/str-last-index";
13
14
  @import "functions/str-lcfirst";
14
15
  @import "functions/str-pad";
16
+ @import "functions/str-printf";
15
17
  @import "functions/str-repeat";
16
18
  @import "functions/str-replace";
19
+ @import "functions/str-reverse";
17
20
  @import "functions/str-rot";
18
21
  @import "functions/str-shuffle";
19
22
  @import "functions/str-starts-with";
@@ -1,8 +1,11 @@
1
- // Return last index of $needle in $string
2
- // ----------------------------------------------------------------------------------------------------
3
- // @param [string] $string: string
4
- // ----------------------------------------------------------------------------------------------------
5
- // @return [number] | null | false
1
+ /*
2
+ * Return last index of $needle in $string
3
+ * ---
4
+ * @param {string} $string - string to search in
5
+ * @param {string} $needle - substring to search for
6
+ * ---
7
+ * @return {number | null | false}
8
+ */
6
9
 
7
10
  @function str-last-index($string, $needle) {
8
11
  @if type-of($string) != "string" {
@@ -1,8 +1,10 @@
1
- // Capitalize first letter from $strign
2
- // ----------------------------------------------------------------------------------------------------
3
- // @param [string] $string: string
4
- // ----------------------------------------------------------------------------------------------------
5
- // @return [string] | false
1
+ /*
2
+ * Capitalize first letter from $string
3
+ * ---
4
+ * @param {string} $string - string for capitalization
5
+ * ---
6
+ * @return {string | false}
7
+ */
6
8
 
7
9
  @function str-ucfirst($string) {
8
10
  @if type-of($string) != "string" {
@@ -1,26 +1,32 @@
1
- // Count number of words in $string
2
- // ----------------------------------------------------------------------------------------------------
3
- // @param [string] $string: string
4
- // ----------------------------------------------------------------------------------------------------
5
- // @return [string] | false
1
+ /*
2
+ * Count number of words in $string
3
+ * ---
4
+ * @param {string} $string - string to check
5
+ * ---
6
+ * @return {string|false}
7
+ */
6
8
 
7
9
  @function str-word-count($string) {
8
- @if type-of($string) != "string" {
9
- @warn "`str-word-count` function expecting a string for $string; #{type-of($string)} given.";
10
- @return false;
11
- }
10
+ @if type-of($string) != "string" {
11
+ @warn "`str-word-count` function expecting a string for $string; #{type-of($string)} given.";
12
+ @return false;
13
+ }
14
+
15
+ @if $string == '' {
16
+ @return 0;
17
+ }
12
18
 
13
- $string: str-trim($string);
14
- $words: ();
15
- $i: str-length($string);
19
+ $string: str-trim($string);
20
+ $words: ();
21
+ $i: str-length($string);
16
22
 
17
- @while $i > 0 {
18
- @if str-slice($string, $i, $i) == " " {
19
- $words: append($words, str-slice($string, $i + 1));
20
- $string: str-slice($string, 1, $i - 1);
23
+ @while $i > 0 {
24
+ @if str-slice($string, $i, $i) == " " {
25
+ $words: append($words, str-slice($string, $i + 1));
26
+ $string: str-slice($string, 1, $i - 1);
27
+ }
28
+ $i: $i - 1;
21
29
  }
22
- $i: $i - 1;
23
- }
24
30
 
25
- @return length(append($words, $string));
31
+ @return length(append($words, $string));
26
32
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SassyStrings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugo Giraudel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-22 00:00:00.000000000 Z
11
+ date: 2014-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '1.2'
89
89
  requirements: []
90
90
  rubyforge_project: SassyStrings
91
- rubygems_version: 2.0.3
91
+ rubygems_version: 2.0.14
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Advanced String handling for Sass