golumn 0.0.1 → 0.0.2

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: 8c73ed3d843df030c81a8beb52873d8c5edd4d90
4
- data.tar.gz: bd2e49110f4fa22f2e06951a99090db2bd5545ad
3
+ metadata.gz: eb8564b943eb740140136bb19cdb603135aff55c
4
+ data.tar.gz: b27e55a0cae6e6fa89d988747b70714e57e18e4e
5
5
  SHA512:
6
- metadata.gz: a66292a087bc4b4ae486ccc00c9c3adc0a34cb52a6195abd8207be62a1c91df67fba1025d85a1d60d82c227452bebdead60285de9d0efd8487510517c565605c
7
- data.tar.gz: 2397ad24074dcfcf45597fdd4156e7bb2f5b68a875b058af03a32fcb6cac83ca4202fbdb49986ef03c821be38ff74f3a758fcba1a091361b591525dbb813ee63
6
+ metadata.gz: ee760e697904e34b8c2ba61088701e5bf979dd1d4ad1b361fc0044c171b2085ef6024d0ad90f8c3d3e0d40467779de5613e1631313663e21d75c3dbbad10b985
7
+ data.tar.gz: c3f387f15ac1bc6df75643d906544dfd5fa36d8a5ee9cbb36e2f8c596b0085ccd84a99400a6b95641fdf418bdccb625d3f3ae8e4babf4bfff95c64d0f3b1d5ab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- golumn (0.1.0)
4
+ golumn (0.0.2)
5
5
  rwx
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Golumn
2
2
 
3
- THIS DOESN'T WORK, YET!!! SORRY
4
-
5
3
  `column` command with a GUI.
6
4
 
7
5
  Are you tired of copy pasting data into Excel?!?
data/exe/golumn CHANGED
@@ -3,4 +3,6 @@
3
3
  require 'bundler/setup'
4
4
  require 'golumn'
5
5
 
6
- Golumn.main
6
+ Process.fork do
7
+ Golumn.main(io: ARGF)
8
+ end
@@ -3,12 +3,13 @@ require 'rwx'
3
3
 
4
4
  # internal libs
5
5
  require 'golumn/version'
6
+ require 'golumn/array_grid'
6
7
  require 'golumn/app'
7
8
 
8
9
  # GUI column, get it?!?
9
10
  module Golumn
10
11
  # start main loop
11
- def self.main
12
- App.new.main_loop
12
+ def self.main(io: nil)
13
+ App.new(io: io).main_loop
13
14
  end
14
15
  end
@@ -1,43 +1,21 @@
1
+ require 'csv'
2
+
1
3
  module Golumn
2
- # main app
4
+ # Main app window
3
5
  class App < WX::App
6
+ def initialize(io: ARGF)
7
+ @io = io
8
+ end
9
+
4
10
  def on_init
5
11
  @frame = WX::Frame.new(nil, title: 'widgets demo')
12
+ @frame.sizer = WX::BoxSizer.new(:vertical) do |box|
13
+ @grid = WX::Grid.new(@frame)
14
+ @grid.table = ArrayGrid.new(data: CSV.parse(@io.read))
15
+ box.add(@grid, expand: true)
16
+ end
6
17
  @frame.layout
7
18
  @frame.show
8
19
  end
9
-
10
- foo = <<-SQL
11
- grid = new wxGrid( this,
12
- -1,
13
- wxPoint( 0, 0 ),
14
- wxSize( 400, 300 ) );
15
- // Then we call CreateGrid to set the dimensions of the grid
16
- // (100 rows and 10 columns in this example)
17
- grid->CreateGrid( 100, 10 );
18
- // We can set the sizes of individual rows and columns
19
- // in pixels
20
- grid->SetRowSize( 0, 60 );
21
- grid->SetColSize( 0, 120 );
22
- // And set grid cell contents as strings
23
- grid->SetCellValue( 0, 0, "wxGrid is good" );
24
- // We can specify that some cells are read->only
25
- grid->SetCellValue( 0, 3, "This is read->only" );
26
- grid->SetReadOnly( 0, 3 );
27
- // Colours can be specified for grid cell contents
28
- grid->SetCellValue(3, 3, "green on grey");
29
- grid->SetCellTextColour(3, 3, *wxGREEN);
30
- grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
31
- // We can specify the some cells will store numeric
32
- // values rather than strings. Here we set grid column 5
33
- // to hold floating point values displayed with width of 6
34
- // and precision of 2
35
- grid->SetColFormatFloat(5, 6, 2);
36
- grid->SetCellValue(0, 6, "3.1415");
37
- SQL
38
-
39
- def build_grid
40
- @grid = WX::Grid.new(nil, WX::Point.new(0, 0), WX::Size.new(400, 300))
41
- end
42
20
  end
43
21
  end
@@ -0,0 +1,30 @@
1
+ require 'csv'
2
+
3
+ module Golumn
4
+ # main app
5
+ class ArrayGrid < WX::GridTable
6
+ def initialize(data:)
7
+ @data = data
8
+ end
9
+
10
+ def rows
11
+ @data.size
12
+ end
13
+
14
+ def cols
15
+ @data.first.size
16
+ end
17
+
18
+ def [](i, j)
19
+ @data[i][j]
20
+ end
21
+
22
+ def []=(i, j, value)
23
+ @data[i][j] = value
24
+ end
25
+
26
+ def typename(*_)
27
+ :string
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module Golumn
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: golumn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Pierce
@@ -88,6 +88,7 @@ files:
88
88
  - golumn.gemspec
89
89
  - lib/golumn.rb
90
90
  - lib/golumn/app.rb
91
+ - lib/golumn/array_grid.rb
91
92
  - lib/golumn/version.rb
92
93
  homepage: https://github.com/ddrscott/golumn
93
94
  licenses: