string_utility_belt 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,24 @@
1
+ # 0.4.0
2
+ ## Summary: New dependency
3
+ * Adicionado <a href="https://github.com/serradura/stringub-commons">stringub-commons</a> como dependência do projeto.
4
+ - Adicionam os métodos words e unique_spaces (que entrou no lugar do simple_space).
5
+ * Testes foram refatorados fazendo com que suas dependências fossem isoladas.
6
+
1
7
  # 0.3.3
2
8
  ## Summary: Docs
3
9
  * Criado change log para listar as principais alterações entre cada versão.
4
10
  * Criado ROADMAP para informar os planos para a gem.
5
- * Adicionado warnings para alertar quais métodos que estarão depreciados na próxima versão, abaix está a listagem deles:
6
- StringUtilityBelt::RegexMe::Builders.regex_me_to_search_ruby will be deprecated in the next_version
7
- StringUtilityBelt::RegexMe::Builders.regex_me_to_search_mysql will be deprecated in the next_version
8
- StringUtilityBelt::General.have_this_words? will be deprecated in the next_version
9
- StringUtilityBelt::General.not_have_this_words? will be deprecated in the next_version
10
- StringUtilityBelt::MatchRank.total_frequency_by will be deprecated in the next_version
11
- StringUtilityBelt::MatchRank.words_frequency_by will be deprecated in the next_version
12
- StringUtilityBelt::MatchRank.match_and_score_by will be deprecated in the next_version
13
- StringUtilityBelt::Entities.decode_entities_and_cleaner will be deprecated in the next_version
11
+ * Adicionado warnings para alertar quais métodos que estarão depreciados na próxima versão, abaixo está a listagem dos métodos que serão depreciados:
12
+ - simple_space
13
+ - simple_space!
14
+ - regex_me_to_search_ruby
15
+ - regex_me_to_search_mysql
16
+ - have_this_words
17
+ - not_have_this_words?
18
+ - total_frequency_by
19
+ - words_frequency_by
20
+ - match_and_score_by
21
+ - decode_entities_and_cleaner
14
22
 
15
23
  # 0.3.2
16
24
  ## Summary: Refactory
@@ -26,7 +34,7 @@ para instala-lá juntamente com o string_utility_belt
26
34
  * Todos os módulos foram refatorados
27
35
  * Também foram criada classes internas para encapsular a lógica nas libs General e MatchRank (Começarm planos para serem uma gem a parte).
28
36
 
29
- # > 0.2.5
37
+ # 0.2.5
30
38
  ## Summary: Test coverage
31
39
  * 100% de cobertura de teste
32
40
  * E pequenas refatorações foram feitas ao longo do processo.
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- string_utility_belt (0.2.3)
4
+ string_utility_belt (0.3.3)
5
+ htmlentities (= 4.3.0)
6
+ stringub-commons
5
7
 
6
8
  GEM
7
9
  remote: http://rubygems.org/
@@ -17,6 +19,7 @@ GEM
17
19
  ruby-debug-base (~> 0.10.4.0)
18
20
  ruby-debug-base (0.10.4)
19
21
  linecache (>= 0.3)
22
+ stringub-commons (0.0.2)
20
23
 
21
24
  PLATFORMS
22
25
  ruby
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ end
27
27
 
28
28
  namespace :test do
29
29
  Rake::TestTask.new do |t|
30
- t.test_files = FileList['test/**/*.rb']
30
+ t.test_files = FileList['test/test_suite.rb']
31
31
  t.name = 'all'
32
32
  end
33
33
  end
@@ -1,5 +1,6 @@
1
1
  require 'string_utility_belt/version'
2
2
 
3
+ require 'string_utility_belt/commons'
3
4
  require 'string_utility_belt/regex_me'
4
5
  require 'string_utility_belt/general'
5
6
  require 'string_utility_belt/match_rank'
@@ -0,0 +1 @@
1
+ require 'stringub-commons'
@@ -45,26 +45,6 @@ module StringUtilityBelt
45
45
  end
46
46
  end
47
47
 
48
- WORD_PATTERN = /\w[\w\'\-]*/
49
- ANY_SPACE_PATTERN = /\s+/
50
-
51
- SIMPLE_SPACE = " "
52
-
53
- def words
54
- self.scan(WORD_PATTERN)
55
- end
56
-
57
-
58
- warn "StringUtilityBelt:General.simple_space will be deprecated in the next_version"
59
- def simple_space
60
- self.gsub(ANY_SPACE_PATTERN, SIMPLE_SPACE)
61
- end
62
-
63
- warn "StringUtilityBelt:General.simple_space! will be deprecated in the next_version"
64
- def simple_space!
65
- self.gsub!(ANY_SPACE_PATTERN, SIMPLE_SPACE)
66
- end
67
-
68
48
  warn "StringUtilityBelt::General.have_this_words? will be deprecated in the next_version"
69
49
  def have_this_words?(words_to_match, options = nil)
70
50
  i = GENERAL.new(self)
@@ -89,7 +89,7 @@ module RegexMe
89
89
 
90
90
  if @options[:exact_phrase]
91
91
  regexp = \
92
- set_latin_variations(@string.strip.simple_space) \
92
+ set_latin_variations(@string.strip.unique_spaces) \
93
93
  .gsub(/\s/, WORDS_INTERVAL_PATTERN_FOR_EXACT_PHRASES)
94
94
 
95
95
  @regexp = \
@@ -1,3 +1,3 @@
1
1
  module StringUtilityBelt
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
  s.add_dependency("htmlentities", "4.3.0")
21
+ s.add_dependency("stringub-commons")
21
22
  end
@@ -0,0 +1,10 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ class CommonsTest < Test::Unit::TestCase
4
+
5
+ def test_should_contains_commons_module
6
+ require File.join('string_utility_belt', 'commons')
7
+ assert Stringub.constants.include?("Commons")
8
+ end
9
+
10
+ end
@@ -1,4 +1,5 @@
1
1
  require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+ require File.join('string_utility_belt', 'entities')
2
3
 
3
4
  class EntitiesTest < Test::Unit::TestCase
4
5
 
@@ -1,57 +1,16 @@
1
1
  require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+ require File.join('string_utility_belt', 'commons')
3
+ require File.join('string_utility_belt', 'regex_me')
4
+ require File.join('string_utility_belt', 'general')
2
5
 
3
6
  class GeneralTest < Test::Unit::TestCase
4
7
 
5
8
  def setup
6
- @spaces_and_some_text = " \n \r \t\r\n foo \t bar "
7
-
8
9
  @text = %q{Texto de teste!
9
10
  Esta classe deverá fazer a busca por uma ou um grupo de palavras
10
11
  em um texto e retornar um rank com a quantidade identificada.}
11
12
  end
12
13
 
13
- def test_should_return_a_single_word_in_array
14
- assert_equal %w{Hello}, "Hello".words
15
- end
16
-
17
- def test_should_return_all_words_as_element_in_array
18
- assert_equal ["foo-foo", "bar's", "bar"], "foo-foo, bar's. bar!".words
19
- end
20
-
21
- def test_should_replace_a_sequence_of_space_per_a_unique_space
22
- assert_equal " foo bar ", @spaces_and_some_text.simple_space
23
- end
24
-
25
- def test_should_replace_the_left_spaces_by_only_one
26
- assert_equal ' \o/!'.simple_space, ' \o/!'
27
- end
28
-
29
- def test_should_replace_the_right_spaces_by_only_one
30
- assert_equal '\o/! '.simple_space, '\o/! '
31
- end
32
-
33
- def test_should_be_the_same_result_after_calling_the_method
34
- string = @spaces_and_some_text.dup
35
- assert_equal string, " \n \r \t\r\n foo \t bar "
36
- end
37
-
38
- def test_should_return_the_same_text_if_nothing_changed
39
- assert_equal "Hello", "Hello".simple_space
40
- end
41
-
42
-
43
- #describe #simple_space!
44
- def test_should_not_generate_a_new_object
45
- @spaces_and_some_text.simple_space!
46
-
47
- assert_not_same ' foo bar ', @spaces_and_some_text
48
- end
49
-
50
- def test_should_return_nil_if_nothing_changed
51
- assert_nil "Hello".simple_space!
52
- end
53
-
54
-
55
14
  # describe #have_this_words?
56
15
  def test_should_be_true_if_find_all_of_the_text_fragments
57
16
  assert @text.have_this_words?("busca ran".words)
@@ -1,4 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+ require File.join('string_utility_belt', 'commons')
3
+ require File.join('string_utility_belt', 'regex_me')
4
+ require File.join('string_utility_belt', 'match_rank')
2
5
 
3
6
  class MatchRankTest < Test::Unit::TestCase
4
7
 
@@ -1,4 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
2
+ require File.join('string_utility_belt', 'commons')
3
+ require File.join('string_utility_belt', 'regex_me')
2
4
 
3
5
  class RegexMeToSearchTest < Test::Unit::TestCase
4
6
 
@@ -1,6 +1,8 @@
1
1
  # coding: utf-8
2
2
 
3
3
  require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
4
+ require File.join('string_utility_belt', 'commons')
5
+ require File.join('string_utility_belt', 'regex_me')
4
6
 
5
7
  class RegexMeHelperTest < Test::Unit::TestCase
6
8
 
@@ -1,4 +1,5 @@
1
1
  require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+ require File.join('string_utility_belt', 'tags')
2
3
 
3
4
  class TagsTest < Test::Unit::TestCase
4
5
 
@@ -1,5 +1,8 @@
1
-
2
1
  require 'rubygems' if RUBY_VERSION < "1.9"
3
2
  require 'test/unit'
4
3
  require 'ruby-debug'
5
- require 'string_utility_belt'
4
+
5
+ # Module created to verify that new classes were added to it
6
+ module Stringub
7
+ end
8
+
@@ -0,0 +1,9 @@
1
+ require File.join('test', 'test_helper')
2
+ require File.join('test', 'string_utility_belt', 'commons_test')
3
+ require File.join('test', 'string_utility_belt', 'regex_me', 'builders_test')
4
+ require File.join('test', 'string_utility_belt', 'regex_me', 'helper_test')
5
+ require File.join('test', 'string_utility_belt', 'tags_test')
6
+ require File.join('test', 'string_utility_belt', 'entities_test')
7
+ require File.join('test', 'string_utility_belt', 'general_test')
8
+ require File.join('test', 'string_utility_belt', 'match_rank_test')
9
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_utility_belt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 3
10
- version: 0.3.3
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rodrigo Serradura
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-26 00:00:00 -03:00
19
- default_executable:
18
+ date: 2011-07-28 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: htmlentities
@@ -34,6 +33,20 @@ dependencies:
34
33
  version: 4.3.0
35
34
  type: :runtime
36
35
  version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: stringub-commons
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ type: :runtime
49
+ version_requirements: *id002
37
50
  description: Adds new features for String objects.
38
51
  email:
39
52
  - rserradura@gmail.com
@@ -52,6 +65,7 @@ files:
52
65
  - ROADMAP.markdown
53
66
  - Rakefile
54
67
  - lib/string_utility_belt.rb
68
+ - lib/string_utility_belt/commons.rb
55
69
  - lib/string_utility_belt/entities.rb
56
70
  - lib/string_utility_belt/general.rb
57
71
  - lib/string_utility_belt/match_rank.rb
@@ -63,6 +77,7 @@ files:
63
77
  - lib/string_utility_belt/tags.rb
64
78
  - lib/string_utility_belt/version.rb
65
79
  - string_utility_belt.gemspec
80
+ - test/string_utility_belt/commons_test.rb
66
81
  - test/string_utility_belt/entities_test.rb
67
82
  - test/string_utility_belt/general_test.rb
68
83
  - test/string_utility_belt/match_rank_test.rb
@@ -70,7 +85,7 @@ files:
70
85
  - test/string_utility_belt/regex_me/helper_test.rb
71
86
  - test/string_utility_belt/tags_test.rb
72
87
  - test/test_helper.rb
73
- has_rdoc: true
88
+ - test/test_suite.rb
74
89
  homepage: ""
75
90
  licenses: []
76
91
 
@@ -100,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
115
  requirements: []
101
116
 
102
117
  rubyforge_project: string_utility_belt
103
- rubygems_version: 1.6.2
118
+ rubygems_version: 1.8.2
104
119
  signing_key:
105
120
  specification_version: 3
106
121
  summary: Useful methods to handle strings