mathviz 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 1.0.1 2010-09-04
2
+
3
+ * Syntax and path updates for 1.9.2
4
+ * Remove explicit rubygems require
5
+
1
6
  === 1.0.0 2009-12-23
2
7
 
3
8
  * Rename from MatLat to MathViz
@@ -6,7 +6,6 @@ examples/E_mc2.png
6
6
  examples/E_mc2.rb
7
7
  examples/dc.rb
8
8
  examples/first.rb
9
- examples/mathviz.rb
10
9
  lib/mathviz.rb
11
10
  spec/measurable_spec.rb
12
11
  spec/measured_spec.rb
@@ -15,7 +15,6 @@ Turn simple equations (a = b * c) into GraphViz dot files showing relationships,
15
15
 
16
16
  == SYNOPSIS:
17
17
 
18
- require 'rubygems'
19
18
  require 'mathviz'
20
19
 
21
20
  # No units are provided by default.
Binary file
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'mathviz'
3
2
 
4
3
  # No units are provided by default.
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'mathviz'
3
2
 
4
3
  module MathViz::Units
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'mathviz'
3
2
 
4
3
  MathViz.new('first') {
@@ -32,4 +31,4 @@ MathViz.new('first') {
32
31
  timeDelta = relativeTime * delta
33
32
 
34
33
  binding
35
- }.dot
34
+ }.dot
@@ -1,10 +1,9 @@
1
- require 'rubygems'
2
1
  require 'graphviz_r'
3
2
 
4
3
  # Top level object.
5
4
  class MathViz
6
5
  # RubyGem version
7
- VERSION = '1.0.0'
6
+ VERSION = '1.0.1'
8
7
 
9
8
  # Something to return instead of dividing by zero, etc.
10
9
  Infinity = 1.0/0
@@ -60,7 +59,7 @@ class MathViz::Unit
60
59
  @unit = Hash.new(0)
61
60
  case h
62
61
  when Hash; @unit.merge!(h); normalize!
63
- when Symbol: @unit[h] = 1
62
+ when Symbol; @unit[h] = 1
64
63
  end
65
64
  @unit.freeze
66
65
  freeze
@@ -248,7 +247,7 @@ class MathViz::Term
248
247
  # Assign names to named MathViz::Terms, so the name can be effiently looked up from the MathViz::Term object.
249
248
  def self.name_terms!(env)
250
249
  eval("local_variables", env).each do |var|
251
- value = eval(var, env)
250
+ value = eval(var.to_s, env)
252
251
  if value.respond_to? :name=
253
252
  value.name = var
254
253
  end
@@ -258,7 +257,7 @@ class MathViz::Term
258
257
  # Return a list of all MathViz::Terms accessible from a binding
259
258
  def self.list_terms(env)
260
259
  eval("local_variables", env).map { |var|
261
- value = eval(var, env)
260
+ value = eval(var.to_s, env)
262
261
  if (value.kind_of?(MathViz::Term))
263
262
  value
264
263
  else
@@ -560,11 +559,11 @@ class MathViz::Operation::Binary < MathViz::Operation
560
559
  # Graphviz node color; differentiates basic mathematical operators (+, -, *, /)
561
560
  def color
562
561
  case @op
563
- when :+: :green;
564
- when :-: :yellow;
565
- when :*: :blue;
566
- when :/: :cyan;
567
- else :red;
562
+ when :+; :green;
563
+ when :-; :yellow;
564
+ when :*; :blue;
565
+ when :/; :cyan;
566
+ else :red;
568
567
  end
569
568
  end
570
569
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'spec_helper')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
2
 
3
3
  module MathViz::Units
4
4
  new_units :s
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'spec_helper')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
2
 
3
3
  class Subject
4
4
  include MathViz::Measured
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'spec_helper')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
2
 
3
3
  module MathViz::Units
4
4
  new_units :s
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'spec_helper')
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
2
 
3
3
  shared_examples_for "common combinations" do
4
4
  it "can be created" do
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 1
9
+ version: 1.0.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Justin Love
@@ -9,29 +14,54 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-25 00:00:00 -06:00
17
+ date: 2010-09-04 00:00:00 -05:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: GraphvizR
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 5
31
+ - 1
23
32
  version: 0.5.1
24
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
25
35
  - !ruby/object:Gem::Dependency
26
- name: hoe
36
+ name: rubyforge
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 2
45
+ - 0
46
+ - 4
47
+ version: 2.0.4
27
48
  type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: hoe
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
30
55
  requirements:
31
56
  - - ">="
32
57
  - !ruby/object:Gem::Version
33
- version: 2.3.3
34
- version:
58
+ segments:
59
+ - 2
60
+ - 6
61
+ - 2
62
+ version: 2.6.2
63
+ type: :development
64
+ version_requirements: *id003
35
65
  description: Turn simple equations (a = b * c) into GraphViz dot files showing relationships, values, and units.
36
66
  email:
37
67
  - git@JustinLove.name
@@ -52,7 +82,6 @@ files:
52
82
  - examples/E_mc2.rb
53
83
  - examples/dc.rb
54
84
  - examples/first.rb
55
- - examples/mathviz.rb
56
85
  - lib/mathviz.rb
57
86
  - spec/measurable_spec.rb
58
87
  - spec/measured_spec.rb
@@ -71,21 +100,25 @@ rdoc_options:
71
100
  require_paths:
72
101
  - lib
73
102
  required_ruby_version: !ruby/object:Gem::Requirement
103
+ none: false
74
104
  requirements:
75
105
  - - ">="
76
106
  - !ruby/object:Gem::Version
107
+ segments:
108
+ - 0
77
109
  version: "0"
78
- version:
79
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
+ none: false
80
112
  requirements:
81
113
  - - ">="
82
114
  - !ruby/object:Gem::Version
115
+ segments:
116
+ - 0
83
117
  version: "0"
84
- version:
85
118
  requirements: []
86
119
 
87
120
  rubyforge_project: mathviz
88
- rubygems_version: 1.3.5
121
+ rubygems_version: 1.3.7
89
122
  signing_key:
90
123
  specification_version: 3
91
124
  summary: Turn simple equations (a = b * c) into GraphViz dot files showing relationships, values, and units.
@@ -1 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'lib', 'mathviz')