random_string 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +0 -1
- data/.travis.yml +1 -0
- data/Rakefile +5 -1
- data/lib/random_string/main.rb +3 -3
- data/lib/random_string/sample_string.rb +1 -1
- data/lib/random_string/version.rb +1 -1
- data/random_string.gemspec +1 -1
- data/spec/random_string/main_spec.rb +8 -8
- metadata +13 -7
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "random_string/version.rb"
|
3
|
+
require 'rspec/core/rake_task'
|
3
4
|
|
4
5
|
task :install_mah_gem do
|
5
6
|
exec %{
|
6
7
|
gem uninstall random_string;
|
7
8
|
gem build random_string.gemspec;
|
8
9
|
gem install random_string-#{RandomString::VERSION}.gem; }
|
9
|
-
end
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => :spec
|
13
|
+
RSpec::Core::RakeTask.new
|
data/lib/random_string/main.rb
CHANGED
@@ -6,7 +6,7 @@ module RandomString
|
|
6
6
|
|
7
7
|
def generate(pattern)
|
8
8
|
matched_strings = []
|
9
|
-
unmatched_strings = []
|
9
|
+
unmatched_strings = []
|
10
10
|
sample_strings.each do |sample_string|
|
11
11
|
break if matched_strings.size == ResultCount && unmatched_strings.size == ResultCount
|
12
12
|
|
@@ -18,8 +18,8 @@ module RandomString
|
|
18
18
|
end
|
19
19
|
|
20
20
|
{
|
21
|
-
matched_strings
|
22
|
-
unmatched_strings
|
21
|
+
:matched_strings => matched_strings,
|
22
|
+
:unmatched_strings => unmatched_strings
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
data/random_string.gemspec
CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "
|
21
|
+
spec.add_development_dependency "rake"
|
22
22
|
spec.add_development_dependency "rspec"
|
23
23
|
end
|
@@ -17,8 +17,8 @@ describe "RandomString::Main" do
|
|
17
17
|
}
|
18
18
|
let(:expected) do
|
19
19
|
{
|
20
|
-
matched_strings
|
21
|
-
unmatched_strings
|
20
|
+
:matched_strings => strings,
|
21
|
+
:unmatched_strings => []
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
@@ -36,8 +36,8 @@ describe "RandomString::Main" do
|
|
36
36
|
}
|
37
37
|
let(:expected) do
|
38
38
|
{
|
39
|
-
matched_strings
|
40
|
-
unmatched_strings
|
39
|
+
:matched_strings => [],
|
40
|
+
:unmatched_strings => strings
|
41
41
|
}
|
42
42
|
end
|
43
43
|
|
@@ -55,8 +55,8 @@ describe "RandomString::Main" do
|
|
55
55
|
}
|
56
56
|
let(:expected) do
|
57
57
|
{
|
58
|
-
matched_strings
|
59
|
-
unmatched_strings
|
58
|
+
:matched_strings => ['nqtien310@gmail.com'],
|
59
|
+
:unmatched_strings => ['nqtien310']
|
60
60
|
}
|
61
61
|
end
|
62
62
|
|
@@ -82,8 +82,8 @@ describe "RandomString::Main" do
|
|
82
82
|
}
|
83
83
|
let(:expected) do
|
84
84
|
{
|
85
|
-
matched_strings
|
86
|
-
unmatched_strings
|
85
|
+
:matched_strings => ['nqtien310@gmail.com', 'nqtien310@skype.com', 'nqtien310@hotmail.com'],
|
86
|
+
:unmatched_strings => ['nqtien310', 'nqtien3101', 'nqtien3102'],
|
87
87
|
}
|
88
88
|
end
|
89
89
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: random_string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: rake
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,12 +81,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- - ! '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
hash: -2399063124085287276
|
84
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
88
|
none: false
|
86
89
|
requirements:
|
87
90
|
- - ! '>='
|
88
91
|
- !ruby/object:Gem::Version
|
89
92
|
version: '0'
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
hash: -2399063124085287276
|
90
96
|
requirements: []
|
91
97
|
rubyforge_project:
|
92
98
|
rubygems_version: 1.8.25
|