classify 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/classify.gemspec +1 -1
  2. data/lib/classify.rb +4 -3
  3. metadata +1 -1
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "classify"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
@@ -1,7 +1,7 @@
1
1
  class Classify
2
2
  def self.it!(string)
3
- raise ArgumentError, "Wrong argument #{string.inspect}" if not string.class == String or string.match(/(^\_)|(\_$)|([^a-z0-9\_])/i)
4
- Classify.new.camelize(string)
3
+ cf = Classify.new
4
+ cf.try_converting(cf.camelize(string))
5
5
  end
6
6
 
7
7
  def try_converting(string)
@@ -13,6 +13,7 @@ class Classify
13
13
  end
14
14
 
15
15
  def camelize(string)
16
- self.try_converting(string.gsub(/^(.{1})|\_.{1}/) { |s| s.gsub(/[^a-z0-9]+/i, '').capitalize })
16
+ raise ArgumentError, "Wrong argument #{string.inspect}" if not string.class == String or string.match(/(^\_)|(\_$)|([^a-z0-9\_])/i)
17
+ string.gsub(/^(.{1})|\_.{1}/) { |s| s.gsub(/[^a-z0-9]+/i, '').capitalize }
17
18
  end
18
19
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: classify
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander