administrate-field-jsontable 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +7 -0
- data/.rubocop.yml +96 -0
- data/Gemfile +9 -1
- data/Gemfile.lock +153 -118
- data/LICENSE.md +1 -1
- data/README.md +11 -23
- data/Rakefile +11 -0
- data/administrate-field-jsontable.gemspec +8 -6
- data/app/views/fields/jsontable/_index.html.erb +18 -0
- data/app/views/fields/jsontable/_json_table_field.html.erb +30 -0
- data/app/views/fields/jsontable/_show.html.erb +6 -33
- data/lib/administrate/field/jsontable.rb +2 -0
- data/spec/example_app/app/assets/config/manifest.js +2 -0
- data/spec/example_app/app/assets/javascripts/application.js +15 -0
- data/spec/example_app/app/assets/stylesheets/application.css +15 -0
- data/spec/example_app/app/controllers/application_controller.rb +7 -0
- data/spec/example_app/app/models/application_record.rb +5 -0
- data/spec/example_app/app/views/layouts/application.html.erb +31 -0
- data/spec/example_app/app/views/pages/.keep +0 -0
- data/spec/example_app/config.ru +6 -0
- data/spec/example_app/config/application.rb +39 -0
- data/spec/example_app/config/boot.rb +4 -0
- data/spec/example_app/config/database.yml +11 -0
- data/spec/example_app/config/environment.rb +7 -0
- data/spec/example_app/config/environments/development.rb +39 -0
- data/spec/example_app/config/environments/production.rb +78 -0
- data/spec/example_app/config/environments/staging.rb +3 -0
- data/spec/example_app/config/environments/test.rb +43 -0
- data/spec/example_app/config/initializers/assets.rb +13 -0
- data/spec/example_app/config/initializers/backtrace_silencers.rb +8 -0
- data/spec/example_app/config/initializers/cookies_serializer.rb +5 -0
- data/spec/example_app/config/initializers/disable_xml_params.rb +5 -0
- data/spec/example_app/config/initializers/errors.rb +20 -0
- data/spec/example_app/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/example_app/config/initializers/inflections.rb +18 -0
- data/spec/example_app/config/initializers/json_encoding.rb +3 -0
- data/spec/example_app/config/initializers/mime_types.rb +5 -0
- data/spec/example_app/config/initializers/session_store.rb +5 -0
- data/spec/example_app/config/initializers/wrap_parameters.rb +16 -0
- data/spec/example_app/config/routes.rb +4 -0
- data/spec/example_app/config/secrets.yml +15 -0
- data/spec/example_app/db/schema.rb +18 -0
- data/spec/example_app/db/seeds.rb +8 -0
- data/spec/example_app/public/robots.txt +5 -0
- data/spec/fixtures/jsontable/array_contains_hash.html +1 -0
- data/spec/fixtures/jsontable/hash_contains_array.html +31 -0
- data/spec/fixtures/jsontable/pure_hash.html +58 -0
- data/spec/lib/administrate/field/jsontable_index_spec.rb +95 -0
- data/spec/lib/administrate/field/jsontable_show_spec.rb +95 -0
- data/spec/lib/administrate/field/jsontable_spec.rb +16 -5
- data/spec/rails_helper.rb +6 -0
- data/spec/support/read_fixture.rb +7 -0
- metadata +93 -17
@@ -1,14 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'administrate/field/jsontable'
|
2
4
|
|
3
5
|
describe Administrate::Field::Jsontable do
|
4
6
|
describe '#to_partial_path' do
|
5
7
|
it 'returns a partial based on the page being rendered' do
|
6
|
-
page
|
7
|
-
|
8
|
-
|
9
|
-
path = field.to_partial_path
|
8
|
+
assert_partial_path(page: :show)
|
9
|
+
end
|
10
10
|
|
11
|
-
|
11
|
+
it 'returns a partial for index page' do
|
12
|
+
assert_partial_path(page: :index)
|
12
13
|
end
|
13
14
|
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def assert_partial_path(page:)
|
19
|
+
field = Administrate::Field::Jsontable.new(:status, 'status', page)
|
20
|
+
|
21
|
+
path = field.to_partial_path
|
22
|
+
|
23
|
+
expect(path).to eq("/fields/jsontable/#{page}")
|
24
|
+
end
|
14
25
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-jsontable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Adrian Rangel
|
7
8
|
- Enrique Barragan
|
8
|
-
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: administrate
|
@@ -32,9 +32,6 @@ dependencies:
|
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '4.2'
|
35
|
-
- - "<"
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '5.1'
|
38
35
|
type: :runtime
|
39
36
|
prerelease: false
|
40
37
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,30 +39,71 @@ dependencies:
|
|
42
39
|
- - ">="
|
43
40
|
- !ruby/object:Gem::Version
|
44
41
|
version: '4.2'
|
45
|
-
- - "<"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '5.1'
|
48
42
|
description: JSON to table field plugin for Administrate
|
49
43
|
email:
|
50
|
-
-
|
51
|
-
-
|
44
|
+
- adrian@valiot.io
|
45
|
+
- enrique@valiot.io
|
52
46
|
executables: []
|
53
47
|
extensions: []
|
54
48
|
extra_rdoc_files: []
|
55
49
|
files:
|
50
|
+
- ".gitignore"
|
51
|
+
- ".rubocop.yml"
|
56
52
|
- Gemfile
|
57
53
|
- Gemfile.lock
|
58
54
|
- LICENSE.md
|
59
55
|
- README.md
|
56
|
+
- Rakefile
|
60
57
|
- administrate-field-jsontable.gemspec
|
58
|
+
- app/views/fields/jsontable/_index.html.erb
|
59
|
+
- app/views/fields/jsontable/_json_table_field.html.erb
|
61
60
|
- app/views/fields/jsontable/_show.html.erb
|
62
61
|
- lib/administrate/field/jsontable.rb
|
62
|
+
- spec/example_app/app/assets/config/manifest.js
|
63
|
+
- spec/example_app/app/assets/javascripts/application.js
|
64
|
+
- spec/example_app/app/assets/stylesheets/application.css
|
65
|
+
- spec/example_app/app/controllers/application_controller.rb
|
66
|
+
- spec/example_app/app/models/application_record.rb
|
67
|
+
- spec/example_app/app/views/layouts/application.html.erb
|
68
|
+
- spec/example_app/app/views/pages/.keep
|
69
|
+
- spec/example_app/config.ru
|
70
|
+
- spec/example_app/config/application.rb
|
71
|
+
- spec/example_app/config/boot.rb
|
72
|
+
- spec/example_app/config/database.yml
|
73
|
+
- spec/example_app/config/environment.rb
|
74
|
+
- spec/example_app/config/environments/development.rb
|
75
|
+
- spec/example_app/config/environments/production.rb
|
76
|
+
- spec/example_app/config/environments/staging.rb
|
77
|
+
- spec/example_app/config/environments/test.rb
|
78
|
+
- spec/example_app/config/initializers/assets.rb
|
79
|
+
- spec/example_app/config/initializers/backtrace_silencers.rb
|
80
|
+
- spec/example_app/config/initializers/cookies_serializer.rb
|
81
|
+
- spec/example_app/config/initializers/disable_xml_params.rb
|
82
|
+
- spec/example_app/config/initializers/errors.rb
|
83
|
+
- spec/example_app/config/initializers/filter_parameter_logging.rb
|
84
|
+
- spec/example_app/config/initializers/inflections.rb
|
85
|
+
- spec/example_app/config/initializers/json_encoding.rb
|
86
|
+
- spec/example_app/config/initializers/mime_types.rb
|
87
|
+
- spec/example_app/config/initializers/session_store.rb
|
88
|
+
- spec/example_app/config/initializers/wrap_parameters.rb
|
89
|
+
- spec/example_app/config/routes.rb
|
90
|
+
- spec/example_app/config/secrets.yml
|
91
|
+
- spec/example_app/db/schema.rb
|
92
|
+
- spec/example_app/db/seeds.rb
|
93
|
+
- spec/example_app/public/robots.txt
|
94
|
+
- spec/fixtures/jsontable/array_contains_hash.html
|
95
|
+
- spec/fixtures/jsontable/hash_contains_array.html
|
96
|
+
- spec/fixtures/jsontable/pure_hash.html
|
97
|
+
- spec/lib/administrate/field/jsontable_index_spec.rb
|
98
|
+
- spec/lib/administrate/field/jsontable_show_spec.rb
|
63
99
|
- spec/lib/administrate/field/jsontable_spec.rb
|
64
|
-
|
100
|
+
- spec/rails_helper.rb
|
101
|
+
- spec/support/read_fixture.rb
|
102
|
+
homepage: https://github.com/Valiot/administrate-field-jsontable
|
65
103
|
licenses:
|
66
104
|
- MIT
|
67
105
|
metadata: {}
|
68
|
-
post_install_message:
|
106
|
+
post_install_message:
|
69
107
|
rdoc_options: []
|
70
108
|
require_paths:
|
71
109
|
- lib
|
@@ -80,10 +118,48 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
118
|
- !ruby/object:Gem::Version
|
81
119
|
version: '0'
|
82
120
|
requirements: []
|
83
|
-
|
84
|
-
|
85
|
-
signing_key:
|
121
|
+
rubygems_version: 3.1.2
|
122
|
+
signing_key:
|
86
123
|
specification_version: 4
|
87
124
|
summary: JSON to table field plugin for Administrate
|
88
125
|
test_files:
|
126
|
+
- spec/example_app/app/assets/config/manifest.js
|
127
|
+
- spec/example_app/app/assets/javascripts/application.js
|
128
|
+
- spec/example_app/app/assets/stylesheets/application.css
|
129
|
+
- spec/example_app/app/controllers/application_controller.rb
|
130
|
+
- spec/example_app/app/models/application_record.rb
|
131
|
+
- spec/example_app/app/views/layouts/application.html.erb
|
132
|
+
- spec/example_app/app/views/pages/.keep
|
133
|
+
- spec/example_app/config.ru
|
134
|
+
- spec/example_app/config/application.rb
|
135
|
+
- spec/example_app/config/boot.rb
|
136
|
+
- spec/example_app/config/database.yml
|
137
|
+
- spec/example_app/config/environment.rb
|
138
|
+
- spec/example_app/config/environments/development.rb
|
139
|
+
- spec/example_app/config/environments/production.rb
|
140
|
+
- spec/example_app/config/environments/staging.rb
|
141
|
+
- spec/example_app/config/environments/test.rb
|
142
|
+
- spec/example_app/config/initializers/assets.rb
|
143
|
+
- spec/example_app/config/initializers/backtrace_silencers.rb
|
144
|
+
- spec/example_app/config/initializers/cookies_serializer.rb
|
145
|
+
- spec/example_app/config/initializers/disable_xml_params.rb
|
146
|
+
- spec/example_app/config/initializers/errors.rb
|
147
|
+
- spec/example_app/config/initializers/filter_parameter_logging.rb
|
148
|
+
- spec/example_app/config/initializers/inflections.rb
|
149
|
+
- spec/example_app/config/initializers/json_encoding.rb
|
150
|
+
- spec/example_app/config/initializers/mime_types.rb
|
151
|
+
- spec/example_app/config/initializers/session_store.rb
|
152
|
+
- spec/example_app/config/initializers/wrap_parameters.rb
|
153
|
+
- spec/example_app/config/routes.rb
|
154
|
+
- spec/example_app/config/secrets.yml
|
155
|
+
- spec/example_app/db/schema.rb
|
156
|
+
- spec/example_app/db/seeds.rb
|
157
|
+
- spec/example_app/public/robots.txt
|
158
|
+
- spec/fixtures/jsontable/array_contains_hash.html
|
159
|
+
- spec/fixtures/jsontable/hash_contains_array.html
|
160
|
+
- spec/fixtures/jsontable/pure_hash.html
|
161
|
+
- spec/lib/administrate/field/jsontable_index_spec.rb
|
162
|
+
- spec/lib/administrate/field/jsontable_show_spec.rb
|
89
163
|
- spec/lib/administrate/field/jsontable_spec.rb
|
164
|
+
- spec/rails_helper.rb
|
165
|
+
- spec/support/read_fixture.rb
|