aska 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  p.summary = "The basics of an expert system"
7
7
  p.url = "http://blog.citrusbyte.com"
8
8
  p.dependencies = []
9
- p.version = "0.0.6"
9
+ p.version = "0.0.7"
10
10
  p.install_message =<<-EOM
11
11
 
12
12
  Aska - Expert system basics
@@ -1,11 +1,11 @@
1
1
 
2
- # Gem::Specification for Aska-0.0.6
2
+ # Gem::Specification for Aska-0.0.7
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: aska
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.0.6
8
+ version: 0.0.7
9
9
  platform: ruby
10
10
  authors:
11
11
  - Ari Lerner
@@ -25,13 +25,13 @@ module Aska
25
25
  attr_writer k.to_sym unless respond_to?("#{k}=".to_sym)
26
26
  end
27
27
  def look_up_rules(name)
28
- defined_rules[name.to_sym] ||= []
28
+ defined_rules[name.to_sym] ||= Rules.new
29
29
  end
30
30
  def are_rules?(name)
31
31
  !look_up_rules(name).empty?
32
32
  end
33
33
  def aska_attr_accessors
34
- @@aska_attr_accessors ||= []
34
+ @@aska_attr_accessors ||= Rules.new
35
35
  end
36
36
  def defined_rules
37
37
  @defined_rules ||= {}
@@ -101,4 +101,10 @@ module Aska
101
101
  receiver.extend ClassMethods
102
102
  receiver.send :include, InstanceMethods
103
103
  end
104
+
105
+ class Rules < Array
106
+ def to_s
107
+ "\"#{self.join('", "')}\""
108
+ end
109
+ end
104
110
  end
@@ -16,7 +16,10 @@ describe "Rules" do
16
16
  @car.rules.class.should == Hash
17
17
  end
18
18
  it "should be able to look up the rules based on the name into an array" do
19
- @car.names.class.should == Array
19
+ @car.names.class.should == Aska::Rules
20
+ end
21
+ it "should be able to turn them into a string" do
22
+ @car.names.to_s.should == "\"x>0\", \"y>0\", \"x>y\""
20
23
  end
21
24
  it "should be able to say that rules are defined when they are defined" do
22
25
  @car.names.should_not be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aska
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Lerner