aska 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,3 +1,4 @@
1
+ aska.gemspec
1
2
  CHANGELOG
2
3
  lib/aska.rb
3
4
  lib/object.rb
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.8"
9
+ p.version = "0.0.9"
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.8
2
+ # Gem::Specification for Aska-0.0.9
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.8
8
+ version: 0.0.9
9
9
  platform: ruby
10
10
  authors:
11
11
  - Ari Lerner
@@ -38,6 +38,7 @@ extra_rdoc_files:
38
38
  - LICENSE
39
39
  - README
40
40
  files:
41
+ - aska.gemspec
41
42
  - CHANGELOG
42
43
  - lib/aska.rb
43
44
  - lib/object.rb
@@ -47,7 +48,6 @@ files:
47
48
  - README
48
49
  - spec/rules_spec.rb
49
50
  - spec/spec_helper.rb
50
- - aska.gemspec
51
51
  has_rdoc: true
52
52
  homepage: http://blog.citrusbyte.com
53
53
  post_install_message: |+
@@ -7,6 +7,7 @@ module Aska
7
7
  def rules(name=:rules, arr=[])
8
8
  returning look_up_rules(name) do |rs|
9
9
  arr.each do |line|
10
+ next unless line
10
11
  k = line[/(.+)[=\\\<\>](.*)/, 1].gsub(/\s+/, '')
11
12
  v = line[/(.+)[=\\<>](.*)/, 2].gsub(/\s+/, '')
12
13
  m = line[/[=\\<>]/, 0].gsub(/\s+/, '')
@@ -31,7 +32,7 @@ module Aska
31
32
  !look_up_rules(name).empty?
32
33
  end
33
34
  def aska_attr_accessors
34
- @@aska_attr_accessors ||= Rules.new
35
+ @aska_attr_accessors ||= Rules.new
35
36
  end
36
37
  def defined_rules
37
38
  @defined_rules ||= {}
@@ -104,7 +105,7 @@ module Aska
104
105
 
105
106
  class Rules < Array
106
107
  def to_s
107
- "#{self.join('", "')}"
108
+ self.map {|r| v=r.keys.first;"'#{v} #{r[v][0]} #{r[v][1]}'"}.join(", ")
108
109
  end
109
110
  end
110
111
  end
@@ -19,7 +19,7 @@ describe "Rules" do
19
19
  @car.names.class.should == Aska::Rules
20
20
  end
21
21
  it "should be able to turn them into a string" do
22
- @car.names.to_s.should == "x>0\", \"y>0\", \"x>y"
22
+ @car.names.to_s.should == "'x > 0', 'y > 0', 'x > y'"
23
23
  end
24
24
  it "should be able to say that rules are defined when they are defined" do
25
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.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Lerner
@@ -35,6 +35,7 @@ extra_rdoc_files:
35
35
  - LICENSE
36
36
  - README
37
37
  files:
38
+ - aska.gemspec
38
39
  - CHANGELOG
39
40
  - lib/aska.rb
40
41
  - lib/object.rb
@@ -44,7 +45,6 @@ files:
44
45
  - README
45
46
  - spec/rules_spec.rb
46
47
  - spec/spec_helper.rb
47
- - aska.gemspec
48
48
  has_rdoc: true
49
49
  homepage: http://blog.citrusbyte.com
50
50
  post_install_message: |+