The previous attempt to just gem in the required gems did not work.
So I went for the whole thing.
richs-mac:~/rools/trunk/rools rich$ rake gem
/usr/local/bin/rake:17:Warning: require_gem is obsolete. Use gem
instead.
(in /Users/rich/rools/trunk/rools)
rake aborted!
no such file to load -- spec/rake/spectask
/Users/rich/rools/trunk/rools/rakefile:19
(See full trace by running task with --trace)
Apparently, Rools dependents on Rspec, so I installed it
richs-mac:~ rich$ sudo gem install rspec
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rspec-1.0.5
Installing ri documentation for rspec-1.0.5...
Installing RDoc documentation for rspec-1.0.5...
How lets really build the rools gem
richs-mac:~/rools/trunk/rools rich$ sudo rake gem
/usr/local/bin/rake:17:Warning: require_gem is obsolete. Use gem
instead.
(in /Users/rich/rools/trunk/rools)
mkdir -p pkg
Successfully built RubyGem
Name: rools
Version: 0.3
File: rools-0.3.gem
mv rools-0.3.gem pkg/rools-0.3.gem
Rools gem is built, so lets check it in irb
richs-mac:~/rools/trunk/rools rich$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'rools'
=> true
irb(main):003:0> rules = Rools::RuleSet.new
=> #<Rools::RuleSet:0x570648 @facts={}, @rules={}, @dependencies={}>
irb(main):004:0> exit
So far so good. Lets run the test
richs-mac:~/rools/trunk/rools rich$ sudo rake test
Password:
/usr/local/bin/rake:17:Warning: require_gem is obsolete. Use gem
instead.
(in /Users/rich/rools/trunk/rools)
/usr/local/bin/ruby -Ilib:test
"/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake/
rake_test_loader.rb"
"test/rake_test.rb"
Loaded suite
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake/rake_test_loader
Started
EEEEEE...Yes, France is in the country list
.hey, Rools!Heya float: 12.3
.D, [2007-07-20T16:33:01.226118 #1316] DEBUG -- : creating facts:
ptest__testclass
D, [2007-07-20T16:33:01.226555 #1316] DEBUG -- : no parameters defined
for rule: one
D, [2007-07-20T16:33:01.226775 #1316] DEBUG -- : one is relevant
D, [2007-07-20T16:33:01.226983 #1316] DEBUG -- : evaluating: one
D, [2007-07-20T16:33:01.227186 #1316] DEBUG -- : rule one matched
D, [2007-07-20T16:33:01.227344 #1316] DEBUG -- : executing rule one
.D, [2007-07-20T16:33:01.227912 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.228326 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.228670 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.228957 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.229216 #1316] DEBUG -- : prio1 match p:String
obj:Heya
D, [2007-07-20T16:33:01.229459 #1316] DEBUG -- : prio1 is relevant
D, [2007-07-20T16:33:01.229638 #1316] DEBUG -- : prio2 match p:String
obj:Heya
D, [2007-07-20T16:33:01.229832 #1316] DEBUG -- : prio2 is relevant
D, [2007-07-20T16:33:01.229993 #1316] DEBUG -- : prio3 match p:String
obj:Heya
D, [2007-07-20T16:33:01.230143 #1316] DEBUG -- : prio3 is relevant
D, [2007-07-20T16:33:01.230310 #1316] DEBUG -- : evaluating: prio3
D, [2007-07-20T16:33:01.230479 #1316] DEBUG -- : rule prio3 matched
D, [2007-07-20T16:33:01.230627 #1316] DEBUG -- : executing rule prio3
prio3: 3
D, [2007-07-20T16:33:01.230870 #1316] DEBUG -- : evaluating: prio2
D, [2007-07-20T16:33:01.231022 #1316] DEBUG -- : rule prio2 matched
D, [2007-07-20T16:33:01.231207 #1316] DEBUG -- : executing rule prio2
prio2: 6
D, [2007-07-20T16:33:01.231467 #1316] DEBUG -- : evaluating: prio1
D, [2007-07-20T16:33:01.231622 #1316] DEBUG -- : rule prio1 matched
D, [2007-07-20T16:33:01.231760 #1316] DEBUG -- : executing rule prio1
prio1: 7
rules.num_evaluated: 3
.D, [2007-07-20T16:33:01.232565 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.232867 #1316] DEBUG -- : Adding parameters:
[Fixnum]
D, [2007-07-20T16:33:01.233132 #1316] DEBUG -- : creating facts:
fixnum
D, [2007-07-20T16:33:01.233387 #1316] DEBUG -- : heya match p:String
obj:25
D, [2007-07-20T16:33:01.233583 #1316] DEBUG -- : heya is not relevant
D, [2007-07-20T16:33:01.233752 #1316] DEBUG -- : fixnum match p:Fixnum
obj:25
D, [2007-07-20T16:33:01.233910 #1316] DEBUG -- : fixnum is relevant
D, [2007-07-20T16:33:01.234068 #1316] DEBUG -- : evaluating: fixnum
D, [2007-07-20T16:33:01.234246 #1316] DEBUG -- : rule fixnum matched
D, [2007-07-20T16:33:01.234396 #1316] DEBUG -- : executing rule fixnum
D, [2007-07-20T16:33:01.234565 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.234832 #1316] DEBUG -- : Check if we need to
add
more rules
D, [2007-07-20T16:33:01.235069 #1316] DEBUG -- : heya match p:String
obj:heya
D, [2007-07-20T16:33:01.235301 #1316] DEBUG -- : heya is relevant
D, [2007-07-20T16:33:01.235482 #1316] DEBUG -- : fixnum match p:Fixnum
obj:heya
D, [2007-07-20T16:33:01.235637 #1316] DEBUG -- : fixnum is not
relevant
D, [2007-07-20T16:33:01.235807 #1316] DEBUG -- : evaluating: heya
D, [2007-07-20T16:33:01.235969 #1316] DEBUG -- : rule heya matched
D, [2007-07-20T16:33:01.236174 #1316] DEBUG -- : executing rule heya
.D, [2007-07-20T16:33:01.236792 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.237385 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.237728 #1316] DEBUG -- : hello match p:String
obj:hey
D, [2007-07-20T16:33:01.237937 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.238112 #1316] DEBUG -- : evaluating: hello
E, [2007-07-20T16:33:01.238514 #1316] ERROR -- : conditions_match?
StandardError divided by 0 ./test/rules_errors_test.rb:26:in `/'
./test/rules_errors_test.rb:26:in `test_fail_condition'
./lib/rools/default_parameter_proc.rb:35:in `instance_eval'
./lib/rools/default_parameter_proc.rb:35:in `call'
./lib/rools/rule.rb:113:in `conditions_match?'
./lib/rools/rule.rb:113:in `each'
./lib/rools/rule.rb:113:in `conditions_match?'
./lib/rools/rule_set.rb:331:in `evaluate'
./lib/rools/rule_set.rb:325:in `each'
./lib/rools/rule_set.rb:325:in `evaluate'
./lib/rools/rule_set.rb:265:in `assert'
./test/rules_errors_test.rb:31:in `test_fail_condition'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
`run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
/usr/local/lib/ruby/1.8/test/unit.rb:278
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake/
rake_test_loader.rb:5
.D, [2007-07-20T16:33:01.240665 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.240969 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.241245 #1316] DEBUG -- : hello match p:String
obj:hey
D, [2007-07-20T16:33:01.241439 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.241606 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.241753 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.241892 #1316] DEBUG -- : executing rule hello
E, [2007-07-20T16:33:01.242206 #1316] ERROR -- : rule
RuleConsequenceError divided by 0 ./test/rules_errors_test.rb:41:in
`/'
./test/rules_errors_test.rb:41:in `test_fail_consequence'
./lib/rools/default_parameter_proc.rb:35:in `instance_eval'
./lib/rools/default_parameter_proc.rb:35:in `call'
./lib/rools/rule.rb:133:in `call'
./lib/rools/rule.rb:132:in `each'
./lib/rools/rule.rb:132:in `call'
./lib/rools/rule_set.rb:349:in `evaluate'
./lib/rools/rule_set.rb:325:in `each'
./lib/rools/rule_set.rb:325:in `evaluate'
./lib/rools/rule_set.rb:265:in `assert'
./test/rules_errors_test.rb:45:in `test_fail_consequence'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
`run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
/usr/local/lib/ruby/1.8/test/unit.rb:278
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake/
rake_test_loader.rb:5
.D, [2007-07-20T16:33:01.244258 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.244545 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.244806 #1316] DEBUG -- : hello match p:String
obj:heya
D, [2007-07-20T16:33:01.244990 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.245152 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.245297 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.245434 #1316] DEBUG -- : executing rule hello
E, [2007-07-20T16:33:01.245765 #1316] ERROR -- : rule
RuleConsequenceError symbol: str not found in facts
./lib/rools/default_parameter_proc.rb:56:in `method_missing'
./test/miss_symbol_test.rb:35:in `test_miss_symbol'
./lib/rools/default_parameter_proc.rb:35:in `instance_eval'
./lib/rools/default_parameter_proc.rb:35:in `call'
./lib/rools/rule.rb:133:in `call'
./lib/rools/rule.rb:132:in `each'
./lib/rools/rule.rb:132:in `call'
./lib/rools/rule_set.rb:349:in `evaluate'
./lib/rools/rule_set.rb:325:in `each'
./lib/rools/rule_set.rb:325:in `evaluate'
./lib/rools/rule_set.rb:265:in `assert'
./test/miss_symbol_test.rb:39:in `test_miss_symbol'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__'
/usr/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
`run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
/usr/local/lib/ruby/1.8/test/unit.rb:278
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake/
rake_test_loader.rb:5
.D, [2007-07-20T16:33:01.247860 #1316] DEBUG -- : Adding parameters:
[Fixnum]
.D, [2007-07-20T16:33:01.248547 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.248801 #1316] DEBUG -- : Adding parameters:
[Employee, :name]
D, [2007-07-20T16:33:01.249035 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.249282 #1316] DEBUG -- : hello match p:String
obj:heya
D, [2007-07-20T16:33:01.249467 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.249628 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.249803 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.249953 #1316] DEBUG -- : executing rule hello
Hello, Rools!
D, [2007-07-20T16:33:01.250281 #1316] DEBUG -- : creating facts:
employee
D, [2007-07-20T16:33:01.250522 #1316] DEBUG -- : hello match p:String
obj:pat
D, [2007-07-20T16:33:01.250707 #1316] DEBUG -- : hello match
p:Employee
obj:pat
D, [2007-07-20T16:33:01.250865 #1316] DEBUG -- : hello match p:name
obj:pat
D, [2007-07-20T16:33:01.251014 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.251166 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.251309 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.251443 #1316] DEBUG -- : executing rule hello
Hello, Rools!
D, [2007-07-20T16:33:01.251740 #1316] DEBUG -- : creating facts:
fixnum
D, [2007-07-20T16:33:01.251993 #1316] DEBUG -- : hello match p:String
obj:49
D, [2007-07-20T16:33:01.252179 #1316] DEBUG -- : hello match
p:Employee
obj:49
D, [2007-07-20T16:33:01.252332 #1316] DEBUG -- : hello match p:name
obj:49
D, [2007-07-20T16:33:01.252483 #1316] DEBUG -- : hello is not relevant
D, [2007-07-20T16:33:01.252626 #1316] DEBUG -- : no relevant rules
.D, [2007-07-20T16:33:01.253085 #1316] DEBUG -- : loading ext:
test/data/hello.rb
D, [2007-07-20T16:33:01.253624 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.253936 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.254211 #1316] DEBUG -- : hello match p:String
obj:Heya
D, [2007-07-20T16:33:01.254398 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.254555 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.254699 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.254835 #1316] DEBUG -- : executing rule hello
Hello, Rools!
.D, [2007-07-20T16:33:01.255469 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.255718 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.255963 #1316] DEBUG -- : hello match p:String
obj:Heya
D, [2007-07-20T16:33:01.256144 #1316] DEBUG -- : hello is relevant
D, [2007-07-20T16:33:01.256306 #1316] DEBUG -- : evaluating: hello
D, [2007-07-20T16:33:01.370302 #1316] DEBUG -- : rule hello matched
D, [2007-07-20T16:33:01.370703 #1316] DEBUG -- : executing rule hello
Hello, Rools!
.D, [2007-07-20T16:33:01.371571 #1316] DEBUG -- : Adding parameters:
[NewEmployee]
D, [2007-07-20T16:33:01.371926 #1316] DEBUG -- : Adding parameters:
[NewEmployee]
D, [2007-07-20T16:33:01.372210 #1316] DEBUG -- : creating facts:
newemployee
D, [2007-07-20T16:33:01.372477 #1316] DEBUG -- : programmer match
p:NewEmployee obj:John Doe
D, [2007-07-20T16:33:01.372677 #1316] DEBUG -- : programmer is
relevant
D, [2007-07-20T16:33:01.372855 #1316] DEBUG -- : manager match
p:NewEmployee obj:John Doe
D, [2007-07-20T16:33:01.373008 #1316] DEBUG -- : manager is relevant
D, [2007-07-20T16:33:01.373172 #1316] DEBUG -- : evaluating:
programmer
D, [2007-07-20T16:33:01.373362 #1316] DEBUG -- : rule programmer
matched
D, [2007-07-20T16:33:01.373515 #1316] DEBUG -- : executing rule
programmer
John Doe is a coder
D, [2007-07-20T16:33:01.373776 #1316] DEBUG -- : evaluating: manager
.D, [2007-07-20T16:33:01.374346 #1316] DEBUG -- : loading ext:
test/data/un.xml
D, [2007-07-20T16:33:01.384138 #1316] DEBUG -- : created facts:
countries
D, [2007-07-20T16:33:01.387658 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.390532 #1316] DEBUG -- : loaded 1 rules
D, [2007-07-20T16:33:01.390941 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.391280 #1316] DEBUG -- : Is it on Security
Council? match p:String obj:["China", "USSR", "France", "Great
Britain",
"USA"]
D, [2007-07-20T16:33:01.391538 #1316] DEBUG -- : Is it on Security
Council? is relevant
D, [2007-07-20T16:33:01.391741 #1316] DEBUG -- : evaluating: Is it on
Security Council?
D, [2007-07-20T16:33:01.392111 #1316] DEBUG -- : rule Is it on
Security
Council? matched
D, [2007-07-20T16:33:01.392323 #1316] DEBUG -- : executing rule Is it
on
Security Council?
Yes, France is in the country list
.D, [2007-07-20T16:33:01.393169 #1316] DEBUG -- : loading ext:
test/data/hello.xml
D, [2007-07-20T16:33:01.397898 #1316] DEBUG -- : created facts: chars
D, [2007-07-20T16:33:01.400632 #1316] DEBUG -- : Adding parameters:
[String]
D, [2007-07-20T16:33:01.404283 #1316] DEBUG -- : Adding parameters:
[Fixnum]
D, [2007-07-20T16:33:01.418933 #1316] DEBUG -- : loaded 2 rules
D, [2007-07-20T16:33:01.419436 #1316] DEBUG -- : creating facts:
string
D, [2007-07-20T16:33:01.478536 #1316] DEBUG -- : Hello match p:String
obj:['a','b','c']
D, [2007-07-20T16:33:01.478801 #1316] DEBUG -- : Hello is relevant
D, [2007-07-20T16:33:01.478934 #1316] DEBUG -- : Fixnum match p:Fixnum
obj:['a','b','c']
D, [2007-07-20T16:33:01.479024 #1316] DEBUG -- : Fixnum is not
relevant
D, [2007-07-20T16:33:01.479139 #1316] DEBUG -- : Fixnum match p:Fixnum
obj:Heya
D, [2007-07-20T16:33:01.479219 #1316] DEBUG -- : Fixnum is not
relevant
D, [2007-07-20T16:33:01.479460 #1316] DEBUG -- : evaluating: Hello
D, [2007-07-20T16:33:01.479583 #1316] DEBUG -- : rule Hello matched
D, [2007-07-20T16:33:01.479663 #1316] DEBUG -- : executing rule Hello
Hello, Rools!
.
Finished in 0.392865 seconds.
1) Error:
test_customer_2(CSVLoanTest):
CSV::IllegalFormatError: CSV::IllegalFormatError
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:430:in `get_row'
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:338:in `each'
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:310:in `parse'
./lib/rools/csv_table.rb:24:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_loan_test.rb:88:in `new'
./test/csv_loan_test.rb:88:in `test_customer_2'
2) Error:
test_rules_101(CSVLoanTest):
CSV::IllegalFormatError: CSV::IllegalFormatError
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:430:in `get_row'
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:338:in `each'
/usr/local/lib/ruby/site_ruby/1.8/csv.rb:310:in `parse'
./lib/rools/csv_table.rb:24:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_loan_test.rb:64:in `new'
./test/csv_loan_test.rb:64:in `test_rules_101'
3) Error:
test_rules_212(CSVLoanTest):
NoMethodError: undefined method `[]' for nil:NilClass
./lib/rools/csv_table.rb:30:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_loan_test.rb:72:in `new'
./test/csv_loan_test.rb:72:in `test_rules_212'
4) Error:
test_rules_301(CSVLoanTest):
NoMethodError: undefined method `[]' for nil:NilClass
./lib/rools/csv_table.rb:30:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_loan_test.rb:80:in `new'
./test/csv_loan_test.rb:80:in `test_rules_301'
5) Error:
test_greetings(CSVTest):
NoMethodError: undefined method `[]' for nil:NilClass
./lib/rools/csv_table.rb:30:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_test.rb:49:in `new'
./test/csv_test.rb:49:in `test_greetings'
6) Error:
test_salutations(CSVTest):
NoMethodError: undefined method `[]' for nil:NilClass
./lib/rools/csv_table.rb:30:in `initialize'
./lib/rools/rule_set.rb:54:in `new'
./lib/rools/rule_set.rb:54:in `load_csv'
./lib/rools/rule_set.rb:33:in `initialize'
./test/csv_test.rb:76:in `new'
./test/csv_test.rb:76:in `test_salutations'
24 tests, 42 assertions, 0 failures, 6 errors
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -Ilib:test
"/usr/local...]
Should I be seeing these 6 errors? Is there something missing? Can
you
help?
Rich
You should not be seing those errors.
Could you run this script for me, please?
ruby --version
rake --version
rails --version
gem list rspec
gem list rubygems-update
gem list rote
gem list redcloth
gem list syntax
gem list rcov
Here is what my output looks like:
ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]
rake, version 0.7.2
Rails 1.2.3
*** LOCAL GEMS ***
rspec (1.0.0)
RSpec-1.0.0 (r1986) - BDD for Ruby http://rspec.rubyforge.org/
*** LOCAL GEMS ***
rubygems-update (0.9.2)
RubyGems Update GEM
*** LOCAL GEMS ***
rote (0.3.4)
Adds template-based doc support to Rake.
*** LOCAL GEMS ***
RedCloth (3.0.4)
RedCloth is a module for using Textile and Markdown in Ruby.
Textile
and Markdown are text formats. A very simple text format. Another
stab at making readable text that can be converted to HTML.
*** LOCAL GEMS ***
syntax (1.0.0)
Syntax is Ruby library for performing simple syntax highlighting.
*** LOCAL GEMS ***
rcov (0.8.0.2)
Code coverage analysis tool for Ruby
Thanks,
Pat.
->rspec (1.0.5, 1.0.0)
RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/
Pat.
On Jul 21, 9:34 am, cappelaere <cappela...@gmail.com> wrote:
> Rich,
>
> You should not be seing those errors.
> Could you run this script for me, please?
> ruby --version
> rake --version
> rails --version
> gem list rspec
> gem list rubygems-update
> gem list rote
> gem list redcloth
> gem list syntax
> gem list rcov
>
> Here is what my output looks like:
> ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]
> rake, version 0.7.2
> Rails 1.2.3
>
> *** LOCAL GEMS ***
>
> rspec (1.0.0)
> RSpec-1.0.0 (r1986) - BDD for Rubyhttp://rspec.rubyforge.org/
> ...
>
> read more »
richs-mac:~ rich$ ruby --version
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]
richs-mac:~ rich$ rake --version
/usr/local/bin/rake:17:Warning: require_gem is obsolete. Use gem
instead.
rake, version 0.7.2
richs-mac:~ rich$ rails --version
/usr/local/bin/rails:17:Warning: require_gem is obsolete. Use gem
instead.
Rails 1.2.3
richs-mac:~ rich$ gem list rspec
*** LOCAL GEMS ***
rspec (1.0.5)
RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/
richs-mac:~ rich$ gem list rubygems-update
*** LOCAL GEMS ***
rubygems-update (0.9.4)
RubyGems Update GEM
richs-mac:~ rich$ gem list rote
*** LOCAL GEMS ***
rote (0.3.4)
Adds template-based doc support to Rake.
richs-mac:~ rich$ gem list redcloth
*** LOCAL GEMS ***
RedCloth (3.0.4)
RedCloth is a module for using Textile and Markdown in Ruby.
Textile
and Markdown are text formats. A very simple text format. Another
stab at making readable text that can be converted to HTML.
richs-mac:~ rich$ gem list syntax
*** LOCAL GEMS ***
syntax (1.0.0)
Syntax is Ruby library for performing simple syntax highlighting.
richs-mac:~ rich$ gem list rcov
*** LOCAL GEMS ***
richs-mac:~ rich$
richs-mac:~ rich$ gem list rcov
*** LOCAL GEMS ***
Two diferences that I have noticed is that I am running ruby 1.8.5 and
I do not have rcov installed.
I will update ruby and install rcov.
On Jul 21, 7:19 am, cappelaere <cappela...@gmail.com> wrote:
> Updated rspec to 1.0.5 on my machine with no issue.
> gem list rspec
>
> ->rspec (1.0.5, 1.0.0)
> RSpec-1.0.5 (r2081) - BDD for Rubyhttp://rspec.rubyforge.org/
> ...
>
> read more »
On Jul 21, 10:57 pm, RichOnRails <Rich...@Boldway.org> wrote:
> I ran the script and here is the result:
>
> richs-mac:~ rich$ ruby --version
> ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]
> richs-mac:~ rich$ rake --version
> /usr/local/bin/rake:17:Warning: require_gem is obsolete. Use gem
> instead.
> rake, version 0.7.2
> richs-mac:~ rich$ rails --version
> /usr/local/bin/rails:17:Warning: require_gem is obsolete. Use gem
> instead.
> Rails 1.2.3
> richs-mac:~ rich$ gem list rspec
>
> *** LOCAL GEMS ***
>
> rspec (1.0.5)
> RSpec-1.0.5 (r2081) - BDD for Rubyhttp://rspec.rubyforge.org/
> ...
>
> read more »
I have installed all the matching gems as below:
ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.10.0]
rake (0.7.2)
Rails 1.2.3
rspec (1.0.5)
rubygems-update (0.9.2)
rote (0.3.4)
RedCloth (3.0.4)
syntax (1.0.0)
rcov (0.8.0.2)
ZenTest (3.6.0)
Here is the rools.rb cut-and-pasted from quickstart:
require 'rubygems'
require 'rools'
rules = Rools::RuleSet.new do
rule 'Hello' do
parameter String
consequence { puts "Hello, Rools!" }
end
end
rules.assert 'Heya'
Here is the error:
richs-mac:~/Documents/Rails-Projects/csv-html rich$ /usr/local/bin/
ruby rools.rb
./rools.rb:4: uninitialized constant Rools (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `require'
from rools.rb:2
I'm lost for things to try!!!
Along the way I have sure learned a lot about gems.
Is there also a dependency on fastercsv?
What about renaming that file hello.rb :)
That ought to work better to avoid the naming conflict.
Good luck.
V/R,
Pat.
Well done Pat !
The great classic :(
--
John Mettraux -///- http://jmettraux.openwfe.org
Point well taken. I updated the documentation and uploaded it to the site.
It may take a while to get refreshed.
Thanks for pointing this out.
Pat.
> From: RichOnRails <Ric...@Boldway.org>
> Reply-To: <rools...@googlegroups.com>
> Date: Wed, 25 Jul 2007 08:07:26 -0700
> To: Rools Users <rools...@googlegroups.com>
> Subject: [rools-users] Re: Gem install problems
>
>