Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cool.trim, Str.words, run words.t
  • Loading branch information
moritz committed Aug 8, 2011
1 parent b6e553a commit d601bb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -109,6 +109,9 @@ my class Cool {
method samecase(Cool:D: Cool $pattern) { self.Stringy.samecase($pattern) }

method IO() { IO.new(:path(self)) }
method trim () { self.Stringy.trim };
method trim-leading () { self.Stringy.trim-leading };
method trim-trailing() { self.Stringy.trim-trailing };
}

sub chop($s) { $s.chop }
Expand Down
4 changes: 4 additions & 0 deletions src/core/Str.pm
Expand Up @@ -421,6 +421,10 @@ my class Str does Stringy {
method trim(Str:D:) {
self.trim-leading.trim-trailing;
}

method words(Str:D: Int $limit = *) {
self.comb( / \S+ /, $limit );
}
}


Expand Down
2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -564,7 +564,7 @@ S32-str/trim.t
S32-str/uc.t # icu
S32-str/ucfirst.t # icu
# S32-str/unpack.t # err: Default constructor only takes named arguments
# S32-str/words.t # err: Method 'words' not found for invocant of class 'Str' #icu
S32-str/words.t
# S32-temporal/calendar.t # err: Could not find sub &Date
# S32-temporal/Date.t # err: Could not find sub &Date
# S32-temporal/DateTime.t # err: Could not find sub &DateTime
Expand Down

0 comments on commit d601bb0

Please sign in to comment.