redplot 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/redplot.rb +37 -39
  2. metadata +3 -3
@@ -1,31 +1,42 @@
1
- # RedPlot is Copyright (c) 2012 Hugo Benichi <hbenichi@gmail.com>
2
- #
3
- # RedPlot is free software: you can redistribute it and/or modify
4
- # it under the terms of the GNU General Public License as published by
5
- # the Free Software Foundation, either version 3 of the License, or
6
- # (at your option) any later version.
7
- #
8
- # RedPlot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9
- # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
- # See the GNU General Public License for more details.
11
- #
12
- # You should have received a copy of the GNU General Public License along with RedPlot.
13
- # If not, see <http://www.gnu.org/licenses/>.
14
- #
15
- # Description: a simple layer to gnuplot;
16
- # can enhance any ruby object with plotting facilities;
17
- #
18
- # How it works: cf examples/;
19
- # you can either mixin Redplot to any object;
20
- # you can also directly use the Plotter class;
21
- #
1
+ ##
2
+ # Red Plot
3
+ #
4
+ # ( Gnuplot process wrapper )
5
+ #
6
+ # version 0.1.0
7
+ # author hugo benichi
8
+ # email hugo.benichi@m4x.org
9
+ # copyright 2012 hugo benichi
10
+ #
11
+ # reproduction
12
+ #
13
+ # You can use this code without restriction if you mention my name in your project.
14
+ # Other than that, you can redistribute and/or modify without restriction.
15
+ #
16
+ # description
17
+ #
18
+ # A simple layer wrapping around a gnuplot process.
19
+ # It gives convenience handler methods from and to Ruby objects
20
+ # Useful to quickly plot data produced inside Ruby.
21
+ #
22
+ # installation
23
+ #
24
+ # gem install redplot-x.y.z.gem
25
+ #
26
+ # wow it works:
27
+ #
28
+ # See lib/redplot/examples/;
29
+ # You can either mixin Redplot to any object
30
+ # You can also directly use the Plotter class
31
+ #
32
+ ##
22
33
 
23
34
 
24
35
  #main namespace
25
36
  #also used for mixin
26
37
  module RedPlot
27
38
 
28
- VersionNumber, VersionDate = '0.0.3', '2012-06-05'
39
+ VersionNumber, VersionDate = '0.1.0', '2012-06-05'
29
40
 
30
41
  #helper class to store callbacks to the data and plot command options
31
42
  class ToDraw
@@ -68,7 +79,10 @@ module RedPlot
68
79
  end
69
80
 
70
81
  def method_missing(*args)
71
- (scoped_header = @header ) << args.join(" ") + " "
82
+ #modification of "args" local var to auto-stringify fixnum
83
+ (scoped_header = @header ) << args.map{ |arg|
84
+ (arg.is_a? Numeric)? arg.to_s : arg #specifically this line
85
+ }.join(" ") + " "
72
86
  args[0].to_s.tap do |eval_space|
73
87
  eval_space.singleton_class.instance_eval do
74
88
  define_method(:method_missing) do |*args|
@@ -215,20 +229,4 @@ module RedPlot
215
229
 
216
230
  end
217
231
 
218
-
219
- class Array
220
- #this provide a quick hook for Array instances
221
- def plot!(args={})
222
- args[:as] ||= :plot
223
- args[:in] = self.singleton_class
224
- data = self
225
- RedPlot::insert(args) { todraw.add args[:style] {data} }
226
- wrapper = self.send args[:as]
227
- end
228
- #hook RedPlot to the array and draw what is inside it
229
- def plot_now!(args={})
230
- self.plot!(args).draw
231
- end
232
- end
233
-
234
232
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redplot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &8335960 !ruby/object:Gem::Requirement
16
+ requirement: &7155680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *8335960
24
+ version_requirements: *7155680
25
25
  description: redplot gives convenience handler methods from and to Ruby objects to
26
26
  easily communicate with a gnuplot process
27
27
  email: hugo.benichi@m4x.org