rego-ruby-ext 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- class Symbol
2
- def empty?; false; end
3
- end
1
+ class Symbol
2
+ def empty?; false; end
3
+ end
@@ -1,7 +1,7 @@
1
- class Time
2
- # Adds empty? as instance methods to Time.
3
- def empty?
4
- false
5
- end
6
-
7
- end
1
+ class Time
2
+ # Adds empty? as instance methods to Time.
3
+ def empty?
4
+ false
5
+ end
6
+
7
+ end
@@ -1,83 +1,82 @@
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{rego-ruby-ext}
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 = ["Alex Tkachev"]
12
- s.date = %q{2011-09-20}
13
- s.description = %q{Ruby core extensions that are common for all ReGO projects}
14
- s.email = %q{tkachev.alex@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.md"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- "Gemfile",
23
- "LICENSE.txt",
24
- "README.md",
25
- "Rakefile",
26
- "VERSION",
27
- "init.rb",
28
- "lib/boolean-ext.rb",
29
- "lib/date-ext.rb",
30
- "lib/enumerable-ext.rb",
31
- "lib/hash-ext.rb",
32
- "lib/nil-ext.rb",
33
- "lib/numeric-ext.rb",
34
- "lib/rego-ruby-ext.rb",
35
- "lib/string-ext.rb",
36
- "lib/string-interpolation.rb",
37
- "lib/symbol-ext.rb",
38
- "lib/time-ext.rb",
39
- "rego-ruby-ext.gemspec",
40
- "spec/boolean_spec.rb",
41
- "spec/date_spec.rb",
42
- "spec/enumerable_spec.rb",
43
- "spec/hash_spec.rb",
44
- "spec/nil_spec.rb",
45
- "spec/numeric_spec.rb",
46
- "spec/rego-ruby-ext_spec.rb",
47
- "spec/spec_helper.rb",
48
- "spec/string_interpolation_spec.rb",
49
- "spec/string_spec.rb",
50
- "spec/symbol_spec.rb",
51
- "spec/time_spec.rb"
52
- ]
53
- s.homepage = %q{http://github.com/alextk/rego-ruby-ext}
54
- s.licenses = ["MIT"]
55
- s.require_paths = ["lib"]
56
- s.rubygems_version = %q{1.7.2}
57
- s.summary = %q{Some basic ruby core classes extensions with tests}
58
-
59
- if s.respond_to? :specification_version then
60
- s.specification_version = 3
61
-
62
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
- s.add_development_dependency(%q<rdoc>, [">= 0"])
64
- s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
65
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
66
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
67
- s.add_development_dependency(%q<rcov>, [">= 0"])
68
- else
69
- s.add_dependency(%q<rdoc>, [">= 0"])
70
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
71
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
72
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
73
- s.add_dependency(%q<rcov>, [">= 0"])
74
- end
75
- else
76
- s.add_dependency(%q<rdoc>, [">= 0"])
77
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
78
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
79
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
80
- s.add_dependency(%q<rcov>, [">= 0"])
81
- end
82
- end
83
-
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
+ # stub: rego-ruby-ext 0.0.7 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "rego-ruby-ext"
9
+ s.version = "0.0.7"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Alex Tkachev"]
14
+ s.date = "2015-12-15"
15
+ s.description = "Ruby core extensions that are common for all ReGO projects"
16
+ s.email = "tkachev.alex@gmail.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.md"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".rspec",
24
+ "Gemfile",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "init.rb",
30
+ "lib/boolean-ext.rb",
31
+ "lib/date-ext.rb",
32
+ "lib/enumerable-ext.rb",
33
+ "lib/nil-ext.rb",
34
+ "lib/numeric-ext.rb",
35
+ "lib/rego-ruby-ext.rb",
36
+ "lib/string-ext.rb",
37
+ "lib/string-interpolation.rb",
38
+ "lib/symbol-ext.rb",
39
+ "lib/time-ext.rb",
40
+ "rego-ruby-ext.gemspec",
41
+ "spec/boolean_spec.rb",
42
+ "spec/date_spec.rb",
43
+ "spec/enumerable_spec.rb",
44
+ "spec/nil_spec.rb",
45
+ "spec/numeric_spec.rb",
46
+ "spec/rego-ruby-ext_spec.rb",
47
+ "spec/spec_helper.rb",
48
+ "spec/string_interpolation_spec.rb",
49
+ "spec/string_spec.rb",
50
+ "spec/symbol_spec.rb",
51
+ "spec/time_spec.rb"
52
+ ]
53
+ s.homepage = "http://github.com/alextk/rego-ruby-ext"
54
+ s.licenses = ["MIT"]
55
+ s.rubygems_version = "2.4.6"
56
+ s.summary = "Some basic ruby core classes extensions with tests"
57
+
58
+ if s.respond_to? :specification_version then
59
+ s.specification_version = 4
60
+
61
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
+ s.add_development_dependency(%q<rdoc>, [">= 0"])
63
+ s.add_development_dependency(%q<rspec>, [">= 0"])
64
+ s.add_development_dependency(%q<bundler>, [">= 0"])
65
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
66
+ s.add_development_dependency(%q<rcov>, [">= 0"])
67
+ else
68
+ s.add_dependency(%q<rdoc>, [">= 0"])
69
+ s.add_dependency(%q<rspec>, [">= 0"])
70
+ s.add_dependency(%q<bundler>, [">= 0"])
71
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
72
+ s.add_dependency(%q<rcov>, [">= 0"])
73
+ end
74
+ else
75
+ s.add_dependency(%q<rdoc>, [">= 0"])
76
+ s.add_dependency(%q<rspec>, [">= 0"])
77
+ s.add_dependency(%q<bundler>, [">= 0"])
78
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
79
+ s.add_dependency(%q<rcov>, [">= 0"])
80
+ end
81
+ end
82
+
@@ -1,18 +1,18 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Boolean do
4
-
5
- it "true is a Boolean" do
6
- true.should be_a(Boolean)
7
- end
8
-
9
- it "false is a Boolean" do
10
- false.should be_a(Boolean)
11
- end
12
-
13
- it 'numbers and other stuff are not Boolean' do
14
- [nil, 3, 3.445, 'true', 'false', {:true => 3}].each do |o|
15
- o.should_not be_a(Boolean)
16
- end
17
- end
18
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Boolean do
4
+
5
+ it "true is a Boolean" do
6
+ true.should be_a(Boolean)
7
+ end
8
+
9
+ it "false is a Boolean" do
10
+ false.should be_a(Boolean)
11
+ end
12
+
13
+ it 'numbers and other stuff are not Boolean' do
14
+ [nil, 3, 3.445, 'true', 'false', {:true => 3}].each do |o|
15
+ o.should_not be_a(Boolean)
16
+ end
17
+ end
18
+ end
@@ -1,7 +1,7 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Date do
4
- it "should return false on empty? method call" do
5
- Date.new.should_not be_empty
6
- end
7
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Date do
4
+ it "should return false on empty? method call" do
5
+ Date.new.should_not be_empty
6
+ end
7
+ end
@@ -1,51 +1,51 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Enumerable do
4
- describe "#find_by_" do
5
- before :each do
6
- @full_names = [
7
- {:name=>'Yosi', :last_name=>'Posi'},
8
- {:name=>'Guy', :last_name=>'Shmuely'},
9
- {:name=>'Jack', :last_name=>'Sparrow'}
10
- ]
11
- end
12
-
13
- it 'should find one result' do
14
- result = @full_names.select_by_name_and_last_name('Guy','Shmuely')
15
-
16
- result.size.should == 1
17
- result.first.should == @full_names[1]
18
- end
19
-
20
- it 'should not find any results' do
21
- @full_names.select_by_name('asdf').should be_empty
22
- [].select_by_name('asdf').should be_empty
23
- end
24
- end
25
-
26
- describe "#collect_" do
27
- before :each do
28
- @full_names = [
29
- {:name=>'Yosi', :last_name=>'Posi'},
30
- {:name=>'Guy', :last_name=>'Shmuely'},
31
- {:name=>'Jack', :last_name=>'Sparrow'}
32
- ]
33
- end
34
-
35
- it 'should collect names' do
36
- first_names = @full_names.collect_name
37
-
38
- first_names.size.should == 3
39
- first_names.should include('Yosi', 'Guy', 'Jack')
40
- first_names.should_not include('Baruh')
41
- end
42
-
43
- it 'should collect last_names' do
44
- last_names = @full_names.collect_last_name
45
-
46
- last_names.size.should == 3
47
- last_names.should include('Posi', 'Sparrow', 'Shmuely')
48
- last_names.should_not include('Guy')
49
- end
50
- end
51
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Enumerable do
4
+ describe "#find_by_" do
5
+ before :each do
6
+ @full_names = [
7
+ {:name=>'Yosi', :last_name=>'Posi'},
8
+ {:name=>'Guy', :last_name=>'Shmuely'},
9
+ {:name=>'Jack', :last_name=>'Sparrow'}
10
+ ]
11
+ end
12
+
13
+ it 'should find one result' do
14
+ result = @full_names.select_by_name_and_last_name('Guy','Shmuely')
15
+
16
+ result.size.should == 1
17
+ result.first.should == @full_names[1]
18
+ end
19
+
20
+ it 'should not find any results' do
21
+ @full_names.select_by_name('asdf').should be_empty
22
+ [].select_by_name('asdf').should be_empty
23
+ end
24
+ end
25
+
26
+ describe "#collect_" do
27
+ before :each do
28
+ @full_names = [
29
+ {:name=>'Yosi', :last_name=>'Posi'},
30
+ {:name=>'Guy', :last_name=>'Shmuely'},
31
+ {:name=>'Jack', :last_name=>'Sparrow'}
32
+ ]
33
+ end
34
+
35
+ it 'should collect names' do
36
+ first_names = @full_names.collect_name
37
+
38
+ first_names.size.should == 3
39
+ first_names.should include('Yosi', 'Guy', 'Jack')
40
+ first_names.should_not include('Baruh')
41
+ end
42
+
43
+ it 'should collect last_names' do
44
+ last_names = @full_names.collect_last_name
45
+
46
+ last_names.size.should == 3
47
+ last_names.should include('Posi', 'Sparrow', 'Shmuely')
48
+ last_names.should_not include('Guy')
49
+ end
50
+ end
51
+ end
@@ -1,17 +1,17 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe NilClass do
4
- it "should be empty or blank" do
5
- nil.should be_empty
6
- nil.should be_blank
7
- end
8
-
9
- it 'should not include or any' do
10
- nil.should_not include(23)
11
- nil.should_not be_any
12
- end
13
-
14
- it 'should raise error on to_sym method' do
15
- lambda{ nil.to_sym }.should raise_error
16
- end
17
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe NilClass do
4
+ it "should be empty or blank" do
5
+ nil.should be_empty
6
+ nil.should be_blank
7
+ end
8
+
9
+ it 'should not include or any' do
10
+ nil.should_not include(23)
11
+ nil.should_not be_any
12
+ end
13
+
14
+ it 'should raise error on to_sym method' do
15
+ lambda{ nil.to_sym }.should raise_error
16
+ end
17
+ end
@@ -1,7 +1,7 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Numeric do
4
- it "should return false on empty? method call" do
5
- 5.should_not be_empty
6
- end
7
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Numeric do
4
+ it "should return false on empty? method call" do
5
+ 5.should_not be_empty
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "RegoRubyExt" do
4
-
5
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "RegoRubyExt" do
4
+
5
+ end
@@ -1,13 +1,13 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
- $LOAD_PATH.unshift(File.dirname(__FILE__))
3
- require 'rspec'
4
-
5
- require File.join(File.dirname(__FILE__), "../lib", "rego-ruby-ext")
6
-
7
- # Requires supporting files with custom matchers and macros, etc,
8
- # in ./support/ and its subdirectories.
9
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
-
11
- RSpec.configure do |config|
12
-
13
- end
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+
5
+ require File.join(File.dirname(__FILE__), "../lib", "rego-ruby-ext")
6
+
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
+
11
+ RSpec.configure do |config|
12
+
13
+ end
@@ -1,31 +1,31 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe StringInterpolation do
4
- describe "#interpolate" do
5
- it 'should replace %{} variables' do
6
- str = 'my var1=%{var1} and var2 is %{var2}.'
7
- StringInterpolation.interpolate(str, :var1 => 'one', :var2 => 'foo').should == 'my var1=one and var2 is foo.'
8
- end
9
-
10
- it 'should replace %<> variables' do
11
- str = 'my var1=%<var1>d and var2 is %<var2>s.'
12
- StringInterpolation.interpolate(str, :var1 => 5.2, :var2 => 'foo').should == 'my var1=5 and var2 is foo.'
13
- end
14
-
15
- it 'should raise error if variable value not found and strategy is :raise' do
16
- str = 'my var1=%<var1>d and var2 is %<var2>s'
17
- lambda{ StringInterpolation.interpolate(str, {:var1 => 5.2}, {:not_found_strategy => :raise}) }.should raise_error(ArgumentError)
18
- end
19
-
20
- it 'should leave variable intact if value not found (default behaivour)' do
21
- str = 'my var1=%{var1} and var2 is %<var2>d'
22
- StringInterpolation.interpolate(str, {}).should == 'my var1=%{var1} and var2 is %<var2>d'
23
- end
24
-
25
- it 'should hide variable if variable value not found and strategy is :hide' do
26
- str = 'my var1=%{var1} and var2 is %<var2>d.'
27
- StringInterpolation.interpolate(str, {}, {:not_found_strategy => :hide}).should == 'my var1= and var2 is .'
28
- end
29
- end
30
-
31
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe StringInterpolation do
4
+ describe "#interpolate" do
5
+ it 'should replace %{} variables' do
6
+ str = 'my var1=%{var1} and var2 is %{var2}.'
7
+ StringInterpolation.interpolate(str, :var1 => 'one', :var2 => 'foo').should == 'my var1=one and var2 is foo.'
8
+ end
9
+
10
+ it 'should replace %<> variables' do
11
+ str = 'my var1=%<var1>d and var2 is %<var2>s.'
12
+ StringInterpolation.interpolate(str, :var1 => 5.2, :var2 => 'foo').should == 'my var1=5 and var2 is foo.'
13
+ end
14
+
15
+ it 'should raise error if variable value not found and strategy is :raise' do
16
+ str = 'my var1=%<var1>d and var2 is %<var2>s'
17
+ lambda{ StringInterpolation.interpolate(str, {:var1 => 5.2}, {:not_found_strategy => :raise}) }.should raise_error(ArgumentError)
18
+ end
19
+
20
+ it 'should leave variable intact if value not found (default behaivour)' do
21
+ str = 'my var1=%{var1} and var2 is %<var2>d'
22
+ StringInterpolation.interpolate(str, {}).should == 'my var1=%{var1} and var2 is %<var2>d'
23
+ end
24
+
25
+ it 'should hide variable if variable value not found and strategy is :hide' do
26
+ str = 'my var1=%{var1} and var2 is %<var2>d.'
27
+ StringInterpolation.interpolate(str, {}, {:not_found_strategy => :hide}).should == 'my var1= and var2 is .'
28
+ end
29
+ end
30
+
31
+ end