consistent_company 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module ConsistentCompany
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 6
5
+ PATCH = 7
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consistent_company
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,74 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-12 00:00:00.000000000Z
12
+ date: 2012-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: shoulda
16
- requirement: &70324089634640 !ruby/object:Gem::Requirement
15
+ name: consistent_company
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
- type: :development
22
+ type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70324089634640
25
- - !ruby/object:Gem::Dependency
26
- name: bundler
27
- requirement: &70324089634020 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ~>
31
- - !ruby/object:Gem::Version
32
- version: 1.0.18
33
- type: :development
34
- prerelease: false
35
- version_requirements: *70324089634020
36
- - !ruby/object:Gem::Dependency
37
- name: jeweler
38
- requirement: &70324089633540 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- version: 1.6.4
44
- type: :development
45
- prerelease: false
46
- version_requirements: *70324089633540
47
- - !ruby/object:Gem::Dependency
48
- name: rcov
49
- requirement: &70324089632920 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
56
- prerelease: false
57
- version_requirements: *70324089632920
58
- - !ruby/object:Gem::Dependency
59
- name: pry
60
- requirement: &70324089632440 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
61
25
  none: false
62
26
  requirements:
63
27
  - - ! '>='
64
28
  - !ruby/object:Gem::Version
65
29
  version: '0'
66
- type: :development
67
- prerelease: false
68
- version_requirements: *70324089632440
69
- - !ruby/object:Gem::Dependency
70
- name: rake-compiler
71
- requirement: &70324089631820 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- version: 0.7.6
77
- type: :development
78
- prerelease: false
79
- version_requirements: *70324089631820
80
30
  description: Ruby C Extension to normalize a company name. Useful when company names
81
31
  come from various sources.
82
32
  email: dcleven@marketron.com
@@ -87,21 +37,12 @@ extra_rdoc_files:
87
37
  - LICENSE.txt
88
38
  - README.md
89
39
  files:
90
- - .document
91
- - Gemfile
92
- - Gemfile.lock
93
- - LICENSE.txt
94
- - README.md
95
- - Rakefile
96
- - VERSION
97
- - consistent_company.gemspec
98
40
  - ext/consistent_company/consistent_company.c
99
- - ext/consistent_company/extconf.rb
100
41
  - lib/consistent_company.rb
101
- - lib/consistent_company/consistent_company.bundle
102
42
  - lib/consistent_company/version.rb
103
- - test/helper.rb
104
- - test/test_consistent_company.rb
43
+ - LICENSE.txt
44
+ - README.md
45
+ - ext/consistent_company/extconf.rb
105
46
  homepage: http://github.com/dcleven/consistent_company
106
47
  licenses:
107
48
  - MIT
@@ -117,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
58
  version: '0'
118
59
  segments:
119
60
  - 0
120
- hash: 165319978954417084
61
+ hash: -993795780705294571
121
62
  required_rubygems_version: !ruby/object:Gem::Requirement
122
63
  none: false
123
64
  requirements:
@@ -126,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
67
  version: '0'
127
68
  requirements: []
128
69
  rubyforge_project:
129
- rubygems_version: 1.8.6
70
+ rubygems_version: 1.8.24
130
71
  signing_key:
131
72
  specification_version: 3
132
73
  summary: Normalize a company name for consistent matching
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
-
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
8
- group :development do
9
- gem "shoulda", ">= 0"
10
- gem "bundler", "~> 1.0.18"
11
- gem "jeweler", "~> 1.6.4"
12
- gem "rcov", ">= 0"
13
- gem 'pry'
14
- gem "rake-compiler", "~> 0.7.6"
15
- end
data/Gemfile.lock DELETED
@@ -1,36 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- coderay (0.9.8)
5
- git (1.2.5)
6
- jeweler (1.6.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- method_source (0.6.5)
11
- ruby_parser (>= 2.0.5)
12
- pry (0.9.5)
13
- coderay (>= 0.9.8)
14
- method_source (>= 0.6.5)
15
- ruby_parser (>= 2.0.5)
16
- slop (~> 2.1.0)
17
- rake (0.9.2)
18
- rake-compiler (0.7.6)
19
- rake
20
- rcov (0.9.10)
21
- ruby_parser (2.3.0)
22
- sexp_processor (~> 3.0)
23
- sexp_processor (3.0.6)
24
- shoulda (2.11.3)
25
- slop (2.1.0)
26
-
27
- PLATFORMS
28
- ruby
29
-
30
- DEPENDENCIES
31
- bundler (~> 1.0.18)
32
- jeweler (~> 1.6.4)
33
- pry
34
- rake-compiler (~> 0.7.6)
35
- rcov
36
- shoulda
data/Rakefile DELETED
@@ -1,48 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
-
6
- begin
7
- Bundler.setup(:default, :development)
8
- rescue Bundler::BundlerError => e
9
- $stderr.puts e.message
10
- $stderr.puts "Run `bundle install` to install missing gems"
11
- exit e.status_code
12
- end
13
- require 'rake'
14
-
15
- require "rake/extensiontask"
16
- Rake::ExtensionTask.new("consistent_company") do |extension|
17
- extension.lib_dir = "lib/consistent_company"
18
- end
19
-
20
- task :build => [:clean, :compile]
21
-
22
- require 'jeweler'
23
- require './lib/consistent_company/version.rb'
24
- Jeweler::Tasks.new do |gem|
25
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
26
- gem.name = "consistent_company"
27
- gem.homepage = "http://github.com/dcleven/consistent_company"
28
- gem.license = "MIT"
29
- gem.summary = %Q{Normalize a company name for consistent matching}
30
- gem.description = %Q{Ruby C Extension to normalize a company name. Useful when company names come from various sources.}
31
- gem.email = "dcleven@marketron.com"
32
- gem.authors = ["Doug Cleven"]
33
- gem.version = ConsistentCompany::Version::STRING
34
- gem.files.include('lib/consistent_company/*') # add native stuff
35
- # dependencies defined in Gemfile
36
- end
37
- Jeweler::RubygemsDotOrgTasks.new
38
-
39
- task :test => [:build]
40
-
41
- require 'rake/testtask'
42
- Rake::TestTask.new(:test) do |test|
43
- test.libs << 'lib' << 'test'
44
- test.pattern = 'test/**/test_*.rb'
45
- test.verbose = true
46
- end
47
-
48
- task :default => :test
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.6
@@ -1,70 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{consistent_company}
8
- s.version = "0.0.6"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Doug Cleven}]
12
- s.date = %q{2012-09-12}
13
- s.description = %q{Ruby C Extension to normalize a company name. Useful when company names come from various sources.}
14
- s.email = %q{dcleven@marketron.com}
15
- s.extensions = [%q{ext/consistent_company/extconf.rb}]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.md"
19
- ]
20
- s.files = [
21
- ".document",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE.txt",
25
- "README.md",
26
- "Rakefile",
27
- "VERSION",
28
- "consistent_company.gemspec",
29
- "ext/consistent_company/consistent_company.c",
30
- "ext/consistent_company/extconf.rb",
31
- "lib/consistent_company.rb",
32
- "lib/consistent_company/consistent_company.bundle",
33
- "lib/consistent_company/version.rb",
34
- "test/helper.rb",
35
- "test/test_consistent_company.rb"
36
- ]
37
- s.homepage = %q{http://github.com/dcleven/consistent_company}
38
- s.licenses = [%q{MIT}]
39
- s.require_paths = [%q{lib}]
40
- s.rubygems_version = %q{1.8.6}
41
- s.summary = %q{Normalize a company name for consistent matching}
42
-
43
- if s.respond_to? :specification_version then
44
- s.specification_version = 3
45
-
46
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
- s.add_development_dependency(%q<shoulda>, [">= 0"])
48
- s.add_development_dependency(%q<bundler>, ["~> 1.0.18"])
49
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
50
- s.add_development_dependency(%q<rcov>, [">= 0"])
51
- s.add_development_dependency(%q<pry>, [">= 0"])
52
- s.add_development_dependency(%q<rake-compiler>, ["~> 0.7.6"])
53
- else
54
- s.add_dependency(%q<shoulda>, [">= 0"])
55
- s.add_dependency(%q<bundler>, ["~> 1.0.18"])
56
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
57
- s.add_dependency(%q<rcov>, [">= 0"])
58
- s.add_dependency(%q<pry>, [">= 0"])
59
- s.add_dependency(%q<rake-compiler>, ["~> 0.7.6"])
60
- end
61
- else
62
- s.add_dependency(%q<shoulda>, [">= 0"])
63
- s.add_dependency(%q<bundler>, ["~> 1.0.18"])
64
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
65
- s.add_dependency(%q<rcov>, [">= 0"])
66
- s.add_dependency(%q<pry>, [">= 0"])
67
- s.add_dependency(%q<rake-compiler>, ["~> 0.7.6"])
68
- end
69
- end
70
-
data/test/helper.rb DELETED
@@ -1,19 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- #require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib/consistent_company'))
14
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'ext/consistent_company'))
15
- $LOAD_PATH.unshift(File.dirname(__FILE__))
16
-
17
-
18
- class Test::Unit::TestCase
19
- end
@@ -1,79 +0,0 @@
1
- require 'helper'
2
- require 'consistent_company'
3
- require 'pry'
4
-
5
- class TestConsistentCompany < Test::Unit::TestCase
6
-
7
- def test_company_namer
8
- # don't change the calling string
9
- str = ' my test '
10
- company = str.company_namer
11
- assert_equal(' my test ', str)
12
- # empty name
13
- assert_equal("", "".company_namer)
14
- assert_equal("", " ".company_namer)
15
- assert_equal("", "___".company_namer)
16
- # remove leading and trailing space
17
- assert_equal('TEST', " test ".company_namer)
18
- # remove embedded space
19
- assert_equal('TEST', " te st ".company_namer)
20
- # remove Company
21
- assert_equal("MYTEST", "My Test Company".company_namer)
22
- assert_equal("MYCOMPANYTEST", ("MY COMPANY TEST").company_namer)
23
- assert_equal("MYTEST", ("MY TEST COMPANY COMP").company_namer)
24
- # remove leading The
25
- assert_equal("AAA", "The AAA Company".company_namer)
26
- # remove punctuation
27
- assert_equal("TESTERS", %q{The, ?%^* tester's company!}.company_namer)
28
- # a very long name
29
- assert_equal("A"*1000+"NAMEISHERE", (" A"*1000 + 'NAME IS HERE ').company_namer)
30
- # parenthesis matching
31
- assert_equal("BBEE", ("BB(xx)EE").company_namer)
32
- assert_equal("BE", ("B(xx)E").company_namer)
33
- assert_equal("XX", ("(xx)").company_namer)
34
- assert_equal("BB", ("BB(xx").company_namer)
35
- assert_equal("XX", ("(xx").company_namer)
36
- assert_equal("BBMMEE", ("BB(xx)MM(xx)EE").company_namer)
37
- assert_equal("BBEE", ("BB(xx(xx)xx)EE").company_namer)
38
- assert_equal("BBMM", ("BB(xx)MM(xx").company_namer)
39
- assert_equal("BB", ("BB(xx(xx)xx").company_namer)
40
- assert_equal("BB", ("BB(xx(xx").company_namer)
41
-
42
- # handle and &
43
- assert_equal("PRE&POST", ("pre and post").company_namer)
44
- assert_equal("PRE&POST", ("pre & post").company_namer)
45
- assert_equal("PRE&POST", ("&pre and post&").company_namer)
46
- assert_equal("PRE&POST", ("& pre and post &").company_namer)
47
- assert_equal("ANDPRE&POSTAND", ("and pre and post and").company_namer)
48
-
49
- # leading A
50
- assert_equal("ABTEST", ("A B TEST").company_namer)
51
- assert_equal("BTEST", ("A BTEST").company_namer)
52
- assert_equal("APLUSTEST", ("A PLUS TEST").company_namer)
53
- assert_equal("APLUSTEST", ("A + TEST").company_namer)
54
- assert_equal("APLUSTEST", ("A+ TEST").company_namer)
55
-
56
- # common name shortening
57
- assert_equal("TESTCTRCTRCTR", ("Test Center Center Center").company_namer)
58
-
59
- # #singularize
60
- # assert_equal("TESTNAMEHERE", (" Test Names here").company_namer)
61
- # assert_equal("TESTBATTERY", ("Test Batteries").company_namer)
62
-
63
- assert_equal("My Test Advertising Co".company_namer, "MY TEST ADV COMPANY".company_namer)
64
- end
65
-
66
-
67
- # def test_benchmark
68
- # looptimes = 1000000
69
- #
70
- # puts "[BaseString]"
71
- # puts Benchmark::CAPTION
72
- # puts Benchmark.measure {
73
- # base = BaseString.new
74
- # looptimes.times { |n|
75
- # base.make " My Test Company Name (A)"
76
- # }
77
- # }
78
- # end
79
- end