tabelr 0.0.4 → 0.0.5
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/lib/tabelr/table_formater.rb +1 -0
- data/stash +34 -0
- data/tabelr.gemspec +2 -1
- data/test/test.run +8 -0
- data/test/test_tabelr.rb +11 -0
- metadata +6 -6
- data/tabelr-0.0.1.gem +0 -0
- data/tabelr-0.0.2.gem +0 -0
- data/tabelr-0.0.3.gem +0 -0
- data/test/tabelr_test.rb +0 -10
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
|
+
|
data/tabelr.gemspec
CHANGED
@@ -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.
|
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
|
data/test/test.run
ADDED
@@ -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
|
+
+---------+----------------------+---------+------------------+
|
data/test/test_tabelr.rb
ADDED
@@ -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
|
+
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
|
-
-
|
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/
|
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
|
data/tabelr-0.0.1.gem
DELETED
Binary file
|
data/tabelr-0.0.2.gem
DELETED
Binary file
|
data/tabelr-0.0.3.gem
DELETED
Binary file
|
data/test/tabelr_test.rb
DELETED