omega-tariffs-custom 0.1.2 → 0.1.3

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.
data/Manifest CHANGED
@@ -2,6 +2,7 @@ Manifest
2
2
  README.rdoc
3
3
  Rakefile
4
4
  lib/omega-tariffs-custom.rb
5
+ spec/allow_tariff_spec.rb
5
6
  spec/common_tariff_spec.rb
6
7
  spec/lib/active_record_classes_stub.rb
7
8
  spec/lib/init.rb
@@ -9,6 +10,7 @@ spec/lib/spec_helper.rb
9
10
  spec/morning_packet_tariff_spec.rb
10
11
  spec/night_packet_holiday_tariff_spec.rb
11
12
  spec/night_packet_weekday_tariff_spec.rb
13
+ yml/allow_tariff.yml
12
14
  yml/common_tariff.yml
13
15
  yml/morning_packet_tariff.yml
14
16
  yml/night_packet_holiday_tariff.yml
data/Rakefile CHANGED
@@ -2,13 +2,13 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('omega-tariffs-custom', '0.1.2') do |p|
5
+ Echoe.new('omega-tariffs-custom', '0.1.3') do |p|
6
6
  p.description = "Omega Sector custom tariffs gem"
7
7
  p.url = "http://uniqsystems.ru"
8
8
  p.author = "Uniq Systems"
9
9
  p.email = "ivan@uniqsystems.ru"
10
10
  p.ignore_pattern = ["tmp/*", "script/*"]
11
- p.runtime_dependencies = p.development_dependencies = ["omega-tariffs-base >=0.1.5"]
11
+ p.runtime_dependencies = p.development_dependencies = ["omega-tariffs-base >=0.1.6"]
12
12
  end
13
13
 
14
14
  Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{omega-tariffs-custom}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
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"]
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.description = %q{Omega Sector custom tariffs gem}
11
11
  s.email = %q{ivan@uniqsystems.ru}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/omega-tariffs-custom.rb"]
13
- s.files = ["Manifest", "README.rdoc", "Rakefile", "lib/omega-tariffs-custom.rb", "spec/common_tariff_spec.rb", "spec/lib/active_record_classes_stub.rb", "spec/lib/init.rb", "spec/lib/spec_helper.rb", "spec/morning_packet_tariff_spec.rb", "spec/night_packet_holiday_tariff_spec.rb", "spec/night_packet_weekday_tariff_spec.rb", "yml/common_tariff.yml", "yml/morning_packet_tariff.yml", "yml/night_packet_holiday_tariff.yml", "yml/night_packet_weekday_tariff.yml", "omega-tariffs-custom.gemspec"]
13
+ s.files = ["Manifest", "README.rdoc", "Rakefile", "lib/omega-tariffs-custom.rb", "spec/allow_tariff_spec.rb", "spec/common_tariff_spec.rb", "spec/lib/active_record_classes_stub.rb", "spec/lib/init.rb", "spec/lib/spec_helper.rb", "spec/morning_packet_tariff_spec.rb", "spec/night_packet_holiday_tariff_spec.rb", "spec/night_packet_weekday_tariff_spec.rb", "yml/allow_tariff.yml", "yml/common_tariff.yml", "yml/morning_packet_tariff.yml", "yml/night_packet_holiday_tariff.yml", "yml/night_packet_weekday_tariff.yml", "omega-tariffs-custom.gemspec"]
14
14
  s.homepage = %q{http://uniqsystems.ru}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Omega-tariffs-custom", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
@@ -23,14 +23,14 @@ Gem::Specification.new do |s|
23
23
  s.specification_version = 3
24
24
 
25
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
27
- s.add_development_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
26
+ s.add_runtime_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
27
+ s.add_development_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
28
28
  else
29
- s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
30
- s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
29
+ s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
30
+ s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
31
31
  end
32
32
  else
33
- s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
34
- s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.5"])
33
+ s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
34
+ s.add_dependency(%q<omega-tariffs-base>, [">= 0.1.6"])
35
35
  end
36
36
  end
@@ -0,0 +1,30 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'init'))
2
+
3
+ describe "The most liberal tarif" do
4
+ before do
5
+ tarif_start = Time.local(2010, 8, 1, 0, 0, 0)
6
+ @filter = UniqSysOmega::CustomTariffs::CustomTariffBuilder.build :allow_tariff, 1
7
+ end
8
+
9
+ it "should allow everything" do
10
+ Timecop.freeze(Time.local(2010, 8, 1, 12, 13, 14)) do
11
+ @filter.permitted?(1, 2).should == true
12
+ @filter.start_permitted?(1, 2).should == true
13
+ end
14
+
15
+ Timecop.freeze(Time.local(2013, 7, 3, 18, 21, 14)) do
16
+ @filter.permitted?(1, 2).should == true
17
+ @filter.start_permitted?(1, 2).should == true
18
+ end
19
+ end
20
+
21
+ it "should calculate any cost as zero" do
22
+ @filter.calculate_cost(1, 2, Time.now, 1).should == 0
23
+ @filter.calculate_cost(1, 2, Time.now, 123).should == 0
24
+ @filter.calculate_cost(1, 2, Time.now, 67000).should == 0
25
+ end
26
+
27
+ it "should process any transaction" do
28
+ @filter.process_activity(nil, nil).should == true
29
+ end
30
+ end
@@ -0,0 +1,4 @@
1
+ ---
2
+ :klass: AllowFilter
3
+ :settings:
4
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omega-tariffs-custom
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Uniq Systems
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 17
29
+ hash: 23
30
30
  segments:
31
31
  - 0
32
32
  - 1
33
- - 5
34
- version: 0.1.5
33
+ - 6
34
+ version: 0.1.6
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 17
45
+ hash: 23
46
46
  segments:
47
47
  - 0
48
48
  - 1
49
- - 5
50
- version: 0.1.5
49
+ - 6
50
+ version: 0.1.6
51
51
  type: :development
52
52
  version_requirements: *id002
53
53
  description: Omega Sector custom tariffs gem
@@ -64,6 +64,7 @@ files:
64
64
  - README.rdoc
65
65
  - Rakefile
66
66
  - lib/omega-tariffs-custom.rb
67
+ - spec/allow_tariff_spec.rb
67
68
  - spec/common_tariff_spec.rb
68
69
  - spec/lib/active_record_classes_stub.rb
69
70
  - spec/lib/init.rb
@@ -71,6 +72,7 @@ files:
71
72
  - spec/morning_packet_tariff_spec.rb
72
73
  - spec/night_packet_holiday_tariff_spec.rb
73
74
  - spec/night_packet_weekday_tariff_spec.rb
75
+ - yml/allow_tariff.yml
74
76
  - yml/common_tariff.yml
75
77
  - yml/morning_packet_tariff.yml
76
78
  - yml/night_packet_holiday_tariff.yml