omega-tariffs-base 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +2 -0
- data/Rakefile +1 -1
- data/lib/allow_filter.rb +23 -0
- data/lib/omega-tariffs-base.rb +1 -1
- data/omega-tariffs-base.gemspec +3 -3
- data/spec/allow_filter_spec.rb +23 -0
- data/spec/deny_filter_spec.rb +2 -2
- metadata +6 -3
data/Manifest
CHANGED
@@ -2,6 +2,7 @@ CHANGELOG
|
|
2
2
|
Manifest
|
3
3
|
README.rdoc
|
4
4
|
Rakefile
|
5
|
+
lib/allow_filter.rb
|
5
6
|
lib/computer_class_filter.rb
|
6
7
|
lib/deny_filter.rb
|
7
8
|
lib/filter.rb
|
@@ -14,6 +15,7 @@ lib/settings.rb
|
|
14
15
|
lib/single_time_filter.rb
|
15
16
|
lib/tarif_builder.rb
|
16
17
|
lib/weekday_filter.rb
|
18
|
+
spec/allow_filter_spec.rb
|
17
19
|
spec/complex_tarif_spec.rb
|
18
20
|
spec/computer_class_filter_spec.rb
|
19
21
|
spec/deny_filter_spec.rb
|
data/Rakefile
CHANGED
data/lib/allow_filter.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module UniqSysOmega
|
2
|
+
module Tariffs
|
3
|
+
|
4
|
+
class AllowFilter < Filter
|
5
|
+
def start_permitted?(computer_id, login_id, options={})
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
def permitted?(computer_id, login_id, options={})
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
13
|
+
def calculate_cost(computer_id, login_id, started_at, amount, options={})
|
14
|
+
0
|
15
|
+
end
|
16
|
+
|
17
|
+
def process_activity(unprocessed_activity, ft, options={})
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
data/lib/omega-tariffs-base.rb
CHANGED
@@ -7,7 +7,7 @@ class Integer
|
|
7
7
|
end
|
8
8
|
|
9
9
|
# load libraries
|
10
|
-
[ :settings, :regioned_calculation, :tarif_builder, :filter, :deny_filter, :weekday_filter,
|
10
|
+
[ :settings, :regioned_calculation, :tarif_builder, :filter, :allow_filter, :deny_filter, :weekday_filter,
|
11
11
|
:rate_filter, :repeating_filter, :single_time_filter, :computer_class_filter, :packet_filter ].each do |lib|
|
12
12
|
require File.join(File.dirname(__FILE__), lib.to_s)
|
13
13
|
end
|
data/omega-tariffs-base.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{omega-tariffs-base}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Uniq Systems"]
|
9
9
|
s.date = %q{2010-09-23}
|
10
10
|
s.description = %q{Omega Sector base tariffs}
|
11
11
|
s.email = %q{ivan@uniqsystems.ru}
|
12
|
-
s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "lib/computer_class_filter.rb", "lib/deny_filter.rb", "lib/filter.rb", "lib/omega-tariffs-base.rb", "lib/packet_filter.rb", "lib/rate_filter.rb", "lib/regioned_calculation.rb", "lib/repeating_filter.rb", "lib/settings.rb", "lib/single_time_filter.rb", "lib/tarif_builder.rb", "lib/weekday_filter.rb"]
|
13
|
-
s.files = ["CHANGELOG", "Manifest", "README.rdoc", "Rakefile", "lib/computer_class_filter.rb", "lib/deny_filter.rb", "lib/filter.rb", "lib/omega-tariffs-base.rb", "lib/packet_filter.rb", "lib/rate_filter.rb", "lib/regioned_calculation.rb", "lib/repeating_filter.rb", "lib/settings.rb", "lib/single_time_filter.rb", "lib/tarif_builder.rb", "lib/weekday_filter.rb", "spec/complex_tarif_spec.rb", "spec/computer_class_filter_spec.rb", "spec/deny_filter_spec.rb", "spec/filter_spec.rb", "spec/lib/active_record_classes_stub.rb", "spec/lib/init.rb", "spec/lib/spec_helper.rb", "spec/packet_filter_spec.rb", "spec/rate_filter_spec.rb", "spec/repeating_filter_spec.rb", "spec/settings_spec.rb", "spec/single_time_filter_spec.rb", "spec/tarif_builder_spec.rb", "spec/weekday_filter_spec.rb", "omega-tariffs-base.gemspec"]
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "lib/allow_filter.rb", "lib/computer_class_filter.rb", "lib/deny_filter.rb", "lib/filter.rb", "lib/omega-tariffs-base.rb", "lib/packet_filter.rb", "lib/rate_filter.rb", "lib/regioned_calculation.rb", "lib/repeating_filter.rb", "lib/settings.rb", "lib/single_time_filter.rb", "lib/tarif_builder.rb", "lib/weekday_filter.rb"]
|
13
|
+
s.files = ["CHANGELOG", "Manifest", "README.rdoc", "Rakefile", "lib/allow_filter.rb", "lib/computer_class_filter.rb", "lib/deny_filter.rb", "lib/filter.rb", "lib/omega-tariffs-base.rb", "lib/packet_filter.rb", "lib/rate_filter.rb", "lib/regioned_calculation.rb", "lib/repeating_filter.rb", "lib/settings.rb", "lib/single_time_filter.rb", "lib/tarif_builder.rb", "lib/weekday_filter.rb", "spec/allow_filter_spec.rb", "spec/complex_tarif_spec.rb", "spec/computer_class_filter_spec.rb", "spec/deny_filter_spec.rb", "spec/filter_spec.rb", "spec/lib/active_record_classes_stub.rb", "spec/lib/init.rb", "spec/lib/spec_helper.rb", "spec/packet_filter_spec.rb", "spec/rate_filter_spec.rb", "spec/repeating_filter_spec.rb", "spec/settings_spec.rb", "spec/single_time_filter_spec.rb", "spec/tarif_builder_spec.rb", "spec/weekday_filter_spec.rb", "omega-tariffs-base.gemspec"]
|
14
14
|
s.homepage = %q{http://uniqsys.ru/}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Omega-tariffs-base", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'init'))
|
2
|
+
|
3
|
+
describe "AllowFilter" do
|
4
|
+
before do
|
5
|
+
@filter = AllowFilter.new(stub(), 0)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should allow any service start" do
|
9
|
+
@filter.start_permitted?(1,2).should == true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should allow any service conducting its work" do
|
13
|
+
@filter.permitted?(1,2).should == true
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return zero price for any activity" do
|
17
|
+
@filter.calculate_cost(1, 2, 3, 4).should == 0
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should allow any activity processing" do
|
21
|
+
@filter.process_activity(stub(), stub()).should == true
|
22
|
+
end
|
23
|
+
end
|
data/spec/deny_filter_spec.rb
CHANGED
@@ -6,11 +6,11 @@ describe "DenyFilter" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should deny any service start" do
|
9
|
-
@filter.start_permitted?(1,2
|
9
|
+
@filter.start_permitted?(1,2).should == false
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should deny any service conducting its work" do
|
13
|
-
@filter.permitted?(1,2
|
13
|
+
@filter.permitted?(1,2).should == false
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return maximum price for any activity" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omega-tariffs-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Uniq Systems
|
@@ -59,6 +59,7 @@ extensions: []
|
|
59
59
|
extra_rdoc_files:
|
60
60
|
- CHANGELOG
|
61
61
|
- README.rdoc
|
62
|
+
- lib/allow_filter.rb
|
62
63
|
- lib/computer_class_filter.rb
|
63
64
|
- lib/deny_filter.rb
|
64
65
|
- lib/filter.rb
|
@@ -76,6 +77,7 @@ files:
|
|
76
77
|
- Manifest
|
77
78
|
- README.rdoc
|
78
79
|
- Rakefile
|
80
|
+
- lib/allow_filter.rb
|
79
81
|
- lib/computer_class_filter.rb
|
80
82
|
- lib/deny_filter.rb
|
81
83
|
- lib/filter.rb
|
@@ -88,6 +90,7 @@ files:
|
|
88
90
|
- lib/single_time_filter.rb
|
89
91
|
- lib/tarif_builder.rb
|
90
92
|
- lib/weekday_filter.rb
|
93
|
+
- spec/allow_filter_spec.rb
|
91
94
|
- spec/complex_tarif_spec.rb
|
92
95
|
- spec/computer_class_filter_spec.rb
|
93
96
|
- spec/deny_filter_spec.rb
|