xsdk-scaffold-rails 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +16 -0
- data/.travis.yml +6 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +193 -0
- data/README.md +36 -0
- data/Rakefile +13 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/xsdk/scaffold/rails/base.rb +217 -0
- data/lib/xsdk/scaffold/rails/version.rb +7 -0
- data/lib/xsdk/scaffold/rails.rb +10 -0
- data/xsdk-scaffold-rails.gemspec +35 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 92df0251cb970dfc1284dba7de88c6f63a583de44d993e84eb2753cb69f5f8cc
|
4
|
+
data.tar.gz: 3603f6f28bd20bf8c2339e21dd12aa0a1cd40cb35c80b3df7e3c6b5ef27abccf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b87c60fa9c7434a9b74ea918b4b7e38f412d976255e22ec2a6e16c7d896ee2dac5e4c8ad09ff027c43ec3bf4a69b97711e8093d5c18299dbe7880c5e0001c0a2
|
7
|
+
data.tar.gz: 65eb42abf5de19681067a7b9f125b0d4d738571914fca03cf5be3b2c50049b1983d28bc267311a2de3564d7a4a444efb2134d364d3b915ab952e61f58271a4ae
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
xsdk-scaffold-rails (0.1.0)
|
5
|
+
activerecord (~> 6.0.0)
|
6
|
+
pg (~> 1.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (6.0.0)
|
12
|
+
actionpack (= 6.0.0)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (6.0.0)
|
16
|
+
actionpack (= 6.0.0)
|
17
|
+
activejob (= 6.0.0)
|
18
|
+
activerecord (= 6.0.0)
|
19
|
+
activestorage (= 6.0.0)
|
20
|
+
activesupport (= 6.0.0)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.0)
|
23
|
+
actionpack (= 6.0.0)
|
24
|
+
actionview (= 6.0.0)
|
25
|
+
activejob (= 6.0.0)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.0.0)
|
29
|
+
actionview (= 6.0.0)
|
30
|
+
activesupport (= 6.0.0)
|
31
|
+
rack (~> 2.0)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.0)
|
36
|
+
actionpack (= 6.0.0)
|
37
|
+
activerecord (= 6.0.0)
|
38
|
+
activestorage (= 6.0.0)
|
39
|
+
activesupport (= 6.0.0)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.0)
|
42
|
+
activesupport (= 6.0.0)
|
43
|
+
builder (~> 3.1)
|
44
|
+
erubi (~> 1.4)
|
45
|
+
rails-dom-testing (~> 2.0)
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.0)
|
48
|
+
activesupport (= 6.0.0)
|
49
|
+
globalid (>= 0.3.6)
|
50
|
+
activemodel (6.0.0)
|
51
|
+
activesupport (= 6.0.0)
|
52
|
+
activerecord (6.0.0)
|
53
|
+
activemodel (= 6.0.0)
|
54
|
+
activesupport (= 6.0.0)
|
55
|
+
activestorage (6.0.0)
|
56
|
+
actionpack (= 6.0.0)
|
57
|
+
activejob (= 6.0.0)
|
58
|
+
activerecord (= 6.0.0)
|
59
|
+
marcel (~> 0.3.1)
|
60
|
+
activesupport (6.0.0)
|
61
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
|
+
i18n (>= 0.7, < 2)
|
63
|
+
minitest (~> 5.1)
|
64
|
+
tzinfo (~> 1.1)
|
65
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
66
|
+
ast (2.4.2)
|
67
|
+
builder (3.2.4)
|
68
|
+
concurrent-ruby (1.1.8)
|
69
|
+
crass (1.0.6)
|
70
|
+
diff-lcs (1.4.4)
|
71
|
+
erubi (1.10.0)
|
72
|
+
globalid (0.4.2)
|
73
|
+
activesupport (>= 4.2.0)
|
74
|
+
i18n (1.8.10)
|
75
|
+
concurrent-ruby (~> 1.0)
|
76
|
+
loofah (2.9.1)
|
77
|
+
crass (~> 1.0.2)
|
78
|
+
nokogiri (>= 1.5.9)
|
79
|
+
mail (2.7.1)
|
80
|
+
mini_mime (>= 0.1.1)
|
81
|
+
marcel (0.3.3)
|
82
|
+
mimemagic (~> 0.3.2)
|
83
|
+
method_source (1.0.0)
|
84
|
+
mimemagic (0.3.10)
|
85
|
+
nokogiri (~> 1)
|
86
|
+
rake
|
87
|
+
mini_mime (1.1.0)
|
88
|
+
mini_portile2 (2.5.1)
|
89
|
+
minitest (5.14.4)
|
90
|
+
nio4r (2.5.7)
|
91
|
+
nokogiri (1.11.3)
|
92
|
+
mini_portile2 (~> 2.5.0)
|
93
|
+
racc (~> 1.4)
|
94
|
+
parallel (1.20.1)
|
95
|
+
parser (3.0.1.1)
|
96
|
+
ast (~> 2.4.1)
|
97
|
+
pg (1.2.3)
|
98
|
+
racc (1.5.2)
|
99
|
+
rack (2.2.3)
|
100
|
+
rack-test (1.1.0)
|
101
|
+
rack (>= 1.0, < 3)
|
102
|
+
rails (6.0.0)
|
103
|
+
actioncable (= 6.0.0)
|
104
|
+
actionmailbox (= 6.0.0)
|
105
|
+
actionmailer (= 6.0.0)
|
106
|
+
actionpack (= 6.0.0)
|
107
|
+
actiontext (= 6.0.0)
|
108
|
+
actionview (= 6.0.0)
|
109
|
+
activejob (= 6.0.0)
|
110
|
+
activemodel (= 6.0.0)
|
111
|
+
activerecord (= 6.0.0)
|
112
|
+
activestorage (= 6.0.0)
|
113
|
+
activesupport (= 6.0.0)
|
114
|
+
bundler (>= 1.3.0)
|
115
|
+
railties (= 6.0.0)
|
116
|
+
sprockets-rails (>= 2.0.0)
|
117
|
+
rails-dom-testing (2.0.3)
|
118
|
+
activesupport (>= 4.2.0)
|
119
|
+
nokogiri (>= 1.6)
|
120
|
+
rails-html-sanitizer (1.3.0)
|
121
|
+
loofah (~> 2.3)
|
122
|
+
railties (6.0.0)
|
123
|
+
actionpack (= 6.0.0)
|
124
|
+
activesupport (= 6.0.0)
|
125
|
+
method_source
|
126
|
+
rake (>= 0.8.7)
|
127
|
+
thor (>= 0.20.3, < 2.0)
|
128
|
+
rainbow (3.0.0)
|
129
|
+
rake (12.3.3)
|
130
|
+
regexp_parser (2.1.1)
|
131
|
+
rexml (3.2.5)
|
132
|
+
rspec (3.10.0)
|
133
|
+
rspec-core (~> 3.10.0)
|
134
|
+
rspec-expectations (~> 3.10.0)
|
135
|
+
rspec-mocks (~> 3.10.0)
|
136
|
+
rspec-core (3.10.1)
|
137
|
+
rspec-support (~> 3.10.0)
|
138
|
+
rspec-expectations (3.10.1)
|
139
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
140
|
+
rspec-support (~> 3.10.0)
|
141
|
+
rspec-mocks (3.10.2)
|
142
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
143
|
+
rspec-support (~> 3.10.0)
|
144
|
+
rspec-support (3.10.2)
|
145
|
+
rubocop (1.3.1)
|
146
|
+
parallel (~> 1.10)
|
147
|
+
parser (>= 2.7.1.5)
|
148
|
+
rainbow (>= 2.2.2, < 4.0)
|
149
|
+
regexp_parser (>= 1.8)
|
150
|
+
rexml
|
151
|
+
rubocop-ast (>= 1.1.1)
|
152
|
+
ruby-progressbar (~> 1.7)
|
153
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
154
|
+
rubocop-ast (1.5.0)
|
155
|
+
parser (>= 3.0.1.1)
|
156
|
+
rubocop-performance (1.9.2)
|
157
|
+
rubocop (>= 0.90.0, < 2.0)
|
158
|
+
rubocop-ast (>= 0.4.0)
|
159
|
+
rubocop-rspec (2.0.1)
|
160
|
+
rubocop (~> 1.0)
|
161
|
+
rubocop-ast (>= 1.1.0)
|
162
|
+
ruby-progressbar (1.11.0)
|
163
|
+
sprockets (4.0.2)
|
164
|
+
concurrent-ruby (~> 1.0)
|
165
|
+
rack (> 1, < 3)
|
166
|
+
sprockets-rails (3.2.2)
|
167
|
+
actionpack (>= 4.0)
|
168
|
+
activesupport (>= 4.0)
|
169
|
+
sprockets (>= 3.0.0)
|
170
|
+
thor (1.1.0)
|
171
|
+
thread_safe (0.3.6)
|
172
|
+
tzinfo (1.2.9)
|
173
|
+
thread_safe (~> 0.1)
|
174
|
+
unicode-display_width (1.7.0)
|
175
|
+
websocket-driver (0.7.3)
|
176
|
+
websocket-extensions (>= 0.1.0)
|
177
|
+
websocket-extensions (0.1.5)
|
178
|
+
zeitwerk (2.4.2)
|
179
|
+
|
180
|
+
PLATFORMS
|
181
|
+
ruby
|
182
|
+
|
183
|
+
DEPENDENCIES
|
184
|
+
rails (~> 6.0.0.0)
|
185
|
+
rake (~> 12.0)
|
186
|
+
rspec (~> 3.0)
|
187
|
+
rubocop (~> 1.3.1)
|
188
|
+
rubocop-performance (~> 1.9.0)
|
189
|
+
rubocop-rspec (~> 2.0.0)
|
190
|
+
xsdk-scaffold-rails!
|
191
|
+
|
192
|
+
BUNDLED WITH
|
193
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Xsdk::Scaffold::Rails
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xsdk/scaffold/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'xsdk-scaffold-rails'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install xsdk-scaffold-rails
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xsdk-scaffold-rails.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require 'rake'
|
4
|
+
require 'rubocop/rake_task'
|
5
|
+
|
6
|
+
RuboCop::RakeTask.new do |task|
|
7
|
+
task.requires << 'rubocop-performance'
|
8
|
+
task.requires << 'rubocop-rspec'
|
9
|
+
end
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new(:spec)
|
12
|
+
|
13
|
+
task :default => :spec
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "xsdk/scaffold/rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
module Xsdk
|
2
|
+
module Scaffold
|
3
|
+
module Rails
|
4
|
+
|
5
|
+
class BaseDatatable
|
6
|
+
|
7
|
+
def initialize(params, clazz)
|
8
|
+
@options = JSON.parse(params[:options]).with_indifferent_access
|
9
|
+
@clazz = clazz
|
10
|
+
@foreign_keys = get_foreign_key_map(clazz)
|
11
|
+
end
|
12
|
+
|
13
|
+
def as_json(*)
|
14
|
+
{
|
15
|
+
rows: paginate(get_data),
|
16
|
+
total_rows: get_count,
|
17
|
+
columns: build_headers
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
# Build rows
|
22
|
+
|
23
|
+
def paginate(data)
|
24
|
+
per_page = @options[:itemsPerPage]
|
25
|
+
page = @options[:page] - 1
|
26
|
+
data.limit(per_page)
|
27
|
+
.offset(page * per_page)
|
28
|
+
.as_json(methods: enum_methods, except: keys_to_exclude, include: has_many_include)
|
29
|
+
end
|
30
|
+
|
31
|
+
def keys_to_exclude
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
def enum_methods
|
36
|
+
enum_methods = []
|
37
|
+
@clazz.defined_enums.each do |k, _v|
|
38
|
+
enum_methods << "#{k}_text"
|
39
|
+
end
|
40
|
+
enum_methods
|
41
|
+
end
|
42
|
+
|
43
|
+
def get_data
|
44
|
+
data = @clazz.all
|
45
|
+
associations.reject { |_k, v| v[:association_type] == :has_many }.each do |_, value|
|
46
|
+
data = data.joins(value[:relation])
|
47
|
+
end
|
48
|
+
to_select = associations.reject do |_k, v|
|
49
|
+
v[:association_type] == :has_many
|
50
|
+
end.reject { |_k, v| v[:source] == 'id' }.map do |key, value|
|
51
|
+
table_name = @foreign_keys[key][0][:class_name].constantize.table_name
|
52
|
+
"#{table_name}.#{value[:source]} AS #{value[:relation]}_#{value[:source]}"
|
53
|
+
end
|
54
|
+
data = data.select("#{@clazz.to_s.underscore.pluralize}.*", *to_select)
|
55
|
+
|
56
|
+
associations.select { |_k, v| v[:association_type] == :has_many }.each do |_, v|
|
57
|
+
data = data.includes(v[:join]).references(v[:join])
|
58
|
+
end
|
59
|
+
|
60
|
+
data
|
61
|
+
end
|
62
|
+
|
63
|
+
def has_many_include
|
64
|
+
associations.select { |_, v| v[:association_type] == :has_many }.map { |_, v| v[:include] }
|
65
|
+
end
|
66
|
+
|
67
|
+
# Build columns
|
68
|
+
def build_headers
|
69
|
+
headers = columns.map do |c|
|
70
|
+
{
|
71
|
+
value: c, # warehouse_id
|
72
|
+
table_value: get_table_value(c), # "mag1"
|
73
|
+
text: get_text(c), # "Identificatore"
|
74
|
+
type: get_type(c), # "string"
|
75
|
+
in_form: form_columns.include?(c), # true/false
|
76
|
+
in_table: table_columns.include?(c), # true/false
|
77
|
+
table: get_table(c), # warehouses
|
78
|
+
source: get_source(c), # identifier
|
79
|
+
min_search_size: get_min_search_size(c),
|
80
|
+
enum_cols: get_enum_cols(c),
|
81
|
+
subschema: get_subschema(c)
|
82
|
+
}
|
83
|
+
end
|
84
|
+
headers << { text: 'Azioni', value: 'actions', type: '', in_form: false, in_table: true }
|
85
|
+
headers
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_subschema(c)
|
89
|
+
subschema = nil
|
90
|
+
ax = associations.with_indifferent_access
|
91
|
+
if ax.key?(c) && (ax[c][:association_type] == :has_many)
|
92
|
+
empty_options = { options: '{}' }
|
93
|
+
begin
|
94
|
+
datatable = "#{ax[c][:clazz]}Datatable".constantize
|
95
|
+
dt = datatable.new(empty_options)
|
96
|
+
rescue StandardError
|
97
|
+
dt = BaseDatatable.new(empty_options, ax[c][:clazz])
|
98
|
+
end
|
99
|
+
subschema = dt.build_headers
|
100
|
+
subschema = subschema.reject { |c| c[:type] == 'foreign_key' && c[:table] == @clazz.table_name }
|
101
|
+
subschema << { text: 'Elimina', value: '_destroy', type: '', in_form: false, in_table: false }
|
102
|
+
subschema << { text: 'Uuid', value: '_uuid', type: 'uuid', in_form: false, in_table: false }
|
103
|
+
subschema.each { |s| s[:is_subschema] = true }
|
104
|
+
end
|
105
|
+
subschema
|
106
|
+
end
|
107
|
+
|
108
|
+
def get_enum_cols(c)
|
109
|
+
arr = []
|
110
|
+
if @clazz.defined_enums.key?(c)
|
111
|
+
@clazz.defined_enums[c].each do |k, _v|
|
112
|
+
arr << {
|
113
|
+
value: k,
|
114
|
+
text: @clazz.human_attribute_name("#{c}_enum.#{k}")
|
115
|
+
}
|
116
|
+
end
|
117
|
+
end
|
118
|
+
arr
|
119
|
+
end
|
120
|
+
|
121
|
+
def get_min_search_size(c)
|
122
|
+
ax = associations.with_indifferent_access
|
123
|
+
if ax.key?(c) && ax[c][:source] == 'id'
|
124
|
+
ax[c][:min_search_size]
|
125
|
+
else
|
126
|
+
3
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def columns
|
131
|
+
@clazz.column_names - %w[created_at updated_at]
|
132
|
+
end
|
133
|
+
|
134
|
+
def table_columns
|
135
|
+
columns
|
136
|
+
end
|
137
|
+
|
138
|
+
def form_columns
|
139
|
+
columns - ['id']
|
140
|
+
end
|
141
|
+
|
142
|
+
def get_table(c)
|
143
|
+
ax = associations.with_indifferent_access
|
144
|
+
if @foreign_keys.key?(c)
|
145
|
+
@foreign_keys[c][0][:class_name].constantize.table_name
|
146
|
+
elsif ax.key?(c) && (ax[c][:association_type] == :has_many)
|
147
|
+
ax[c][:clazz].table_name
|
148
|
+
else
|
149
|
+
@clazz.table_name
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def get_source(c)
|
154
|
+
ax = associations.with_indifferent_access
|
155
|
+
if ax.key?(c) && (ax[c][:association_type] != :has_many)
|
156
|
+
ax[c][:source]
|
157
|
+
else
|
158
|
+
c
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def get_text(c)
|
163
|
+
ax = associations.with_indifferent_access
|
164
|
+
if @foreign_keys.key?(c)
|
165
|
+
@foreign_keys[c][0][:class_name].constantize.model_name.human.capitalize
|
166
|
+
elsif ax.key?(c) && (ax[c][:association_type] == :has_many)
|
167
|
+
ax[c][:clazz].model_name.human.capitalize
|
168
|
+
else
|
169
|
+
@clazz.human_attribute_name(c).capitalize
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def get_type(c)
|
174
|
+
ax = associations.with_indifferent_access
|
175
|
+
if @foreign_keys.key?(c)
|
176
|
+
'foreign_key'
|
177
|
+
elsif ax.key?(c) && (ax[c][:association_type] == :has_many)
|
178
|
+
'has_many'
|
179
|
+
elsif @clazz.defined_enums.key?(c)
|
180
|
+
'enum'
|
181
|
+
else
|
182
|
+
@clazz.type_for_attribute(c).type
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def get_table_value(c)
|
187
|
+
ax = associations.with_indifferent_access
|
188
|
+
if ax.key?(c)
|
189
|
+
if ax[c][:association_type] == :has_many
|
190
|
+
c
|
191
|
+
else
|
192
|
+
"#{ax[c][:relation]}_#{ax[c][:source]}"
|
193
|
+
end
|
194
|
+
else
|
195
|
+
c
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def get_count
|
200
|
+
@clazz.count
|
201
|
+
end
|
202
|
+
|
203
|
+
def get_foreign_key_map(clazz)
|
204
|
+
clazz.reflect_on_all_associations.select { |a| a.macro == :belongs_to }
|
205
|
+
.map { |a| { key: a.foreign_key, class_name: a.class_name } }
|
206
|
+
.group_by { |a| a[:key] }
|
207
|
+
.with_indifferent_access
|
208
|
+
end
|
209
|
+
|
210
|
+
def associations
|
211
|
+
{}
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'lib/xsdk/scaffold/rails/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "xsdk-scaffold-rails"
|
5
|
+
spec.version = Xsdk::Scaffold::Rails::VERSION
|
6
|
+
spec.authors = ["Davide Croci"]
|
7
|
+
spec.email = ["croci.davide.1@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Gem for automatic scaffolding by Ermes-x.}
|
10
|
+
spec.description = %q{Gem for automatic scaffolding by Ermes-x.}
|
11
|
+
spec.homepage = "https://ermes-x.com"
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
13
|
+
|
14
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
18
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_runtime_dependency 'activerecord', '~> 6.0.0'
|
30
|
+
spec.add_runtime_dependency 'pg', '~> 1.1'
|
31
|
+
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 1.3.1'
|
33
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.9.0'
|
34
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.0.0'
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xsdk-scaffold-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Davide Croci
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-05-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 6.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 6.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pg
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.3.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-performance
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.9.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.9.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.0.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.0.0
|
83
|
+
description: Gem for automatic scaffolding by Ermes-x.
|
84
|
+
email:
|
85
|
+
- croci.davide.1@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- lib/xsdk/scaffold/rails.rb
|
101
|
+
- lib/xsdk/scaffold/rails/base.rb
|
102
|
+
- lib/xsdk/scaffold/rails/version.rb
|
103
|
+
- xsdk-scaffold-rails.gemspec
|
104
|
+
homepage: https://ermes-x.com
|
105
|
+
licenses: []
|
106
|
+
metadata:
|
107
|
+
homepage_uri: https://ermes-x.com
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 2.4.0
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubygems_version: 3.0.8
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Gem for automatic scaffolding by Ermes-x.
|
127
|
+
test_files: []
|