tabelr 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,6 +52,7 @@ module Tabelr
52
52
  output.printf "|\n"
53
53
  end
54
54
  output.printf divider
55
+ output.flush
55
56
  end
56
57
 
57
58
  def max a, b
data/stash ADDED
@@ -0,0 +1,34 @@
1
+
2
+ Allow STDIN/OUT to be used, how? Logger does out!
3
+
4
+
5
+ # file = File.open('result.json', 'r')
6
+ # result = JSON.parse(file.readlines.to_s)
7
+ # puts result
8
+
9
+ json = JSON.parse(File.read(args[0]))
10
+ output = File.open(args[1], 'w')
11
+
12
+
13
+
14
+ if __FILE__ == $0
15
+
16
+
17
+
18
+ def test_output
19
+ # output = <<END
20
+ # +---------+----------------------+---------+------------------+
21
+ # | column1 | column2 | column3 | column4 |
22
+ # +---------+----------------------+---------+------------------+
23
+ # | This | is | quite | cool! |
24
+ # | This | is the longest field | by far | 1241 |
25
+ # | Short | fields | fit | in |
26
+ # | other | eg | | 3322119999999999 |
27
+ # +---------+----------------------+---------+------------------+
28
+ # END
29
+
30
+ # ARGV[0] = 'test/example.json'
31
+ # Tabelr.run > 'test.run'
32
+ # assert_equal output, File.read('test.run')
33
+ # end
34
+
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = "tabelr"
3
3
  s.summary = "Creates neat aligned ascii tables from a json input"
4
4
  s.description = "Creates neat aligned ascii tables from a json input"
5
- s.version = "0.0.4"
5
+ s.version = "0.0.5"
6
6
  s.author = "Ian Vaughan"
7
7
  s.email = "tabelr@ianvaughan.co.uk"
8
8
  s.homepage = "http://ianvaughan.co.uk"
@@ -10,5 +10,6 @@ Gem::Specification.new do |s|
10
10
  s.required_ruby_version = '>=1.9'
11
11
  s.files = Dir['**/**']
12
12
  s.executables = [ 'tabelr' ]
13
+ s.test_files = Dir["test/test*.rb"]
13
14
  s.has_rdoc = false
14
15
  end
@@ -0,0 +1,8 @@
1
+ +---------+----------------------+---------+------------------+
2
+ | column1 | column2 | column3 | column4 |
3
+ +---------+----------------------+---------+------------------+
4
+ | This | is | quite | cool! |
5
+ | This | is the longest field | by far | 1241 |
6
+ | Short | fields | fit | in |
7
+ | other | eg | | 3322119999999999 |
8
+ +---------+----------------------+---------+------------------+
@@ -0,0 +1,11 @@
1
+ require "test/unit"
2
+ require_relative '../lib/tabelr'
3
+
4
+ class TestTabelr < Test::Unit::TestCase
5
+ def test_file
6
+ ARGV[0] = 'test/example.json'
7
+ ARGV[1] = 'test/test.run'
8
+ Tabelr.run
9
+ assert_equal File.read('test/output.txt'), File.read(ARGV[1])
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabelr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -22,13 +22,12 @@ files:
22
22
  - lib/tabelr/table_formater.rb
23
23
  - lib/tabelr.rb
24
24
  - README.md
25
- - tabelr-0.0.1.gem
26
- - tabelr-0.0.2.gem
27
- - tabelr-0.0.3.gem
25
+ - stash
28
26
  - tabelr.gemspec
29
27
  - test/example.json
30
28
  - test/output.txt
31
- - test/tabelr_test.rb
29
+ - test/test.run
30
+ - test/test_tabelr.rb
32
31
  homepage: http://ianvaughan.co.uk
33
32
  licenses: []
34
33
  post_install_message:
@@ -53,4 +52,5 @@ rubygems_version: 1.8.17
53
52
  signing_key:
54
53
  specification_version: 3
55
54
  summary: Creates neat aligned ascii tables from a json input
56
- test_files: []
55
+ test_files:
56
+ - test/test_tabelr.rb
Binary file
Binary file
Binary file
@@ -1,10 +0,0 @@
1
- require "test/unit"
2
-
3
- class TestString < Test::Unit::TestCase
4
- def test_camel_case
5
- input = "THIS IS A STRING"
6
- test = input.camelcase
7
- assert_equal "This Is A String", test
8
- assert_equal "THIS IS A STRING", input
9
- end
10
- end