greentable 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- greentable (0.9.0)
4
+ greentable (0.9.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -36,6 +36,13 @@ GEM
36
36
  arel (3.0.3)
37
37
  builder (3.0.4)
38
38
  coderay (1.0.9)
39
+ coveralls (0.7.0)
40
+ multi_json (~> 1.3)
41
+ rest-client
42
+ simplecov (>= 0.7)
43
+ term-ansicolor
44
+ thor
45
+ docile (1.1.3)
39
46
  erubis (2.7.0)
40
47
  fastercsv (1.5.5)
41
48
  ffi (1.9.0)
@@ -105,6 +112,13 @@ GEM
105
112
  ffi (>= 0.5.0)
106
113
  rdoc (3.12.2)
107
114
  json (~> 1.4)
115
+ rest-client (1.6.7)
116
+ mime-types (>= 1.16)
117
+ simplecov (0.8.2)
118
+ docile (~> 1.1.0)
119
+ multi_json
120
+ simplecov-html (~> 0.8.0)
121
+ simplecov-html (0.8.0)
108
122
  slop (3.4.6)
109
123
  sprockets (2.2.2)
110
124
  hike (~> 1.2)
@@ -112,9 +126,12 @@ GEM
112
126
  rack (~> 1.0)
113
127
  tilt (~> 1.1, != 1.3.0)
114
128
  sqlite3 (1.3.9)
129
+ term-ansicolor (1.3.0)
130
+ tins (~> 1.0)
115
131
  test-unit (2.5.5)
116
132
  thor (0.19.1)
117
133
  tilt (1.4.1)
134
+ tins (1.0.1)
118
135
  treetop (1.4.15)
119
136
  polyglot
120
137
  polyglot (>= 0.3.1)
@@ -124,6 +141,7 @@ PLATFORMS
124
141
  ruby
125
142
 
126
143
  DEPENDENCIES
144
+ coveralls
127
145
  fastercsv
128
146
  greentable!
129
147
  guard-test
@@ -131,5 +149,6 @@ DEPENDENCIES
131
149
  nokogiri
132
150
  rack-test
133
151
  rails (~> 3.2.17)
152
+ simplecov
134
153
  sqlite3
135
154
  test-unit
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  [![Build Status](https://travis-ci.org/waelchatila/greentable.svg?branch=master)](https://travis-ci.org/waelchatila/greentable)
2
+ [![Coverage Status](https://coveralls.io/repos/waelchatila/greentable/badge.png?branch=master)](https://coveralls.io/r/waelchatila/greentable?branch=master)
3
+ [![Gem Version](https://badge.fury.io/rb/greentable.png)](http://badge.fury.io/rb/greentable)
2
4
  Greentable
3
5
  ==========
4
6
  Greentable produces HTML tables from an array without you having to deal with any HTML elements.
data/greentable.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "fastercsv"
26
26
  spec.add_development_dependency "guard-test"
27
27
  spec.add_development_dependency "rack-test"
28
- #spec.add_development_dependency 'simplecov'
29
- #spec.add_development_dependency 'coveralls'
28
+ spec.add_development_dependency 'simplecov'
29
+ spec.add_development_dependency 'coveralls'
30
30
  end
31
31
 
32
32
 
@@ -13,7 +13,7 @@ module Greentable
13
13
  end
14
14
 
15
15
  def _call(env)
16
- status, headers, response = @app.call(env) rescue nil
16
+ status, headers, response = @app.call(env)
17
17
  greentable_export = (env['QUERY_STRING'] || '').scan(/greentable_export=([csv|print]+)/i)[0][0] rescue nil
18
18
  if greentable_export
19
19
  request = Rack::Request.new(env)
@@ -1,3 +1,3 @@
1
1
  module Greentable
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -1879,3 +1879,240 @@ Processing by ApplicationController#home as HTML
1879
1879
  Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
1880
1880
  Completed 200 OK in 1.3ms (Views: 1.2ms | ActiveRecord: 0.0ms)
1881
1881
   (0.0ms) rollback transaction
1882
+ Connecting to database specified by database.yml
1883
+  (0.4ms) begin transaction
1884
+  (0.0ms) rollback transaction
1885
+  (0.0ms) begin transaction
1886
+  (0.0ms) rollback transaction
1887
+  (0.0ms) begin transaction
1888
+  (0.0ms) rollback transaction
1889
+  (0.0ms) begin transaction
1890
+  (0.0ms) rollback transaction
1891
+  (0.0ms) begin transaction
1892
+  (0.0ms) rollback transaction
1893
+  (0.0ms) begin transaction
1894
+  (0.0ms) rollback transaction
1895
+  (0.0ms) begin transaction
1896
+  (0.0ms) rollback transaction
1897
+  (0.0ms) begin transaction
1898
+ Started GET "/" for 127.0.0.1 at 2014-03-30 01:44:36 +0100
1899
+ Processing by ApplicationController#home as HTML
1900
+ Rendered application/home.html.erb within layouts/application (2.1ms)
1901
+ Completed 200 OK in 9.3ms (Views: 9.0ms | ActiveRecord: 0.0ms)
1902
+  (0.1ms) rollback transaction
1903
+  (0.0ms) begin transaction
1904
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-30 01:44:36 +0100
1905
+ Processing by ApplicationController#home as HTML
1906
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
1907
+ Completed 200 OK in 1.7ms (Views: 1.5ms | ActiveRecord: 0.0ms)
1908
+  (0.0ms) rollback transaction
1909
+  (0.0ms) begin transaction
1910
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-30 01:44:36 +0100
1911
+ Processing by ApplicationController#home as HTML
1912
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
1913
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
1914
+  (0.1ms) rollback transaction
1915
+ Connecting to database specified by database.yml
1916
+  (0.3ms) begin transaction
1917
+  (0.0ms) rollback transaction
1918
+  (0.0ms) begin transaction
1919
+  (0.0ms) rollback transaction
1920
+  (0.0ms) begin transaction
1921
+  (0.0ms) rollback transaction
1922
+  (0.0ms) begin transaction
1923
+  (0.0ms) rollback transaction
1924
+  (0.0ms) begin transaction
1925
+  (0.0ms) rollback transaction
1926
+  (0.0ms) begin transaction
1927
+  (0.0ms) rollback transaction
1928
+  (0.0ms) begin transaction
1929
+  (0.0ms) rollback transaction
1930
+  (0.0ms) begin transaction
1931
+ Started GET "/" for 127.0.0.1 at 2014-03-30 01:45:00 +0100
1932
+ Processing by ApplicationController#home as HTML
1933
+ Rendered application/home.html.erb within layouts/application (2.0ms)
1934
+ Completed 200 OK in 31.9ms (Views: 31.6ms | ActiveRecord: 0.0ms)
1935
+  (0.1ms) rollback transaction
1936
+  (0.0ms) begin transaction
1937
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-30 01:45:00 +0100
1938
+ Processing by ApplicationController#home as HTML
1939
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
1940
+ Completed 200 OK in 1.7ms (Views: 1.6ms | ActiveRecord: 0.0ms)
1941
+  (0.1ms) rollback transaction
1942
+  (0.0ms) begin transaction
1943
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-30 01:45:00 +0100
1944
+ Processing by ApplicationController#home as HTML
1945
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
1946
+ Completed 200 OK in 1.3ms (Views: 1.2ms | ActiveRecord: 0.0ms)
1947
+  (0.1ms) rollback transaction
1948
+ Connecting to database specified by database.yml
1949
+  (0.3ms) begin transaction
1950
+  (0.0ms) rollback transaction
1951
+  (0.0ms) begin transaction
1952
+  (0.0ms) rollback transaction
1953
+  (0.0ms) begin transaction
1954
+  (0.0ms) rollback transaction
1955
+  (0.0ms) begin transaction
1956
+  (0.0ms) rollback transaction
1957
+  (0.0ms) begin transaction
1958
+  (0.0ms) rollback transaction
1959
+  (0.0ms) begin transaction
1960
+  (0.0ms) rollback transaction
1961
+  (0.0ms) begin transaction
1962
+  (0.0ms) rollback transaction
1963
+  (0.0ms) begin transaction
1964
+ Started GET "/" for 127.0.0.1 at 2014-03-30 01:45:12 +0100
1965
+ Processing by ApplicationController#home as HTML
1966
+ Rendered application/home.html.erb within layouts/application (2.0ms)
1967
+ Completed 200 OK in 30.4ms (Views: 30.1ms | ActiveRecord: 0.0ms)
1968
+  (0.1ms) rollback transaction
1969
+  (0.0ms) begin transaction
1970
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-30 01:45:12 +0100
1971
+ Processing by ApplicationController#home as HTML
1972
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
1973
+ Completed 200 OK in 1.6ms (Views: 1.4ms | ActiveRecord: 0.0ms)
1974
+  (0.1ms) rollback transaction
1975
+  (0.0ms) begin transaction
1976
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-30 01:45:12 +0100
1977
+ Processing by ApplicationController#home as HTML
1978
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
1979
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
1980
+  (0.1ms) rollback transaction
1981
+ Connecting to database specified by database.yml
1982
+  (3.2ms) begin transaction
1983
+  (0.0ms) rollback transaction
1984
+  (0.0ms) begin transaction
1985
+  (0.0ms) rollback transaction
1986
+  (0.0ms) begin transaction
1987
+  (0.0ms) rollback transaction
1988
+  (0.0ms) begin transaction
1989
+  (0.0ms) rollback transaction
1990
+  (0.0ms) begin transaction
1991
+  (0.1ms) rollback transaction
1992
+  (0.0ms) begin transaction
1993
+  (0.1ms) rollback transaction
1994
+  (0.0ms) begin transaction
1995
+  (0.1ms) rollback transaction
1996
+  (0.0ms) begin transaction
1997
+  (0.1ms) rollback transaction
1998
+  (0.0ms) begin transaction
1999
+ Started GET "/" for 127.0.0.1 at 2014-03-31 11:25:37 +0200
2000
+ Processing by ApplicationController#home as HTML
2001
+ Rendered application/home.html.erb within layouts/application (2.5ms)
2002
+ Completed 200 OK in 11.7ms (Views: 11.4ms | ActiveRecord: 0.0ms)
2003
+  (0.1ms) rollback transaction
2004
+  (0.0ms) begin transaction
2005
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-31 11:25:37 +0200
2006
+ Processing by ApplicationController#home as HTML
2007
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
2008
+ Completed 200 OK in 1.7ms (Views: 1.5ms | ActiveRecord: 0.0ms)
2009
+  (0.1ms) rollback transaction
2010
+  (0.0ms) begin transaction
2011
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-31 11:25:37 +0200
2012
+ Processing by ApplicationController#home as HTML
2013
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
2014
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
2015
+  (0.0ms) rollback transaction
2016
+ Connecting to database specified by database.yml
2017
+  (0.3ms) begin transaction
2018
+  (0.0ms) rollback transaction
2019
+  (0.0ms) begin transaction
2020
+  (0.0ms) rollback transaction
2021
+  (0.0ms) begin transaction
2022
+  (0.0ms) rollback transaction
2023
+  (0.0ms) begin transaction
2024
+  (0.0ms) rollback transaction
2025
+  (0.0ms) begin transaction
2026
+  (0.0ms) rollback transaction
2027
+  (0.0ms) begin transaction
2028
+  (0.0ms) rollback transaction
2029
+  (0.0ms) begin transaction
2030
+  (0.0ms) rollback transaction
2031
+  (0.0ms) begin transaction
2032
+ Started GET "/" for 127.0.0.1 at 2014-03-31 11:26:12 +0200
2033
+ Processing by ApplicationController#home as HTML
2034
+ Rendered application/home.html.erb within layouts/application (2.1ms)
2035
+ Completed 200 OK in 30.2ms (Views: 29.9ms | ActiveRecord: 0.0ms)
2036
+  (0.1ms) rollback transaction
2037
+  (0.0ms) begin transaction
2038
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-31 11:26:12 +0200
2039
+ Processing by ApplicationController#home as HTML
2040
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
2041
+ Completed 200 OK in 1.5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
2042
+  (0.0ms) rollback transaction
2043
+  (0.1ms) begin transaction
2044
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-31 11:26:12 +0200
2045
+ Processing by ApplicationController#home as HTML
2046
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
2047
+ Completed 200 OK in 1.5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
2048
+  (0.0ms) rollback transaction
2049
+ Connecting to database specified by database.yml
2050
+  (0.3ms) begin transaction
2051
+  (0.0ms) rollback transaction
2052
+  (0.0ms) begin transaction
2053
+  (0.1ms) rollback transaction
2054
+  (0.0ms) begin transaction
2055
+  (0.0ms) rollback transaction
2056
+  (0.0ms) begin transaction
2057
+  (0.0ms) rollback transaction
2058
+  (0.2ms) begin transaction
2059
+  (0.0ms) rollback transaction
2060
+  (0.0ms) begin transaction
2061
+  (0.0ms) rollback transaction
2062
+  (0.0ms) begin transaction
2063
+  (0.0ms) rollback transaction
2064
+  (0.0ms) begin transaction
2065
+  (0.0ms) rollback transaction
2066
+  (0.0ms) begin transaction
2067
+ Started GET "/" for 127.0.0.1 at 2014-03-31 11:26:48 +0200
2068
+ Processing by ApplicationController#home as HTML
2069
+ Rendered application/home.html.erb within layouts/application (1.8ms)
2070
+ Completed 200 OK in 9.5ms (Views: 9.1ms | ActiveRecord: 0.0ms)
2071
+  (0.1ms) rollback transaction
2072
+  (0.0ms) begin transaction
2073
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-31 11:26:48 +0200
2074
+ Processing by ApplicationController#home as HTML
2075
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
2076
+ Completed 200 OK in 1.6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
2077
+  (0.1ms) rollback transaction
2078
+  (0.0ms) begin transaction
2079
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-31 11:26:48 +0200
2080
+ Processing by ApplicationController#home as HTML
2081
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
2082
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
2083
+  (0.1ms) rollback transaction
2084
+ Connecting to database specified by database.yml
2085
+  (0.3ms) begin transaction
2086
+  (0.0ms) rollback transaction
2087
+  (0.1ms) begin transaction
2088
+  (0.0ms) rollback transaction
2089
+  (0.0ms) begin transaction
2090
+  (0.0ms) rollback transaction
2091
+  (0.0ms) begin transaction
2092
+  (0.0ms) rollback transaction
2093
+  (0.0ms) begin transaction
2094
+  (0.0ms) rollback transaction
2095
+  (0.0ms) begin transaction
2096
+  (0.0ms) rollback transaction
2097
+  (0.0ms) begin transaction
2098
+  (0.0ms) rollback transaction
2099
+  (0.0ms) begin transaction
2100
+  (0.0ms) rollback transaction
2101
+  (0.0ms) begin transaction
2102
+ Started GET "/" for 127.0.0.1 at 2014-03-31 11:27:22 +0200
2103
+ Processing by ApplicationController#home as HTML
2104
+ Rendered application/home.html.erb within layouts/application (2.0ms)
2105
+ Completed 200 OK in 31.2ms (Views: 30.9ms | ActiveRecord: 0.0ms)
2106
+  (0.1ms) rollback transaction
2107
+  (0.0ms) begin transaction
2108
+ Started GET "/?greentable_id=greentable_id&greentable_export=csv" for 127.0.0.1 at 2014-03-31 11:27:22 +0200
2109
+ Processing by ApplicationController#home as HTML
2110
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"csv"}
2111
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
2112
+  (0.1ms) rollback transaction
2113
+  (0.0ms) begin transaction
2114
+ Started GET "/?greentable_id=greentable_id&greentable_export=print" for 127.0.0.1 at 2014-03-31 11:27:22 +0200
2115
+ Processing by ApplicationController#home as HTML
2116
+ Parameters: {"greentable_id"=>"greentable_id", "greentable_export"=>"print"}
2117
+ Completed 200 OK in 1.3ms (Views: 1.2ms | ActiveRecord: 0.0ms)
2118
+  (0.0ms) rollback transaction
@@ -87,4 +87,23 @@ class GreentableTest < ActiveSupport::TestCase
87
87
  end
88
88
  assert_equal '<table class="a aa" style="b:c"><thead><tr class="d"><th onclick="e();" class="h i ee">col0</th><th onclick="e();" class="ee">col1</th></tr></thead><tbody><tr class="d"><td data-target="f" class="h ff">0</td><td data-target="f" class="j ff">0</td></tr></tbody></table>', gt.to_s
89
89
  end
90
+
91
+ test "global configuration" do
92
+ Greentable.configure do |config|
93
+ config.defaults = {class: 'table_class', tr: {class: 'tr_class'}, th: {class: 'th_class'}, td: {class: 'td_class'}}
94
+ end
95
+ begin
96
+ gt = Greentable::Table.new(self,[0], {})
97
+ gt.process do |gt, x|
98
+ gt.col('col0') do
99
+ x
100
+ end
101
+ end
102
+ assert_equal "<table class=\"table_class\"><thead><tr class=\"tr_class\"><th class=\"th_class\">col0</th></tr></thead><tbody><tr class=\"tr_class\"><td class=\"td_class\">0</td></tr></tbody></table>", gt.to_s
103
+ ensure
104
+ Greentable.configure do |config|
105
+ config.defaults = {}
106
+ end
107
+ end
108
+ end
90
109
  end
data/test/test_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'simplecov'
2
+ SimpleCov.start('rails')
3
+
1
4
  # Configure Rails Environment
2
5
  ENV["RAILS_ENV"] = "test"
3
6
 
@@ -16,10 +19,8 @@ Rails.backtrace_cleaner.remove_silencers!
16
19
 
17
20
 
18
21
  require 'greentable'
19
- #require 'simplecov'
20
- #require 'coveralls'
21
- #SimpleCov.start('rails')
22
- #Coveralls.wear!
22
+ require 'coveralls'
23
+ Coveralls.wear!
23
24
 
24
25
  public
25
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greentable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-29 00:00:00.000000000 Z
12
+ date: 2014-03-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -123,6 +123,38 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: simplecov
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: coveralls
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
126
158
  description: Greentable produces HTML tables from an array without you having to deal
127
159
  with any HTML elements.
128
160
  email:
@@ -215,7 +247,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
247
  version: '0'
216
248
  segments:
217
249
  - 0
218
- hash: 827704004142044330
250
+ hash: -3809614129295099888
219
251
  required_rubygems_version: !ruby/object:Gem::Requirement
220
252
  none: false
221
253
  requirements:
@@ -224,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
256
  version: '0'
225
257
  segments:
226
258
  - 0
227
- hash: 827704004142044330
259
+ hash: -3809614129295099888
228
260
  requirements: []
229
261
  rubyforge_project:
230
262
  rubygems_version: 1.8.25