erp_rules 3.0.0 → 3.0.1
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/app/models/customer_txn_context.rb +11 -0
- data/app/models/environment_txn_context.rb +11 -0
- data/app/models/search_txn_context.rb +11 -0
- data/lib/erp_rules/engine.rb +14 -0
- data/lib/erp_rules/extensions/active_record/acts_as_business_rule.rb +30 -0
- data/lib/erp_rules/extensions/active_record/acts_as_search_filter.rb +28 -0
- data/lib/erp_rules/extensions/active_record/has_rule_context.rb +31 -0
- data/lib/erp_rules/extensions.rb +3 -0
- data/lib/erp_rules/rules_engine/context.rb +59 -31
- data/lib/erp_rules/rules_engine/context_builder.rb +70 -0
- data/lib/erp_rules/rules_engine/pricing_engine.rb +18 -0
- data/lib/erp_rules/rules_engine/ruleby/engine.rb +24 -0
- data/lib/erp_rules/rules_engine/rules_facade.rb +42 -42
- data/lib/erp_rules/rules_engine.rb +4 -1
- data/lib/erp_rules/search/search_base.rb +64 -0
- data/lib/erp_rules/version.rb +7 -1
- data/lib/erp_rules.rb +6 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +44 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/spec.rb +27 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/lib/erp_rules/extensions/active_record/acts_as_business_rule_spec.rb +20 -0
- data/spec/lib/erp_rules/extensions/active_record/acts_as_search_filter_spec.rb +12 -0
- data/spec/lib/erp_rules/extensions/active_record/has_rule_context_spec.rb +29 -0
- data/spec/lib/erp_rules/rules_engine/context_builder_spec.rb +5 -0
- data/spec/lib/erp_rules/rules_engine/context_spec.rb +64 -0
- data/spec/lib/erp_rules/rules_engine/ruleby/engine_spec.rb +26 -0
- data/spec/lib/erp_rules/rules_engine/rules_facade_spec.rb +29 -0
- data/spec/spec_helper.rb +60 -0
- metadata +104 -16
@@ -0,0 +1,8 @@
|
|
1
|
+
# Warning: The database defined as "test" will be erased and
|
2
|
+
# re-generated from your development database when you run "rake".
|
3
|
+
# Do not set this db to the same as development or production.
|
4
|
+
spec:
|
5
|
+
adapter: sqlite3
|
6
|
+
database: db/spec.sqlite3
|
7
|
+
pool: 5
|
8
|
+
timeout: 5000
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Do not compress assets
|
26
|
+
config.assets.compress = false
|
27
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Dummy::Application.config.secret_token = 'ae0d58840f73a49e40850c9d815a6a135e169865cdb8721cec7f335a738af09f3483de0f99d7c131f8fdecf2d8b508f8fd5e2e33c8d0565dcc9030eadb227695'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActionController::Base.wrap_parameters :format => [:json]
|
8
|
+
|
9
|
+
# Disable root element in JSON by default.
|
10
|
+
if defined?(ActiveRecord)
|
11
|
+
ActiveRecord::Base.include_root_in_json = false
|
12
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ErpRules::Extensions::ActiveRecord::ActsAsBusinessRule do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
TestClass = Class.new(ActiveRecord::Base) do
|
7
|
+
acts_as_business_rule
|
8
|
+
set_table_name "role_types"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should provide an is_match? method to an ActiveRecord::Base class" do
|
13
|
+
@test_obj = TestClass.new
|
14
|
+
@test_obj.respond_to?(:is_match?).should eq(true)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should provide a get_matches! method as a singleton" do
|
18
|
+
TestClass.respond_to?(:get_matches!).should eq(true)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ErpRules::Extensions::ActiveRecord::HasRuleContext do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
TestClass = Class.new(ActiveRecord::Base) do
|
7
|
+
has_rule_context
|
8
|
+
set_table_name "role_types"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should provide a get_context method to an ActiveRecord::Base class" do
|
13
|
+
|
14
|
+
@test_obj = TestClass.new
|
15
|
+
@test_obj.respond_to?(:get_context).should eq(true)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should return a hash with the attributes of the model" do
|
19
|
+
|
20
|
+
@obj = TestClass.new
|
21
|
+
@obj.internal_identifier = "test_obj"
|
22
|
+
@obj.save
|
23
|
+
|
24
|
+
@result = @obj.get_context()
|
25
|
+
@result.has_key?("internal_identifier").should eq(true)
|
26
|
+
@result["internal_identifier"].should eq("test_obj")
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ErpRules::RulesEngine::Context do
|
4
|
+
|
5
|
+
it "should add item and be able to retrieve it" do
|
6
|
+
|
7
|
+
subject[:test_val] = "test"
|
8
|
+
|
9
|
+
subject[:test_val].should eq("test")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should handle float values correctly" do
|
13
|
+
|
14
|
+
subject[:test_val] = 179.5
|
15
|
+
|
16
|
+
subject[:test_val].should eq(179.5)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should find a hash item as if it were a method on an object" do
|
20
|
+
|
21
|
+
subject[:test_val] = "test"
|
22
|
+
|
23
|
+
subject.test_val.should eq("test")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should set the value if the method name passed has an '='" do
|
27
|
+
|
28
|
+
subject.send("test_val=", "test")
|
29
|
+
|
30
|
+
subject.test_val.should eq("test")
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should handle nested items" do
|
34
|
+
|
35
|
+
subject[:test_key1] = {:test_key2 => "blah1",
|
36
|
+
:test_key3 => "blah2"}
|
37
|
+
|
38
|
+
subject.test_key1.test_key2.should eq("blah1")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should convert all hashes to Context objects when initalized with a hash" do
|
42
|
+
|
43
|
+
data = {:search_ctxt =>
|
44
|
+
{:offer_ctxt =>
|
45
|
+
{:valid_offers => [1,2],
|
46
|
+
:invalid_offers => [3]
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
ctx = ErpRules::RulesEngine::Context.new(data)
|
52
|
+
|
53
|
+
ctx.search_ctxt.offer_ctxt.valid_offers.should include(1)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should covert hashes to Context obj's when set via method syntax" do
|
57
|
+
|
58
|
+
subject.test_key1 = {:test_key2 => "blah1",
|
59
|
+
:test_key3 => "blah2"}
|
60
|
+
|
61
|
+
subject.test_key1.test_key2.should eq("blah1")
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ErpRules::RulesEngine::Ruleby::Engine do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
|
7
|
+
RuleBook = Class.new(Ruleby::Rulebook) do
|
8
|
+
def rules
|
9
|
+
rule :last_name_is_smith, {:priority => 1},[ErpRules::RulesEngine::Context, :context, m.customer_last_name == 'Smith'] do |v|
|
10
|
+
v[:context].valid_offers << 2
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
@rule_context = ErpRules::RulesEngine::Context.new
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should invoke ruleby and execute context against a rulebook" do
|
18
|
+
@rule_context[:customer_last_name] = "Smith"
|
19
|
+
@rule_context[:valid_offers] = []
|
20
|
+
|
21
|
+
@context = ErpRules::RulesEngine::Ruleby::Engine.invoke(RuleBook, @rule_context)
|
22
|
+
@context[:valid_offers].should include(2)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ErpRules::RulesEngine::RulesFacade do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
#ErpRules::RulesEngine::Ruleby::Engine
|
7
|
+
|
8
|
+
RuleBook = Class.new(Ruleby::Rulebook) do
|
9
|
+
def rules
|
10
|
+
rule :last_name_is_smith, {:priority => 1},[ErpRules::RulesEngine::Context, :context, m.customer_last_name == 'Smith'] do |v|
|
11
|
+
v[:context].valid_offers << 2
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
@rule_context = ErpRules::RulesEngine::Context.new
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should invoke the rules engine class passed in' do
|
19
|
+
@rule_context[:customer_last_name] = "Smith"
|
20
|
+
@rule_context[:valid_offers] = []
|
21
|
+
|
22
|
+
@result_ctx = subject.invoke(RuleBook,
|
23
|
+
@rule_context,
|
24
|
+
ErpRules::RulesEngine::Ruleby::Engine)
|
25
|
+
@result_ctx[:valid_offers].should include(2)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should add a directives map if they exist'
|
29
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spork'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
Spork.prefork do
|
5
|
+
# Loading more in this block will cause your tests to run faster. However,
|
6
|
+
# if you change any configuration or code from libraries loaded here, you'll
|
7
|
+
# need to restart spork for it take effect.
|
8
|
+
|
9
|
+
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
10
|
+
DUMMY_APP_ROOT=File.join(File.dirname(__FILE__), '/dummy')
|
11
|
+
|
12
|
+
require 'active_support'
|
13
|
+
require 'active_model'
|
14
|
+
require 'active_record'
|
15
|
+
require 'action_controller'
|
16
|
+
|
17
|
+
# Configure Rails Envinronment
|
18
|
+
ENV["RAILS_ENV"] = "spec"
|
19
|
+
require File.expand_path(DUMMY_APP_ROOT + "/config/environment.rb", __FILE__)
|
20
|
+
|
21
|
+
ActiveRecord::Base.configurations = YAML::load(IO.read(DUMMY_APP_ROOT + "/config/database.yml"))
|
22
|
+
ActiveRecord::Base.establish_connection(ENV["DB"] || "spec")
|
23
|
+
ActiveRecord::Migration.verbose = false
|
24
|
+
|
25
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
26
|
+
# in spec/support/ and its subdirectories.
|
27
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
|
28
|
+
|
29
|
+
require 'rspec/rails'
|
30
|
+
require 'erp_dev_svcs'
|
31
|
+
|
32
|
+
RSpec.configure do |config|
|
33
|
+
config.use_transactional_fixtures = true
|
34
|
+
config.include Sorcery::TestHelpers::Rails
|
35
|
+
config.include ErpDevSvcs
|
36
|
+
config.include ErpDevSvcs::ControllerSupport, :type => :controller
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Spork.each_run do
|
41
|
+
#We have to execute the migrations from dummy app directory
|
42
|
+
Dir.chdir DUMMY_APP_ROOT
|
43
|
+
`rake db:drop`
|
44
|
+
Dir.chdir ENGINE_RAILS_ROOT
|
45
|
+
|
46
|
+
#We have to execute the migrations from dummy app directory
|
47
|
+
Dir.chdir DUMMY_APP_ROOT
|
48
|
+
`rake db:migrate`
|
49
|
+
Dir.chdir ENGINE_RAILS_ROOT
|
50
|
+
|
51
|
+
ErpDevSvcs::FactorySupport.load_engine_factories
|
52
|
+
|
53
|
+
require 'simplecov'
|
54
|
+
SimpleCov.start 'rails' do
|
55
|
+
add_filter "spec/"
|
56
|
+
end
|
57
|
+
#Need to explictly load the files in lib/ until we figure out how to
|
58
|
+
#get rails to autoload them for spec like it used to...
|
59
|
+
Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f}
|
60
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: ruleby
|
16
|
+
requirement: &72388760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,18 +21,29 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *72388760
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: erp_txns_and_accts
|
27
|
+
requirement: &72387130 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - =
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *72387130
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: erp_dev_svcs
|
27
|
-
requirement: &
|
38
|
+
requirement: &72384290 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
|
-
- -
|
41
|
+
- - =
|
31
42
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
43
|
+
version: 3.0.1
|
33
44
|
type: :development
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *72384290
|
36
47
|
description: The Rules Module of CompassAE includes classes which act as helpers in
|
37
48
|
externalizing the execution context of CompassAE value objects for processing by
|
38
49
|
a rules engine. It also includes an integration with Ruleby, which is a pure ruby
|
@@ -43,22 +54,66 @@ executables: []
|
|
43
54
|
extensions: []
|
44
55
|
extra_rdoc_files: []
|
45
56
|
files:
|
46
|
-
- app/assets/javascripts/erp_rules/application.js
|
47
57
|
- app/assets/stylesheets/erp_rules/application.css
|
48
|
-
- app/
|
49
|
-
- app/helpers/erp_rules/application_helper.rb
|
58
|
+
- app/assets/javascripts/erp_rules/application.js
|
50
59
|
- app/views/layouts/erp_rules/application.html.erb
|
60
|
+
- app/models/customer_txn_context.rb
|
61
|
+
- app/models/environment_txn_context.rb
|
62
|
+
- app/models/search_txn_context.rb
|
63
|
+
- app/helpers/erp_rules/application_helper.rb
|
64
|
+
- app/controllers/erp_rules/application_controller.rb
|
51
65
|
- config/routes.rb
|
66
|
+
- lib/tasks/erp_rules_tasks.rake
|
67
|
+
- lib/erp_rules.rb
|
68
|
+
- lib/erp_rules/rules_engine.rb
|
52
69
|
- lib/erp_rules/engine.rb
|
70
|
+
- lib/erp_rules/search/search_base.rb
|
53
71
|
- lib/erp_rules/rules_engine/context.rb
|
72
|
+
- lib/erp_rules/rules_engine/pricing_engine.rb
|
73
|
+
- lib/erp_rules/rules_engine/ruleby/engine.rb
|
74
|
+
- lib/erp_rules/rules_engine/context_builder.rb
|
54
75
|
- lib/erp_rules/rules_engine/rules_facade.rb
|
55
|
-
- lib/erp_rules/
|
76
|
+
- lib/erp_rules/extensions.rb
|
77
|
+
- lib/erp_rules/extensions/active_record/acts_as_search_filter.rb
|
78
|
+
- lib/erp_rules/extensions/active_record/acts_as_business_rule.rb
|
79
|
+
- lib/erp_rules/extensions/active_record/has_rule_context.rb
|
56
80
|
- lib/erp_rules/version.rb
|
57
|
-
- lib/erp_rules.rb
|
58
|
-
- lib/tasks/erp_rules_tasks.rake
|
59
81
|
- GPL-3-LICENSE
|
60
82
|
- Rakefile
|
61
83
|
- README.rdoc
|
84
|
+
- spec/spec_helper.rb
|
85
|
+
- spec/lib/erp_rules/rules_engine/context_spec.rb
|
86
|
+
- spec/lib/erp_rules/rules_engine/rules_facade_spec.rb
|
87
|
+
- spec/lib/erp_rules/rules_engine/ruleby/engine_spec.rb
|
88
|
+
- spec/lib/erp_rules/rules_engine/context_builder_spec.rb
|
89
|
+
- spec/lib/erp_rules/extensions/active_record/has_rule_context_spec.rb
|
90
|
+
- spec/lib/erp_rules/extensions/active_record/acts_as_search_filter_spec.rb
|
91
|
+
- spec/lib/erp_rules/extensions/active_record/acts_as_business_rule_spec.rb
|
92
|
+
- spec/dummy/public/422.html
|
93
|
+
- spec/dummy/public/404.html
|
94
|
+
- spec/dummy/public/500.html
|
95
|
+
- spec/dummy/public/favicon.ico
|
96
|
+
- spec/dummy/config.ru
|
97
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
98
|
+
- spec/dummy/app/assets/javascripts/application.js
|
99
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
100
|
+
- spec/dummy/app/helpers/application_helper.rb
|
101
|
+
- spec/dummy/app/controllers/application_controller.rb
|
102
|
+
- spec/dummy/config/routes.rb
|
103
|
+
- spec/dummy/config/locales/en.yml
|
104
|
+
- spec/dummy/config/boot.rb
|
105
|
+
- spec/dummy/config/application.rb
|
106
|
+
- spec/dummy/config/environments/spec.rb
|
107
|
+
- spec/dummy/config/initializers/mime_types.rb
|
108
|
+
- spec/dummy/config/initializers/session_store.rb
|
109
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
110
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
111
|
+
- spec/dummy/config/initializers/inflections.rb
|
112
|
+
- spec/dummy/config/initializers/secret_token.rb
|
113
|
+
- spec/dummy/config/environment.rb
|
114
|
+
- spec/dummy/config/database.yml
|
115
|
+
- spec/dummy/Rakefile
|
116
|
+
- spec/dummy/script/rails
|
62
117
|
homepage: http://development.compassagile.com
|
63
118
|
licenses: []
|
64
119
|
post_install_message:
|
@@ -84,4 +139,37 @@ signing_key:
|
|
84
139
|
specification_version: 3
|
85
140
|
summary: The Rules Module of CompassAE includes classes which act as helpers in externalizing
|
86
141
|
the execution context of CompassAE value objects for processing by a rules engine.
|
87
|
-
test_files:
|
142
|
+
test_files:
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/lib/erp_rules/rules_engine/context_spec.rb
|
145
|
+
- spec/lib/erp_rules/rules_engine/rules_facade_spec.rb
|
146
|
+
- spec/lib/erp_rules/rules_engine/ruleby/engine_spec.rb
|
147
|
+
- spec/lib/erp_rules/rules_engine/context_builder_spec.rb
|
148
|
+
- spec/lib/erp_rules/extensions/active_record/has_rule_context_spec.rb
|
149
|
+
- spec/lib/erp_rules/extensions/active_record/acts_as_search_filter_spec.rb
|
150
|
+
- spec/lib/erp_rules/extensions/active_record/acts_as_business_rule_spec.rb
|
151
|
+
- spec/dummy/public/422.html
|
152
|
+
- spec/dummy/public/404.html
|
153
|
+
- spec/dummy/public/500.html
|
154
|
+
- spec/dummy/public/favicon.ico
|
155
|
+
- spec/dummy/config.ru
|
156
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
157
|
+
- spec/dummy/app/assets/javascripts/application.js
|
158
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
159
|
+
- spec/dummy/app/helpers/application_helper.rb
|
160
|
+
- spec/dummy/app/controllers/application_controller.rb
|
161
|
+
- spec/dummy/config/routes.rb
|
162
|
+
- spec/dummy/config/locales/en.yml
|
163
|
+
- spec/dummy/config/boot.rb
|
164
|
+
- spec/dummy/config/application.rb
|
165
|
+
- spec/dummy/config/environments/spec.rb
|
166
|
+
- spec/dummy/config/initializers/mime_types.rb
|
167
|
+
- spec/dummy/config/initializers/session_store.rb
|
168
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
169
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
170
|
+
- spec/dummy/config/initializers/inflections.rb
|
171
|
+
- spec/dummy/config/initializers/secret_token.rb
|
172
|
+
- spec/dummy/config/environment.rb
|
173
|
+
- spec/dummy/config/database.yml
|
174
|
+
- spec/dummy/Rakefile
|
175
|
+
- spec/dummy/script/rails
|