libraries 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,3 @@
1
- require "active_support/all"
2
-
3
1
  require "libraries/enumerable"
4
2
  require "libraries/array"
5
3
  require "libraries/hash"
@@ -2,8 +2,7 @@ class Object
2
2
 
3
3
  def m regexp=nil
4
4
  m = (self.methods - Object.methods).sort
5
- return m.grep(/#{regexp}/) if regexp
6
- m
5
+ regexp ? m.grep(/#{regexp}/) : m
7
6
  end
8
7
 
9
8
  end
@@ -1,19 +1,13 @@
1
1
  class String
2
2
 
3
- def strip_with_arg_support!(char=nil)
4
- if char.present?
5
- m = char.each_char.inject('') {|r,c| r+=(c =~ /[\*\.\[\]\^\$\?\\\|\=\+\:\/\(\)]/ ? "\\" : "") + c}
6
- self.gsub!(/^[#{m}]*(.*?)[#{m}]*$/,'\1')
7
- else
8
- strip_without_arg_support!
9
- end
3
+ def stripc!(char)
4
+ m = char.each_char.inject('') {|r,c| r+=(c =~ /[\*\.\[\]\^\$\?\\\|\=\+\:\/\(\)]/ ? "\\" : "") + c}
5
+ self.gsub!(/^[#{m}]*(.*?)[#{m}]*$/,'\1')
10
6
  end
11
- alias_method_chain :strip!, :arg_support
12
7
 
13
- def strip_with_arg_support(char=nil)
14
- char.present? ? self.dup.strip!(char) : strip_without_arg_support
8
+ def stripc(char)
9
+ self.dup.strip!(char)
15
10
  end
16
- alias_method_chain :strip, :arg_support
17
11
 
18
12
  # In the sense of normal characters only, it also downcases the string
19
13
  # Can be used, for example, in file names and css classes
@@ -1,3 +1,3 @@
1
1
  module Libraries
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: libraries
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - On-Site.com