graphit 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c108e26abb3a716171d6ae8e24c54e7db4f5c10a
4
- data.tar.gz: 05ac30a8f0c4970d1ec56add3d6ad3913f64f228
3
+ metadata.gz: b5c584ee0d6942f0e076280c64c955bb7597788c
4
+ data.tar.gz: 7d54dd6e3cb3627d949ce1713ddd8d159bd34936
5
5
  SHA512:
6
- metadata.gz: 0df3f512f487b5bce2e3cd01d8cc17d8556688dae9340066e88404366ec9a63c10ba831c8d3a58033dbe80803cbdbb342436f98fc0049b8624e19538b8f6399f
7
- data.tar.gz: fb776f32eb97e94520ae93b26a775a8b60a23b3014f0c16d19031e2413d31d01130bb7f9ac7dde184069e95bcab170e37e77149e900a1a4395d24e358ee9c371
6
+ metadata.gz: 0abe0159731e42234cd8cf0aa26b12f0a150a6e405b71bcc1a32dad76feb7a6740a0563b41388ea2df6a9676213e5e99d26485a84cc63571d59ad46be461455a
7
+ data.tar.gz: 21ce985ca72ed248ebcf7723cfda8e3edb2245b00b39065c2028566e60031f98d0e9071148cd30eb603558ce033ad71e56d2e9916d112fe8c1acbd636b2ab9f7
data/README.md CHANGED
@@ -1,15 +1,17 @@
1
- # MRTG2XY
1
+ # Graph It!
2
2
 
3
- A very simple utility to convert data from mrtg log files to a simple x:y format.
3
+ A very basic graphing library that writes data to bmp images.
4
4
 
5
- I use this to send data to a graph utility.
5
+ It's probably too basic to work for you.
6
+
7
+ I use my `mrtg2xy` gem to process data from `mrtg` which I pipe into this utility.
6
8
 
7
9
  ## Installation
8
10
 
9
11
  Install it yourself:
10
12
 
11
- $ gem install mrtg2xy
13
+ $ gem install graphit
12
14
 
13
15
  ## Usage
14
16
 
15
- $ mrtg2xy
17
+ $ cat mydata | graphit -o graph.bmp
data/exe/graphit CHANGED
@@ -1,6 +1,24 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bin_utils' # For Speed
4
+ require 'optparse'
5
+
6
+ options = {}
7
+ OptionParser.new do |opts|
8
+ opts.banner = "Usage: graphit [options] data"
9
+
10
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
11
+ options[:verbose] = v
12
+ end
13
+
14
+ opts.on("-o", "--output-file [file]", "Filename") do |of|
15
+ options[:outputfile] = of
16
+ end
17
+
18
+ end.parse!
19
+
20
+ options[:outputfile] = "graph.bmp" if options[:outputfile].nil?
21
+
4
22
 
5
23
  @characters = {}
6
24
 
@@ -283,7 +301,7 @@ def graph_data( data, pixels, color )
283
301
  pixels
284
302
  end
285
303
 
286
- File.open( 'test-01.bmp', 'w') do |f|
304
+ File.open( options[:outputfile], 'w') do |f|
287
305
 
288
306
  start = Time.now.to_f
289
307
 
@@ -445,4 +463,4 @@ File.open( 'test-01.bmp', 'w') do |f|
445
463
  f.print pixel_data
446
464
  end
447
465
 
448
- `convert test-01.bmp test-01.png`
466
+ `convert #{options[:outputfile]} #{options[:outputfile].gsub('bmp', 'png')}`
data/graphit.gemspec CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
+ spec.add_dependency 'bin_utils'
25
+
24
26
  spec.add_development_dependency "bundler", "~> 1.9"
25
27
  spec.add_development_dependency "rake", "~> 10.0"
26
28
  end
@@ -1,3 +1,3 @@
1
1
  module Graphit
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/test-01.bmp CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffmcfadden
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bin_utils
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement