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 +4 -4
- data/README.md +7 -5
- data/exe/graphit +20 -2
- data/graphit.gemspec +2 -0
- data/lib/graphit/version.rb +1 -1
- data/test-01.bmp +0 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c584ee0d6942f0e076280c64c955bb7597788c
|
4
|
+
data.tar.gz: 7d54dd6e3cb3627d949ce1713ddd8d159bd34936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0abe0159731e42234cd8cf0aa26b12f0a150a6e405b71bcc1a32dad76feb7a6740a0563b41388ea2df6a9676213e5e99d26485a84cc63571d59ad46be461455a
|
7
|
+
data.tar.gz: 21ce985ca72ed248ebcf7723cfda8e3edb2245b00b39065c2028566e60031f98d0e9071148cd30eb603558ce033ad71e56d2e9916d112fe8c1acbd636b2ab9f7
|
data/README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# Graph It!
|
2
2
|
|
3
|
-
A very
|
3
|
+
A very basic graphing library that writes data to bmp images.
|
4
4
|
|
5
|
-
|
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
|
13
|
+
$ gem install graphit
|
12
14
|
|
13
15
|
## Usage
|
14
16
|
|
15
|
-
$
|
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(
|
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
|
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
|
data/lib/graphit/version.rb
CHANGED
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.
|
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
|