csv2api 0.1.0 → 0.2.0

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: 245ac997c6252b30230fedf04586ccae04b2eeb1
4
- data.tar.gz: 3b886a7ad499db858d87ed66d3aa0463a0b3f358
3
+ metadata.gz: 8e0fe57af695687cfe5cb326dedce664a8d34947
4
+ data.tar.gz: 0addbe360902de50a6f53d25fa70c65cd746f070
5
5
  SHA512:
6
- metadata.gz: 7ce4141c440da7152fb6001c324c906ad4d09f87e4c586ba1ffeadc14401d275adfcff45cdbc4c9088eb3203b007fa72a54439d75af83fc72aa5caab8dc59962
7
- data.tar.gz: dc99410e6be1d4f1d9c076d40584bf79f508385213d3908555a07c32e0296b4572ca69a659fce2a5df52d6ad4b84d1f475bbc075aff26f047c7295b050df063c
6
+ metadata.gz: ebda46032070b20b0c90584f0c01d4cf58985d5486e44eae1c7b50589ecfe411d1e5f7b242dab3843538a061e24933f738c01b9244f096875249e2af859b6dc1
7
+ data.tar.gz: 69ca355359f88908e667bc5a88017f09f30760a1e1a73ce2d611b982dbbeb65f1f1cdfe769142925440cce9ccf58bc366b96337ca2d1b033709a93bdbee4793e
data/Changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CSV2API Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ Released August 21, 2014 ([0.2.0](https://github.com/jonahoffline/csv2api/tree/v0.2.0)).
6
+
7
+ * Add Spreadsheet (Excel-like data-grid) view
8
+ * Add index template to list available endpoints
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  Released June 3, 2014 ([0.1.0](https://github.com/jonahoffline/csv2api/tree/v0.1.0)).
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
- # CSV2API
1
+ # CSV2API
2
2
  [![Build Status](https://travis-ci.org/jonahoffline/csv2api.svg)](https://travis-ci.org/jonahoffline/csv2api)
3
3
  [![Gem Version](https://badge.fury.io/rb/csv2api.svg)](http://badge.fury.io/rb/csv2api)
4
4
  [![Dependency Status](https://gemnasium.com/jonahoffline/csv2api.svg)](https://gemnasium.com/jonahoffline/csv2api)
5
5
  [![Code Climate](https://codeclimate.com/github/jonahoffline/csv2api.png)](https://codeclimate.com/github/jonahoffline/csv2api)
6
- [![Inline docs](http://inch-pages.github.io/github/jonahoffline/csv2api.png)](http://inch-pages.github.io/github/jonahoffline/csv2api)
6
+ [![Inline docs](http://inch-ci.org/github/jonahoffline/csv2api.png)](http://inch-ci.org/github/jonahoffline/csv2api)
7
+ [![Gitter chat](https://badges.gitter.im/jonahoffline/csv2api.png)](https://gitter.im/jonahoffline/csv2api)
7
8
 
8
9
  Auto-create json and xml APIs from csv files. Instant endpoints without any hassle.
9
10
 
@@ -36,7 +37,11 @@ tasks.csv - http://localhost:3000/tasks
36
37
  weather.csv - http://localhost:3000/weather
37
38
  ```
38
39
 
39
- **Note**: Endpoints can be accessed with the filename or their `.json`, `.xml` extensions.
40
+ **Note**: Endpoints can be accessed with the filename (spreadsheet view) or their `.json`, `.xml` extensions.
41
+
42
+ #### Spreadsheet View
43
+
44
+ ![csv2api_small](https://cloud.githubusercontent.com/assets/1783738/4006127/840daa30-29a2-11e4-81c2-249c3dc91d8c.png)
40
45
 
41
46
  ### Load a specific folder
42
47
  $csv2api -d office_stuff/sad_csvs/
@@ -52,11 +57,16 @@ Options:
52
57
  __Soon__
53
58
  - [ ] Load single files
54
59
  - [ ] REST Support
55
- - [ ] WebUI
60
+ - [x] WebUI
56
61
 
57
62
  ## Author
58
63
  * [Jonah Ruiz](http://www.pixelhipsters.com)
59
64
 
65
+ ## Discussion
66
+ If you have any questions, ideas or a good joke:
67
+
68
+ [![Gitter chat](https://badges.gitter.im/jonahoffline/csv2api.png)](https://gitter.im/jonahoffline/csv2api)
69
+
60
70
  ## Contributing
61
71
 
62
72
  Is it worth it? let me fork it
data/lib/csv2api.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'csv2api/version'
2
2
  require 'csv2api/utils'
3
3
  require 'csv2api/parser'
4
+ require 'active_support'
4
5
  require 'active_support/core_ext'
5
6
 
6
7
  # @author Jonah Ruiz <jonah@pixelhipsters.com>
@@ -0,0 +1,623 @@
1
+ /**
2
+ * Handsontable 0.11.0-beta3
3
+ * Handsontable is a simple jQuery plugin for editable tables with basic copy-paste compatibility with Excel and Google Docs
4
+ *
5
+ * Copyright 2012-2014 Marcin Warpechowski
6
+ * Licensed under the MIT license.
7
+ * http://handsontable.com/
8
+ *
9
+ * Date: Fri Jul 25 2014 11:41:59 GMT+0200 (CEST)
10
+ */
11
+
12
+ .handsontable {
13
+ position: relative;
14
+ }
15
+
16
+ .handsontable .relative {
17
+ position: relative;
18
+ }
19
+
20
+ .handsontable.htAutoColumnSize {
21
+ visibility: hidden;
22
+ left: 0;
23
+ position: absolute;
24
+ top: 0;
25
+ }
26
+
27
+ .handsontable table,
28
+ .handsontable tbody,
29
+ .handsontable thead,
30
+ .handsontable td,
31
+ .handsontable th,
32
+ .handsontable div {
33
+ box-sizing: content-box;
34
+ -webkit-box-sizing: content-box;
35
+ -moz-box-sizing: content-box;
36
+ }
37
+
38
+ .handsontable table.htCore {
39
+ border-collapse: separate;
40
+ /*it must be separate, otherwise there are offset miscalculations in WebKit: http://stackoverflow.com/questions/2655987/border-collapse-differences-in-ff-and-webkit*/
41
+ position: relative;
42
+ /*this actually only changes appearance of user selection - does not make text unselectable
43
+ -webkit-user-select: none;
44
+ -khtml-user-select: none;
45
+ -moz-user-select: none;
46
+ -o-user-select: none;
47
+ -ms-user-select: none;
48
+ /*user-select: none; /*no browser supports unprefixed version*/
49
+ border-spacing: 0;
50
+ margin: 0;
51
+ border-width: 0;
52
+ table-layout: fixed;
53
+ width: 0;
54
+ outline-width: 0;
55
+ /* reset bootstrap table style. for more info see: https://github.com/handsontable/jquery-handsontable/issues/224 */
56
+ max-width: none;
57
+ max-height: none;
58
+ }
59
+
60
+ .handsontable col {
61
+ width: 50px;
62
+ }
63
+
64
+ .handsontable col.rowHeader {
65
+ width: 50px;
66
+ }
67
+
68
+ .handsontable th,
69
+ .handsontable td {
70
+ border-right: 1px solid #CCC;
71
+ border-bottom: 1px solid #CCC;
72
+ height: 22px;
73
+ empty-cells: show;
74
+ line-height: 21px;
75
+ padding: 0 4px 0 4px;
76
+ /* top, bottom padding different than 0 is handled poorly by FF with HTML5 doctype */
77
+ background-color: #FFF;
78
+ vertical-align: top;
79
+ overflow: hidden;
80
+ outline-width: 0;
81
+ white-space: pre-line;
82
+ /* preserve new line character in cell */
83
+ }
84
+
85
+ .handsontable td.htInvalid {
86
+ -webkit-transition: background 0.75s ease;
87
+ transition: background 0.75s ease;
88
+ background-color: #ff4c42;
89
+ }
90
+
91
+ .handsontable td.htNoWrap {
92
+ white-space: nowrap;
93
+ }
94
+
95
+ .handsontable th:last-child {
96
+ /*Foundation framework fix*/
97
+ border-right: 1px solid #CCC;
98
+ border-bottom: 1px solid #CCC;
99
+ }
100
+
101
+ .handsontable tr:first-child th.htNoFrame,
102
+ .handsontable th:first-child.htNoFrame,
103
+ .handsontable th.htNoFrame {
104
+ border-left-width: 0;
105
+ background-color: white;
106
+ border-color: #FFF;
107
+ }
108
+
109
+ .handsontable th:first-child,
110
+ .handsontable td:first-child,
111
+ .handsontable .htNoFrame + th,
112
+ .handsontable .htNoFrame + td {
113
+ border-left: 1px solid #CCC;
114
+ }
115
+
116
+ .handsontable tr:first-child th,
117
+ .handsontable tr:first-child td {
118
+ border-top: 1px solid #CCC;
119
+ }
120
+
121
+ .handsontable thead tr:last-child th {
122
+ border-bottom-width: 0;
123
+ }
124
+
125
+ .handsontable thead tr.lastChild th {
126
+ border-bottom-width: 0;
127
+ }
128
+
129
+ .handsontable th {
130
+ background-color: #EEE;
131
+ color: #222;
132
+ text-align: center;
133
+ font-weight: normal;
134
+ white-space: nowrap;
135
+ }
136
+
137
+ .handsontable thead th {
138
+ padding: 0;
139
+ }
140
+
141
+ .handsontable th.active {
142
+ background-color: #CCC;
143
+ }
144
+
145
+ .handsontable thead th .relative {
146
+ padding: 2px 4px;
147
+ }
148
+
149
+ /* plugins */
150
+
151
+ .handsontable .manualColumnMover {
152
+ position: absolute;
153
+ left: 0;
154
+ top: 0;
155
+ background-color: transparent;
156
+ width: 5px;
157
+ height: 25px;
158
+ z-index: 999;
159
+ cursor: move;
160
+ }
161
+
162
+ .handsontable .manualRowMover {
163
+ position: absolute;
164
+ left: -4px;
165
+ top: 0;
166
+ background-color: transparent;
167
+ height: 5px;
168
+ width: 50px;
169
+ z-index: 999;
170
+ cursor: move;
171
+ }
172
+
173
+ .handsontable .manualColumnMover:hover,
174
+ .handsontable .manualColumnMover.active,
175
+ .handsontable .manualRowMover:hover,
176
+ .handsontable .manualRowMover.active{
177
+ background-color: #88F;
178
+ }
179
+
180
+ /* row + column resizer*/
181
+
182
+ .handsontable .manualColumnResizer {
183
+ position: absolute;
184
+ top: 0;
185
+ cursor: col-resize;
186
+ z-index: 100;
187
+ }
188
+
189
+ .handsontable .manualColumnResizerHandle {
190
+ background-color: transparent;
191
+ width: 5px;
192
+ height: 25px;
193
+ }
194
+
195
+ .handsontable .manualRowResizer {
196
+ position: absolute;
197
+ left: 0;
198
+ cursor: row-resize;
199
+ z-index: 100;
200
+ }
201
+
202
+ .handsontable .manualRowResizerHandle {
203
+ background-color: transparent;
204
+ height: 5px;
205
+ width: 50px;
206
+ }
207
+
208
+ .handsontable .manualColumnResizer:hover .manualColumnResizerHandle,
209
+ .handsontable .manualColumnResizer.active .manualColumnResizerHandle,
210
+ .handsontable .manualRowResizer:hover .manualRowResizerHandle,
211
+ .handsontable .manualRowResizer.active .manualRowResizerHandle {
212
+ background-color: #AAB;
213
+ }
214
+
215
+ .handsontable .manualColumnResizerLine {
216
+ position: absolute;
217
+ right: 0;
218
+ top: 0;
219
+ background-color: #AAB;
220
+ display: none;
221
+ width: 0;
222
+ border-right: 1px dashed #777;
223
+ }
224
+
225
+ .handsontable .manualRowResizerLine {
226
+ position: absolute;
227
+ left: 0;
228
+ bottom: 0;
229
+ background-color: #AAB;
230
+ display: none;
231
+ width: 0;
232
+ border-bottom: 1px dashed #777;
233
+ }
234
+
235
+ .handsontable .manualColumnResizer.active .manualColumnResizerLine,
236
+ .handsontable .manualRowResizer.active .manualRowResizerLine {
237
+ display: block;
238
+ }
239
+
240
+ .handsontable .columnSorting:hover {
241
+ text-decoration: underline;
242
+ cursor: pointer;
243
+ }
244
+
245
+ /* border line */
246
+
247
+ .handsontable .wtBorder {
248
+ position: absolute;
249
+ font-size: 0;
250
+ }
251
+ .handsontable .wtBorder.hidden{
252
+ display:none !important;
253
+ }
254
+
255
+ .handsontable td.area {
256
+ background-color: #EEF4FF;
257
+ }
258
+
259
+ /* fill handle */
260
+
261
+ .handsontable .wtBorder.corner {
262
+ font-size: 0;
263
+ cursor: crosshair;
264
+ }
265
+
266
+ .handsontable .htBorder.htFillBorder {
267
+ background: red;
268
+ width: 1px;
269
+ height: 1px;
270
+ }
271
+
272
+ .handsontableInput {
273
+ border: 2px solid #5292F7;
274
+ outline-width: 0;
275
+ margin: 0;
276
+ padding: 1px 4px 0 2px;
277
+ font-family: Arial, Helvetica, sans-serif;
278
+ /*repeat from .handsontable (inherit doesn't work with IE<8) */
279
+ line-height: 1.3em;
280
+ /*repeat from .handsontable (inherit doesn't work with IE<8) */
281
+ font-size: inherit;
282
+ -webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
283
+ box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
284
+ resize: none;
285
+ /*below are needed to overwrite stuff added by jQuery UI Bootstrap theme*/
286
+ display: inline-block;
287
+ color: #000;
288
+ border-radius: 0;
289
+ background-color: #FFF;
290
+ /*overwrite styles potentionally made by a framework*/
291
+ }
292
+
293
+ .handsontableInputHolder {
294
+ position: absolute;
295
+ top: 0;
296
+ left: 0;
297
+ z-index: 100;
298
+ }
299
+
300
+ .htSelectEditor {
301
+ -webkit-appearance: menulist-button !important;
302
+ position: absolute;
303
+ }
304
+
305
+ /*
306
+ TextRenderer readOnly cell
307
+ */
308
+
309
+ .handsontable .htDimmed {
310
+ color: #777;
311
+ }
312
+
313
+ /*
314
+ TextRenderer horizontal alignment
315
+ */
316
+ .handsontable .htLeft{
317
+ text-align: left;
318
+ }
319
+ .handsontable .htCenter{
320
+ text-align: center;
321
+ }
322
+ .handsontable .htRight{
323
+ text-align: right;
324
+ }
325
+ .handsontable .htJustify{
326
+ text-align: justify;
327
+ }
328
+ /*
329
+ TextRenderer vertical alignment
330
+ */
331
+ .handsontable .htTop{
332
+ vertical-align: top;
333
+ }
334
+ .handsontable .htMiddle{
335
+ vertical-align: middle;
336
+ }
337
+ .handsontable .htBottom{
338
+ vertical-align: bottom;
339
+ }
340
+
341
+ /*
342
+ TextRenderer placeholder value
343
+ */
344
+
345
+ .handsontable .htPlaceholder {
346
+ color: #999;
347
+ }
348
+
349
+ /*
350
+ AutocompleteRenderer down arrow
351
+ */
352
+
353
+ .handsontable .htAutocompleteArrow {
354
+ float: right;
355
+ font-size: 10px;
356
+ color: #EEE;
357
+ cursor: default;
358
+ width: 16px;
359
+ text-align: center;
360
+ }
361
+
362
+ .handsontable td .htAutocompleteArrow:hover {
363
+ color: #777;
364
+ }
365
+
366
+ /*
367
+ CheckboxRenderer
368
+ */
369
+
370
+ .handsontable .htCheckboxRendererInput.noValue {
371
+ opacity: 0.5;
372
+ }
373
+
374
+ /*
375
+ NumericRenderer
376
+ */
377
+
378
+ .handsontable .htNumeric {
379
+ text-align: right;
380
+ }
381
+
382
+ /*
383
+ Comment For Cell
384
+ */
385
+ .htCommentCell{
386
+ position: relative;
387
+ }
388
+ .htCommentCell:after{
389
+ content: '';
390
+ position: absolute;
391
+ top: 0;
392
+ right: 0;
393
+ border-left: 6px solid transparent;
394
+ /*border-right: 5px solid transparent;*/
395
+
396
+ border-top: 6px solid red;
397
+ }
398
+
399
+ /*context menu rules*/
400
+
401
+ ul.context-menu-list {
402
+ color: black;
403
+ }
404
+
405
+ ul.context-menu-list li {
406
+ margin-bottom: 0;
407
+ /*Foundation framework fix*/
408
+ }
409
+
410
+ /**
411
+ * Handsontable in Handsontable
412
+ */
413
+
414
+ .handsontable .handsontable .wtHider {
415
+ padding: 0 0 5px 0;
416
+ }
417
+
418
+ .handsontable .handsontable table {
419
+ -webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
420
+ box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
421
+ }
422
+
423
+ /**
424
+ * Autocomplete Editor
425
+ */
426
+ .handsontable .autocompleteEditor.handsontable {
427
+ padding-right: 15px;
428
+ }
429
+
430
+ /**
431
+ * Handsontable listbox theme
432
+ */
433
+
434
+ .handsontable.listbox {
435
+ margin: 0;
436
+ }
437
+
438
+ .handsontable.listbox .ht_master table {
439
+ border: 1px solid #ccc;
440
+ border-collapse: separate;
441
+ background: white;
442
+ }
443
+
444
+ .handsontable.listbox th,
445
+ .handsontable.listbox tr:first-child th,
446
+ .handsontable.listbox tr:last-child th,
447
+ .handsontable.listbox tr:first-child td,
448
+ .handsontable.listbox td {
449
+ border-width: 0;
450
+ }
451
+
452
+ .handsontable.listbox th,
453
+ .handsontable.listbox td {
454
+ white-space: nowrap;
455
+ text-overflow: ellipsis;
456
+ }
457
+
458
+ .handsontable.listbox td.htDimmed {
459
+ cursor: default;
460
+ color: inherit;
461
+ font-style: inherit;
462
+ }
463
+
464
+ .handsontable.listbox .wtBorder {
465
+ visibility: hidden;
466
+ }
467
+
468
+ .handsontable.listbox tr td.current,
469
+ .handsontable.listbox tr:hover td {
470
+ background: #eee;
471
+ }
472
+
473
+ .htContextMenu {
474
+ display: none;
475
+ position: absolute;
476
+ }
477
+
478
+ .htContextMenu .ht_clone_top,
479
+ .htContextMenu .ht_clone_left,
480
+ .htContextMenu .ht_clone_corner {
481
+ display: none;
482
+ }
483
+
484
+ .htContextMenu table.htCore {
485
+ outline: 1px solid #bbb;
486
+ }
487
+
488
+ .htContextMenu .wtBorder {
489
+ visibility: hidden;
490
+ }
491
+
492
+ .htContextMenu table tbody tr td {
493
+ background: white;
494
+ border-width: 0;
495
+ padding: 4px 6px 0px 6px;
496
+ cursor: pointer;
497
+ overflow: hidden;
498
+ white-space: nowrap;
499
+ text-overflow: ellipsis;
500
+ }
501
+
502
+ .htContextMenu table tbody tr td:first-child {
503
+ border: 0;
504
+ }
505
+
506
+ .htContextMenu table tbody tr td.htDimmed{
507
+ font-style: normal;
508
+ color: #323232;
509
+ }
510
+
511
+ .htContextMenu table tbody tr td.current{
512
+ background: rgb(233, 233, 233);
513
+ }
514
+
515
+ .htContextMenu table tbody tr td.htSeparator {
516
+ border-top: 1px solid #bbb;
517
+ height: 0;
518
+ padding: 0;
519
+ }
520
+
521
+ .htContextMenu table tbody tr td.htDisabled {
522
+ color: #999;
523
+ }
524
+
525
+ .htContextMenu table tbody tr td.htDisabled:hover {
526
+ background: white;
527
+ color: #999;
528
+ cursor: default;
529
+ }
530
+
531
+ .htContextMenu button{
532
+ color: #fff;
533
+ font-size: 12px;
534
+ line-height: 12px;
535
+ height: 20px;
536
+ padding: 0 5px;
537
+ margin: 0 1px 0 0;
538
+ margin-bottom: 5px;
539
+ }
540
+ .htContextMenu button:first-child{
541
+ border-top-left-radius: 5px;
542
+ border-bottom-left-radius: 5px;
543
+ }
544
+ .htContextMenu button:last-child{
545
+ border-top-right-radius: 5px;
546
+ border-bottom-right-radius: 5px;
547
+ }
548
+ .handsontable td.htSearchResult {
549
+ background: #fcedd9;
550
+ color: #583707;
551
+ }
552
+
553
+ /*
554
+ Cell borders
555
+ */
556
+ .htBordered{
557
+ /*box-sizing: border-box !important;*/
558
+ border-width: 1px;
559
+ }
560
+ .htBordered.htTopBorderSolid{
561
+ border-top-style: solid;
562
+ border-top-color: #000;
563
+ }
564
+ .htBordered.htRightBorderSolid{
565
+ border-right-style: solid;
566
+ border-right-color: #000;
567
+ }
568
+ .htBordered.htBottomBorderSolid{
569
+ border-bottom-style: solid;
570
+ border-bottom-color: #000;
571
+ }
572
+ .htBordered.htLeftBorderSolid{
573
+ border-left-style: solid;
574
+ border-left-color: #000;
575
+ }
576
+
577
+ /*WalkontableDebugOverlay*/
578
+
579
+ .wtDebugHidden {
580
+ display: none;
581
+ }
582
+
583
+ .wtDebugVisible {
584
+ display: block;
585
+ -webkit-animation-duration: 0.5s;
586
+ -webkit-animation-name: wtFadeInFromNone;
587
+ animation-duration: 0.5s;
588
+ animation-name: wtFadeInFromNone;
589
+ }
590
+
591
+ @keyframes wtFadeInFromNone {
592
+ 0% {
593
+ display: none;
594
+ opacity: 0;
595
+ }
596
+
597
+ 1% {
598
+ display: block;
599
+ opacity: 0;
600
+ }
601
+
602
+ 100% {
603
+ display: block;
604
+ opacity: 1;
605
+ }
606
+ }
607
+
608
+ @-webkit-keyframes wtFadeInFromNone {
609
+ 0% {
610
+ display: none;
611
+ opacity: 0;
612
+ }
613
+
614
+ 1% {
615
+ display: block;
616
+ opacity: 0;
617
+ }
618
+
619
+ 100% {
620
+ display: block;
621
+ opacity: 1;
622
+ }
623
+ }