tabulatr2 0.8.7 → 0.8.8

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: 9cc4debf2b6d55472335e0bce1a41af9ce855bff
4
- data.tar.gz: 2f6fdf210d8b71c6f0029cd135865de72724b9d5
3
+ metadata.gz: f4d632b7ef3a02bfc432ff6281a41ea6ade9231b
4
+ data.tar.gz: 5db20e1ce285e979a72a544c08dfe7c224afddbf
5
5
  SHA512:
6
- metadata.gz: 50320b1a4f0a32e6b2c475b6b338c9797a2785a0cee523b9850469fdb1579b1d8b0fdc45b7f3f77501eefeceb04321081b904a1ea7ab03753c0e081cf405d0c7
7
- data.tar.gz: 352e67cf460c0476d90691c65cbfc91fde96af45b15730e48fc2a1c8f2e2e90d89aa531c182eacc0f9eb117da3d9580a8261206d8d92f169e9bb4bfcf145a7f9
6
+ metadata.gz: 5bc17e8ade01f2ee73e08d6daea2df5254b46a23d0d3783aed7214fff66e9521492f6e065cc691cbe4dd4be4c7b29eacc7eae0b67527ffe3432219c924e3a70a
7
+ data.tar.gz: 319b8c9861bc83179d78447197d7b0ec848066eb98aa89c5204b2e20843766fb040d5078638b6fd5b77ab9bb465737883324090ef862312ed1fb8a9d74829a19
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.8.8
2
+
3
+ * new Generator:
4
+ `tabulatr:install` - now only for creating I18n file
5
+ `tabulatr:table MODEL` - for creating MODELTabulatrData class
6
+
7
+ * get rid of `bootstrap_paginator` option and initializer
8
+
9
+ * get rid of `security_tokens`
10
+
1
11
  ## 0.8.7
2
12
 
3
13
  * fixed bug in association call
data/README.md CHANGED
@@ -23,22 +23,6 @@ You can also run the generator for a new model, if you just run the standard Rai
23
23
 
24
24
  `rails g resource Product title:string vendor:references description:text`
25
25
 
26
- ### Security
27
-
28
- Tabulatr2 tries to do its best to secure your application. Specifically its secured against
29
- an attacker who tries to change the parameters of the table and include e.g. a `password` field.
30
-
31
- **Important:** But in order to make it so secure you have to alter the two `secret_tokens`
32
- in your `config/initializers/tabulatr.rb` file to different values.
33
-
34
- ```ruby
35
- Tabulatr.config do |c|
36
- c.secret_tokens = ['???', '???']
37
- end
38
- ```
39
-
40
-
41
-
42
26
  ## Usage
43
27
 
44
28
  ### Models
@@ -23,8 +23,8 @@
23
23
  - iname = "#{classname}_batch"
24
24
  .dropdown
25
25
  a.btn.btn-default data-toggle="dropdown" href="#"
26
- i.icon-cog.glyphicon.glyphicon-cog'
27
- i.icon-caret-down.glyphicon.glyphicon-caret-down
26
+ i.icon-cog.glyphicon.glyphicon-cog.fa.fa-cog'
27
+ i.icon-caret-down.glyphicon.glyphicon-caret-down.fa.fa-caret-down
28
28
  ul.dropdown-menu role="menu" aria-labelledby="dLabel"
29
29
  - table_options[:batch_actions].each do |key, label|
30
30
  li
@@ -22,8 +22,8 @@
22
22
  - if table_options[:filter] && columns.filtered_columns.present?
23
23
  .dropdown
24
24
  a.btn.btn-default data-toggle="dropdown" href="#"
25
- i.icon-filter.glyphicon.glyphicon-filter'
26
- i.icon-caret-down.glyphicon.glyphicon-caret-down
25
+ i.icon-filter.glyphicon.glyphicon-filter.fa.fa-filter'
26
+ i.icon-caret-down.glyphicon.glyphicon-caret-down.fa.fa-caret-down
27
27
  ul.dropdown-menu role="menu" aria-labelledby="dLabel"
28
28
  - columns.filtered_columns.each do |column|
29
29
  li
@@ -26,6 +26,7 @@ module ActiveModel
26
26
  initializer 'generators' do |app|
27
27
  require 'rails/generators'
28
28
  require 'tabulatr/generators/tabulatr/install_generator'
29
+ require 'tabulatr/generators/tabulatr/table_generator'
29
30
  Rails::Generators.configure!(app.config.generators)
30
31
  require 'tabulatr/generators/resource_override'
31
32
  end
@@ -28,7 +28,7 @@ module Rails
28
28
  module Generators
29
29
  class ResourceGenerator
30
30
  def add_tabulatr_data
31
- invoke 'tabulatr:install'
31
+ invoke 'tabulatr:table'
32
32
  end
33
33
  end
34
34
  end
@@ -23,40 +23,13 @@
23
23
 
24
24
  module Tabulatr
25
25
  module Generators
26
- class InstallGenerator < Rails::Generators::NamedBase
26
+ class InstallGenerator < Rails::Generators::Base
27
27
  desc "initialize tabulatr"
28
28
  source_root File.expand_path('../templates', __FILE__)
29
- check_class_collision suffix: 'TabulatrData'
30
-
31
- argument :attributes, type: :array, default: [], banner: 'field:type field:type'
32
-
33
- def create_tabulatr_data_file
34
- template 'tabulatr_data.rb', File.join('app/tabulatr_data/', class_path, "#{file_name}_tabulatr_data.rb")
35
- end
36
-
37
- def copy_initializer_file
38
- copy_file "tabulatr.rb", "config/initializers/tabulatr.rb"
39
- end
40
29
 
41
30
  def copy_translation_file
42
31
  copy_file "tabulatr.yml", "config/locales/tabulatr.yml"
43
32
  end
44
-
45
- def bootstrap
46
- unless yes?('Do you use Bootstrap version 3 ?')
47
- gsub_file 'config/initializers/tabulatr.rb', 'create_ul_paginator', 'create_div_paginator'
48
- end
49
- end
50
-
51
- private
52
-
53
- def attributes_names
54
- [:id] + attributes.select { |attr| !attr.reference? }.map { |a| a.name.to_sym }
55
- end
56
-
57
- def association_names
58
- attributes.select { |attr| attr.reference? }.map { |a| a.name.to_sym }
59
- end
60
33
  end
61
34
  end
62
35
  end
@@ -0,0 +1,48 @@
1
+ #--
2
+ # Copyright (c) 2010-2014 Peter Horn & Florian Thomas, Provideal GmbH
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ module Tabulatr
25
+ module Generators
26
+ class TableGenerator < Rails::Generators::NamedBase
27
+ desc "create TabulatrData Class"
28
+ source_root File.expand_path('../templates', __FILE__)
29
+ check_class_collision suffix: 'TabulatrData'
30
+
31
+ argument :attributes, type: :array, default: [], banner: 'field:type field:type'
32
+
33
+ def create_tabulatr_data_file
34
+ template 'tabulatr_data.rb', File.join('app/tabulatr_data/', class_path, "#{file_name}_tabulatr_data.rb")
35
+ end
36
+
37
+ private
38
+
39
+ def attributes_names
40
+ [:id] + attributes.select { |attr| !attr.reference? }.map { |a| a.name.to_sym }
41
+ end
42
+
43
+ def association_names
44
+ attributes.select { |attr| attr.reference? }.map { |a| a.name.to_sym }
45
+ end
46
+ end
47
+ end
48
+ end
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module Tabulatr
25
- VERSION = "0.8.7"
25
+ VERSION = "0.8.8"
26
26
  end
data/lib/tabulatr.rb CHANGED
@@ -25,18 +25,6 @@ module Tabulatr
25
25
  def self.config &block
26
26
  yield self
27
27
  end
28
-
29
- mattr_accessor :bootstrap_paginator, instance_accessor: false do
30
- 'create_ul_paginator'
31
- end
32
-
33
- def self.secret_tokens=(secret_tokens)
34
- @@secret_tokens = secret_tokens
35
- end
36
-
37
- def self.secret_tokens
38
- @@secret_tokens ||= []
39
- end
40
28
  end
41
29
 
42
30
  require 'tabulatr/engine'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabulatr2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Horn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-14 00:00:00.000000000 Z
13
+ date: 2013-11-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -100,7 +100,7 @@ files:
100
100
  - lib/tabulatr/generators/railtie.rb
101
101
  - lib/tabulatr/generators/resource_override.rb
102
102
  - lib/tabulatr/generators/tabulatr/install_generator.rb
103
- - lib/tabulatr/generators/tabulatr/templates/tabulatr.rb
103
+ - lib/tabulatr/generators/tabulatr/table_generator.rb
104
104
  - lib/tabulatr/generators/tabulatr/templates/tabulatr.yml
105
105
  - lib/tabulatr/generators/tabulatr/templates/tabulatr_data.rb
106
106
  - lib/tabulatr/json_builder.rb
@@ -161,7 +161,6 @@ files:
161
161
  - spec/dummy/config/initializers/mime_types.rb
162
162
  - spec/dummy/config/initializers/secret_token.rb
163
163
  - spec/dummy/config/initializers/session_store.rb
164
- - spec/dummy/config/initializers/tabulatr.rb
165
164
  - spec/dummy/config/initializers/wrap_parameters.rb
166
165
  - spec/dummy/config/locales/en.yml
167
166
  - spec/dummy/config/locales/tabulatr.yml
@@ -251,7 +250,6 @@ test_files:
251
250
  - spec/dummy/config/initializers/mime_types.rb
252
251
  - spec/dummy/config/initializers/secret_token.rb
253
252
  - spec/dummy/config/initializers/session_store.rb
254
- - spec/dummy/config/initializers/tabulatr.rb
255
253
  - spec/dummy/config/initializers/wrap_parameters.rb
256
254
  - spec/dummy/config/locales/en.yml
257
255
  - spec/dummy/config/locales/tabulatr.yml
@@ -269,3 +267,4 @@ test_files:
269
267
  - spec/features/tabulatrs_spec.rb
270
268
  - spec/lib/tabulatr/data/data_spec.rb
271
269
  - spec/spec_helper.rb
270
+ has_rdoc:
@@ -1,5 +0,0 @@
1
- Tabulatr.config do |c|
2
- c.secret_tokens = ['wrw234lk32n4l2n', 'nflwh23p4h']
3
- end
4
-
5
- Tabulatr.bootstrap_paginator = :create_ul_paginator
@@ -1,5 +0,0 @@
1
- Tabulatr.config do |c|
2
- c.secret_tokens = ['wrw234lk32n4l2n', 'nflwh23p4h']
3
- end
4
-
5
- Tabulatr.bootstrap_paginator = :create_ul_paginator