fanuc-ekg 0.0.2 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.1.1 / 2010-10-18
2
+ * Fixed bug where file was not being read
3
+
4
+ == 0.1.0 / 2010-10-18
5
+ * FANUC::EKG.parse now expects a File, not a path
6
+
1
7
  == 0.0.2 / 2010-10-14
2
8
  * Support both Ruby 1.8 and Ruby 1.9
3
9
 
data/README.txt CHANGED
@@ -13,7 +13,7 @@ MotionPRO Robot EKG analysis tool.
13
13
 
14
14
  == SYNOPSIS:
15
15
 
16
- @ekg_data = FANUC::Ekg.parse("path_to_some_ekg_file.csv")
16
+ @ekg_data = FANUC::Ekg.parse(File.new('path_to_some_file.csv'))
17
17
  @ekg_data.bins[:v2t1] # array of collisions by axis in BinV2T1
18
18
  @ekg_data.bins[:v2t1].total # total collisions in BinV2T1
19
19
  @ekg_data.bins[:v1t1][3] # number of collisions in BinV1T1 for axis 3
data/lib/fanuc-ekg.rb CHANGED
@@ -67,6 +67,7 @@ module Ekg
67
67
  require 'faster_csv'
68
68
  PARSER = FasterCSV
69
69
  end
70
+ require 'open-uri' #for opening URLs
70
71
 
71
72
  class Bin
72
73
  attr_accessor :collision_counts
@@ -154,10 +155,7 @@ module Ekg
154
155
 
155
156
 
156
157
  class << self
157
- def open(file_path)
158
- File.open(file_path)
159
- end
160
-
158
+
161
159
  def split(file)
162
160
  @output = {}
163
161
  @str = ""
@@ -183,10 +181,10 @@ module Ekg
183
181
  end
184
182
 
185
183
 
186
- def parse(file_path)
184
+ def parse(file)
187
185
  @ekg_data = FANUC::Ekg::EkgData.new
188
186
 
189
- f = open(file_path)
187
+ f = open(file).read
190
188
  output = split(f) # split the output into 3 usable CSV sections
191
189
 
192
190
  # parse bins
@@ -3,14 +3,15 @@ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
3
 
4
4
  describe FANUC::Ekg do
5
5
 
6
- it "should be able to open a file" do
7
- f = FANUC::Ekg.open(File.join(File.dirname(__FILE__), %w[fixtures R14_2010_09_24.csv]))
8
- f.should be_a_kind_of(File)
9
- end
6
+ #it "should be able to open a file" do
7
+ #f = FANUC::Ekg.open(File.join(File.dirname(__FILE__), %w[fixtures R14_2010_09_24.csv]))
8
+ #f.should be_a_kind_of(File)
9
+ #end
10
10
 
11
11
  describe "with file" do
12
12
  before(:each) do
13
- @f = FANUC::Ekg.open(File.join(File.dirname(__FILE__), %w[fixtures R14_2010_09_24.csv]))
13
+ #@f = FANUC::Ekg.open(File.join(File.dirname(__FILE__), %w[fixtures R14_2010_09_24.csv]))
14
+ @f = open(File.join(File.dirname(__FILE__), %w[fixtures R14_2010_09_24.csv]))
14
15
  end
15
16
 
16
17
  it "should split into a hash" do
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.1.1
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jay Strybis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-14 00:00:00 -05:00
17
+ date: 2010-10-18 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency