rails_com 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +165 -0
  3. data/README.md +18 -26
  4. data/Rakefile +6 -9
  5. data/app/assets/config/rails_com_manifest.js +2 -0
  6. data/app/assets/javascripts/controllers/active_storage_ext/videos/show.ready.js +1 -0
  7. data/app/assets/javascripts/rails_com/common.js +3 -0
  8. data/app/assets/javascripts/rails_com/fetch_xhr_script.js +3 -2
  9. data/app/assets/stylesheets/controllers/active_storage_ext/videos/show.css +7 -0
  10. data/app/assets/stylesheets/controllers/active_storage_ext/videos/transfer.css +4 -0
  11. data/app/controllers/active_storage/attachments_controller.rb +13 -0
  12. data/app/controllers/active_storage_ext/videos_controller.rb +25 -0
  13. data/app/controllers/concerns/the_common_api.rb +7 -1
  14. data/app/helpers/rails_com/active_helper.rb +14 -10
  15. data/app/helpers/rails_com/assets_helper.rb +40 -14
  16. data/app/helpers/rails_com/format_helper.rb +37 -0
  17. data/app/models/state_machine.rb +10 -6
  18. data/app/views/active_storage/attachments/_image_item.html.erb +6 -0
  19. data/app/views/active_storage/attachments/_list.html.erb +28 -0
  20. data/app/views/active_storage/attachments/_list_edit.html.erb +25 -0
  21. data/app/views/active_storage/attachments/_list_form.html.erb +28 -0
  22. data/app/views/active_storage/attachments/_video_item.html.erb +6 -0
  23. data/app/views/active_storage/attachments/destroy.js.erb +1 -0
  24. data/app/views/active_storage_ext/videos/show.html.erb +6 -0
  25. data/app/views/kaminari/_next_page.html.erb +1 -1
  26. data/app/views/kaminari/_prev_page.html.erb +1 -1
  27. data/app/views/shared/_error_messages.html.erb +1 -1
  28. data/config/locales/en.yml +5 -0
  29. data/config/locales/zh.yml +5 -0
  30. data/config/routes.rb +10 -5
  31. data/lib/assets/javascripts/input-attachment.js +83 -22
  32. data/lib/mina/git2.rb +59 -0
  33. data/lib/rails_com.rb +22 -12
  34. data/lib/rails_com/config.rb +3 -1
  35. data/lib/rails_com/core_ext/array.rb +35 -17
  36. data/lib/rails_com/core_ext/date.rb +24 -0
  37. data/lib/rails_com/core_ext/numeric.rb +11 -0
  38. data/lib/rails_com/core_ext/string.rb +15 -0
  39. data/lib/rails_com/engine.rb +23 -11
  40. data/lib/rails_com/{controller_helper.rb → helpers/controller_helper.rb} +0 -20
  41. data/lib/rails_com/{model_helper.rb → helpers/model_helper.rb} +3 -3
  42. data/lib/rails_com/{controllers.rb → meta/controllers.rb} +0 -0
  43. data/lib/rails_com/{models.rb → meta/models.rb} +1 -0
  44. data/lib/rails_com/{routes.rb → meta/routes.rb} +9 -0
  45. data/lib/rails_com/rails_ext/activestorage_attached.rb +5 -5
  46. data/lib/rails_com/rails_ext/attachment_transfer.rb +40 -0
  47. data/lib/rails_com/rails_ext/named_base.rb +9 -0
  48. data/lib/rails_com/rails_ext/template_renderer.rb +18 -1
  49. data/lib/rails_com/rails_ext/video_response.rb +28 -0
  50. data/lib/{utils → rails_com/utils}/ip_helper.rb +0 -0
  51. data/lib/rails_com/{helpers → utils}/jobber.rb +0 -0
  52. data/lib/rails_com/utils/num_helper.rb +45 -0
  53. data/lib/rails_com/{setting.rb → utils/setting.rb} +0 -0
  54. data/lib/rails_com/utils/time_helper.rb +58 -0
  55. data/lib/rails_com/{helpers → utils}/uid_helper.rb +0 -0
  56. data/lib/rails_com/version.rb +1 -1
  57. data/lib/templates/erb/scaffold/_form.html.erb.tt +2 -2
  58. data/lib/templates/erb/scaffold/index.html.erb.tt +21 -13
  59. data/lib/templates/erb/scaffold/show.html.erb.tt +14 -5
  60. data/lib/templates/rails/scaffold_controller/api_controller.rb.tt +48 -0
  61. data/lib/templates/rails/scaffold_controller/controller.rb.tt +16 -15
  62. metadata +45 -35
  63. data/MIT-LICENSE +0 -20
  64. data/app/controllers/common_controller.rb +0 -10
  65. data/app/controllers/the_guards_controller.rb +0 -18
  66. data/app/helpers/rails_com/common_helper.rb +0 -13
  67. data/app/views/the_guards/index.html.erb +0 -18
  68. data/lib/utils/time_helper.rb +0 -37
@@ -0,0 +1,9 @@
1
+ class Rails::Generators::NamedBase
2
+
3
+ undef class_name
4
+ private
5
+ def class_name
6
+ file_name.classify
7
+ end
8
+
9
+ end
@@ -1,4 +1,5 @@
1
1
  module RailsExt
2
+
2
3
  module TemplateRenderer
3
4
 
4
5
  # record where the view rendered from, main project or which engine
@@ -6,7 +7,7 @@ module RailsExt
6
7
  def render_template(template, layout_name = nil, locals = nil)
7
8
  path = template.identifier
8
9
 
9
- result = path.match /(?<=\/)[a-zA-Z0-9_-]+(?=\/app\/views)/
10
+ result = path.match(/(?<=\/)[a-zA-Z0-9_-]+(?=\/app\/views)/)
10
11
  result = result.to_s.split('-').first.to_s + '/engine'
11
12
 
12
13
  engine = result.classify.safe_constantize
@@ -17,6 +18,22 @@ module RailsExt
17
18
  end
18
19
 
19
20
  end
21
+
22
+ module PartialRenderer
23
+
24
+ def find_template(path, locals)
25
+ if path.start_with?('_')
26
+ prefixes = @lookup_context.prefixes
27
+ elsif path.include?(?/)
28
+ prefixes = []
29
+ else
30
+ prefixes = @lookup_context.prefixes
31
+ end
32
+ @lookup_context.find_template(path, prefixes, true, locals, @details)
33
+ end
34
+
35
+ end
20
36
  end
21
37
 
22
38
  ActionView::TemplateRenderer.prepend RailsExt::TemplateRenderer
39
+ ActionView::PartialRenderer.prepend RailsExt::PartialRenderer
@@ -0,0 +1,28 @@
1
+ module VideoResponse
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ after_action :wrap_video
6
+ end
7
+
8
+ def wrap_video
9
+ if ['video/mp4'].include? self.response.media_type
10
+ add_range_headers
11
+ end
12
+ end
13
+
14
+ def add_range_headers
15
+ file_size = self.response.body.size
16
+ match = request.headers['range'].to_s.match(/bytes=(\d+)-(\d*)/)
17
+ match = Array(match)
18
+ file_begin = match[1].presence
19
+ file_end = match[2].presence
20
+ if file_begin && file_end
21
+ response.header['Content-Range'] = 'bytes ' + file_begin.to_s + '-' + file_end.to_s + '/' + file_size.to_s
22
+ response.header['Content-Length'] = (file_end.to_i - file_begin.to_i + 1).to_s
23
+ response.status = 206
24
+ end
25
+ end
26
+
27
+ end
28
+
File without changes
File without changes
@@ -0,0 +1,45 @@
1
+ module NumHelper
2
+ NUM = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
3
+ DEL = ['', '拾', '佰', '仟']
4
+ SUB_DEL = ['分', '角']
5
+ UNIT = ['元', '万', '亿', '兆', '京']
6
+ DELIMITER_REGEX = /(\d)(?=(\d\d\d\d)+(?!\d))/
7
+ extend self
8
+
9
+ def to_rmb(num)
10
+ left, right = num.to_s(:rounded, precision: 2, strip_insignificant_zeros: true, separator: '.', delimiter: ',', delimiter_pattern: DELIMITER_REGEX).split('.')
11
+
12
+ left_str = to_parts(left, unit: UNIT, del: DEL)
13
+
14
+ if right
15
+ right_str = to_parts(right, del: SUB_DEL)
16
+ left_str + right_str
17
+ else
18
+ left_str + '整'
19
+ end
20
+ end
21
+
22
+ def to_parts(num_str, unit: [], del: [])
23
+ han_arr = num_str.split(',').reverse.map.with_index do |str, index|
24
+ str = str.each_char.map { |i| NUM[i.to_i] }
25
+ xx = ''
26
+ str.zip(del[0..str.size - 1].reverse) do |st, de|
27
+ if st != '零' && de
28
+ xx << st + de
29
+ else
30
+ xx << st unless xx.end_with?('零')
31
+ end
32
+ end
33
+ if xx.chomp!('零')
34
+ xx << (unit[index].to_s) << '零'
35
+ else
36
+ xx << (unit[index].to_s)
37
+ end
38
+ xx
39
+ end
40
+
41
+ han_arr.reverse.join
42
+ end
43
+
44
+ end
45
+
File without changes
@@ -0,0 +1,58 @@
1
+ module TimeHelper
2
+ extend self
3
+
4
+ def exact_distance_time(from_time, to_time)
5
+ from_time = from_time.to_datetime
6
+ to_time = to_time.to_datetime
7
+
8
+ return {} if from_time > to_time
9
+
10
+ years = to_time.year - from_time.year
11
+ months = to_time.month - from_time.month
12
+ days = to_time.mday - from_time.mday
13
+ day_seconds = to_time.seconds_since_midnight.to_i - from_time.seconds_since_midnight.to_i
14
+
15
+ if day_seconds < 0
16
+ days -= 1
17
+ day_seconds = 86400 + day_seconds
18
+ end
19
+
20
+ if days < 0
21
+ months -= 1
22
+ days = to_time.prev_month.end_of_month.mday + days
23
+ end
24
+
25
+ if months < 0
26
+ years -= 1
27
+ months = 12 + months
28
+ end
29
+
30
+ hours, minute_seconds = day_seconds.to_i.divmod(3600)
31
+ minutes, seconds = minute_seconds.divmod(60)
32
+
33
+ { year: years, month: months, day: days, hour: hours, minute: minutes, second: seconds }
34
+ end
35
+
36
+ def interval(start_at, finish_at, interval_start: '12:30', since: 1.hour)
37
+ return 0 if start_at.blank? || finish_at.blank? || start_at >= finish_at
38
+ raise 'Must be same day!' if start_at.to_date != finish_at.to_date
39
+
40
+ hour, min = interval_start.split(':')
41
+ interval_start_at = start_at.change hour: hour, min: min
42
+ interval_finish_at = interval_start_at.since(since)
43
+
44
+ if start_at < interval_start_at && finish_at > interval_finish_at
45
+ seconds = ((finish_at - start_at) - since).to_i
46
+ elsif start_at < interval_start_at && finish_at >= interval_start_at && finish_at <= interval_finish_at
47
+ seconds = interval_start_at - start_at
48
+ elsif start_at >= interval_start_at && start_at <= interval_finish_at && finish_at > interval_finish_at
49
+ seconds = finish_at - interval_finish_at
50
+ elsif start_at >= interval_start_at && start_at <= interval_finish_at && finish_at <= interval_finish_at
51
+ seconds = 0
52
+ else
53
+ seconds = finish_at - start_at
54
+ end
55
+ seconds
56
+ end
57
+
58
+ end
File without changes
@@ -1,3 +1,3 @@
1
1
  module RailsCom
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
@@ -1,5 +1,5 @@
1
- <%%= form_with model: @<%= model_resource_name %>, local: true do |f| %>
2
- <%%= render 'shared/error_messages', target: @<%= singular_table_name %> %>
1
+ <%%= form_with model: @<%= singular_name %>, local: true do |f| %>
2
+ <%%= render 'shared/error_messages', target: @<%= singular_name %> %>
3
3
  <% attributes.each do |attribute| -%>
4
4
  <% if attribute.password_digest? -%>
5
5
  <%%= f.password_field :password %>
@@ -13,27 +13,35 @@
13
13
 
14
14
  <table class="ui bottom attached table">
15
15
  <thead>
16
- <tr>
17
- <% attributes.reject(&:password_digest?).each do |attribute| -%>
18
- <th><%= attribute.human_name %></th>
19
- <% end -%>
20
- </tr>
16
+ <tr>
17
+ <th><%%= <%= class_name %>.human_attribute_name(:id) %></th>
18
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
19
+ <th><%%= <%= class_name %>.human_attribute_name(:<%= attribute.name %>) %></th>
20
+ <% end -%>
21
+ <th>Actions</th>
22
+ </tr>
21
23
  </thead>
22
-
23
24
  <tbody>
24
- <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
25
+ <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
25
26
  <tr>
27
+ <td><%%= <%= singular_name %>.id %></td>
26
28
  <% attributes.reject(&:password_digest?).each do |attribute| -%>
27
- <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
29
+ <td><%%= <%= singular_name %>.<%= attribute.name %> %></td>
28
30
  <% end -%>
29
- <td>
30
- <%%= link_to 'Show', <%= singular_table_name %>_path(<%= singular_table_name %>), class: 'ui blue label' %>
31
- <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'ui pink label' %>
32
- <%%= link_to 'Destroy', <%= singular_table_name %>_path(<%= singular_table_name %>), method: :delete, data: { confirm: 'Are you sure?' }, class: 'ui red label' %>
31
+ <td class="ui labels">
32
+ <%%= link_to <%= singular_table_name %>_path(<%= singular_name %>), data: { tooltip: t('.show') }, class: 'ui blue mini icon button' do %>
33
+ <i class="location arrow icon"></i>
34
+ <%% end %>
35
+ <%%= link_to edit_<%= singular_table_name %>_path(<%= singular_name %>), data: { tooltip: t('.edit') }, class: 'ui pink mini icon button' do %>
36
+ <i class="pencil alternate icon"></i>
37
+ <%% end %>
38
+ <%%= link_to <%= singular_table_name %>_path(<%= singular_name %>), method: :delete, data: { tooltip: t('.destroy'), confirm: 'Are you sure?' }, class: 'ui red mini icon button' do %>
39
+ <i class="times icon"></i>
40
+ <%% end %>
33
41
  </td>
34
42
  </tr>
35
43
  <%% end %>
36
44
  </tbody>
37
45
  </table>
38
46
 
39
- <%%= paginate @<%= plural_table_name %> %>
47
+ <%%= paginate @<%= plural_name %> %>
@@ -1,7 +1,16 @@
1
- <% attributes.reject(&:password_digest?).each do |attribute| -%>
2
- <p>
3
- <strong><%= attribute.human_name %>:</strong>
4
- <%%= @<%= singular_table_name %>.<%= attribute.name %> %>
5
- </p>
1
+ <div class="ui segment breadcrumb">
2
+ <%%= link_to 'Back', <%= index_helper %>_path, class: 'section' %>
3
+ <div class="divider"> / </div>
4
+ <div class="active section">Show</div>
5
+ </div>
6
6
 
7
+ <table class="ui very basic large table">
8
+ <tbody>
9
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
10
+ <tr>
11
+ <td class="right aligned"><%%= <%= class_name %>.human_attribute_name(:<%= attribute.name %>) %></td>
12
+ <td><%%= @<%= singular_name %>.<%= attribute.name %> %></td>
13
+ </tr>
7
14
  <% end -%>
15
+ </tbody>
16
+ </table>
@@ -0,0 +1,48 @@
1
+ class <%= controller_class_name %>Controller < ApplicationController
2
+ before_action :set_<%= singular_table_name %>, only: [:show, :update, :destroy]
3
+
4
+ def index
5
+ @<%= plural_table_name %> = <%= orm_class.all(class_name) %>
6
+
7
+ render json: <%= "@#{plural_table_name}" %>
8
+ end
9
+
10
+ def show
11
+ render json: <%= "@#{singular_table_name}" %>
12
+ end
13
+
14
+ def create
15
+ @<%= singular_table_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %>
16
+
17
+ if @<%= orm_instance.save %>
18
+ render json: <%= "@#{singular_table_name}" %>, status: :created, location: <%= "@#{singular_table_name}" %>
19
+ else
20
+ render json: <%= "@#{orm_instance.errors}" %>, status: :unprocessable_entity
21
+ end
22
+ end
23
+
24
+ def update
25
+ if @<%= orm_instance.update("#{singular_table_name}_params") %>
26
+ render json: <%= "@#{singular_table_name}" %>
27
+ else
28
+ render json: <%= "@#{orm_instance.errors}" %>, status: :unprocessable_entity
29
+ end
30
+ end
31
+
32
+ def destroy
33
+ @<%= orm_instance.destroy %>
34
+ end
35
+
36
+ private
37
+ def set_<%= singular_table_name %>
38
+ @<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
39
+ end
40
+
41
+ def <%= "#{singular_table_name}_params" %>
42
+ <%- if attributes_names.empty? -%>
43
+ params.fetch(:<%= singular_table_name %>, {})
44
+ <%- else -%>
45
+ params.require(:<%= singular_table_name %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>)
46
+ <%- end -%>
47
+ end
48
+ end
@@ -1,21 +1,18 @@
1
- <% if namespaced? -%>
2
- require_dependency '<%= namespaced_path %>/application_controller'
3
- <% end -%>
4
1
  class <%= controller_class_name %>Controller < <%= controller_class_path.map(&:camelize).join('::') %>::BaseController
5
- before_action :set_<%= singular_table_name %>, only: [:show, :edit, :update, :destroy]
2
+ before_action :set_<%= singular_name %>, only: [:show, :edit, :update, :destroy]
6
3
 
7
4
  def index
8
- @<%= plural_table_name %> = <%= orm_class %>.page(params[:page])
5
+ @<%= plural_name %> = <%= class_name %>.page(params[:page])
9
6
  end
10
7
 
11
8
  def new
12
- @<%= singular_table_name %> = <%= orm_class.build(class_name) %>
9
+ @<%= singular_name %> = <%= orm_class.build(class_name) %>
13
10
  end
14
11
 
15
12
  def create
16
- @<%= singular_table_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %>
13
+ @<%= singular_name %> = <%= orm_class.build(class_name, "#{singular_name}_params") %>
17
14
 
18
- if @<%= orm_instance.save %>
15
+ if @<%= orm_instance(singular_name).save %>
19
16
  redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully created.'" %>
20
17
  else
21
18
  render :new
@@ -29,7 +26,7 @@ class <%= controller_class_name %>Controller < <%= controller_class_path.map(&:c
29
26
  end
30
27
 
31
28
  def update
32
- if @<%= orm_instance.update("#{singular_table_name}_params") %>
29
+ if @<%= orm_instance(singular_name).update("#{singular_name}_params") %>
33
30
  redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully updated.'" %>
34
31
  else
35
32
  render :edit
@@ -37,17 +34,21 @@ class <%= controller_class_name %>Controller < <%= controller_class_path.map(&:c
37
34
  end
38
35
 
39
36
  def destroy
40
- @<%= orm_instance.destroy %>
37
+ @<%= orm_instance(singular_name).destroy %>
41
38
  redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully destroyed.'" %>
42
39
  end
43
40
 
44
41
  private
45
- def set_<%= singular_table_name %>
46
- @<%= singular_table_name %> = <%= orm_class.find(class_name, "params[:id]") %>
42
+ def set_<%= singular_name %>
43
+ @<%= singular_name %> = <%= orm_class.find(class_name, "params[:id]") %>
47
44
  end
48
45
 
49
- def <%= "#{singular_table_name}_params" %>
50
- params.fetch(:<%= singular_table_name %>, {}).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>)
46
+ def <%= "#{singular_name}_params" %>
47
+ params.fetch(:<%= singular_name %>, {}).permit(
48
+ <% attributes_names.map do |name| -%>
49
+ <%= ":#{name}," %>
50
+ <% end -%>
51
+ )
51
52
  end
52
53
 
53
- end
54
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - qinmingyuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,28 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
19
+ version: '5.2'
20
+ - - "<="
25
21
  - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rucaptcha
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
22
+ version: '6.0'
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
27
  - - ">="
39
28
  - !ruby/object:Gem::Version
40
- version: '0'
29
+ version: '5.2'
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: '6.0'
41
33
  description: Rails Engine with many common utils
42
34
  email:
43
35
  - mingyuan0715@foxmail.com
@@ -45,26 +37,36 @@ executables: []
45
37
  extensions: []
46
38
  extra_rdoc_files: []
47
39
  files:
48
- - MIT-LICENSE
40
+ - LICENSE
49
41
  - README.md
50
42
  - Rakefile
51
43
  - app/assets/config/rails_com_manifest.js
52
44
  - app/assets/images/verification.jpg
45
+ - app/assets/javascripts/controllers/active_storage_ext/videos/show.ready.js
53
46
  - app/assets/javascripts/rails_com/application.js
54
47
  - app/assets/javascripts/rails_com/checkbox.js
55
48
  - app/assets/javascripts/rails_com/common.js
56
49
  - app/assets/javascripts/rails_com/fetch_xhr_script.js
57
50
  - app/assets/javascripts/rails_com/footer.js
58
51
  - app/assets/javascripts/rails_com/sidebar.js
52
+ - app/assets/stylesheets/controllers/active_storage_ext/videos/show.css
53
+ - app/assets/stylesheets/controllers/active_storage_ext/videos/transfer.css
59
54
  - app/assets/stylesheets/rails_com/application.css
60
- - app/controllers/common_controller.rb
55
+ - app/controllers/active_storage/attachments_controller.rb
56
+ - app/controllers/active_storage_ext/videos_controller.rb
61
57
  - app/controllers/concerns/the_common_api.rb
62
- - app/controllers/the_guards_controller.rb
63
58
  - app/helpers/rails_com/active_helper.rb
64
59
  - app/helpers/rails_com/assets_helper.rb
65
- - app/helpers/rails_com/common_helper.rb
60
+ - app/helpers/rails_com/format_helper.rb
66
61
  - app/helpers/rails_com/time_helper.rb
67
62
  - app/models/state_machine.rb
63
+ - app/views/active_storage/attachments/_image_item.html.erb
64
+ - app/views/active_storage/attachments/_list.html.erb
65
+ - app/views/active_storage/attachments/_list_edit.html.erb
66
+ - app/views/active_storage/attachments/_list_form.html.erb
67
+ - app/views/active_storage/attachments/_video_item.html.erb
68
+ - app/views/active_storage/attachments/destroy.js.erb
69
+ - app/views/active_storage_ext/videos/show.html.erb
68
70
  - app/views/kaminari/_first_page.html.erb
69
71
  - app/views/kaminari/_gap.html.erb
70
72
  - app/views/kaminari/_last_page.html.erb
@@ -76,7 +78,6 @@ files:
76
78
  - app/views/shared/_alert.html.erb
77
79
  - app/views/shared/_error_messages.html.erb
78
80
  - app/views/shared/_locales.html.erb
79
- - app/views/the_guards/index.html.erb
80
81
  - config/locales/en.yml
81
82
  - config/locales/zh.datetime.yml
82
83
  - config/locales/zh.yml
@@ -85,29 +86,39 @@ files:
85
86
  - lib/generators/doc_model_generator.rb
86
87
  - lib/generators/doc_models_generator.rb
87
88
  - lib/generators/templates/model.erb
89
+ - lib/mina/git2.rb
88
90
  - lib/mina/puma.rb
89
91
  - lib/mina/sidekiq.rb
90
92
  - lib/mina/whenever.rb
91
93
  - lib/rails_com.rb
92
94
  - lib/rails_com/config.rb
93
- - lib/rails_com/controller_helper.rb
94
- - lib/rails_com/controllers.rb
95
95
  - lib/rails_com/core_ext/array.rb
96
+ - lib/rails_com/core_ext/date.rb
96
97
  - lib/rails_com/core_ext/hash.rb
97
98
  - lib/rails_com/core_ext/nil.rb
99
+ - lib/rails_com/core_ext/numeric.rb
100
+ - lib/rails_com/core_ext/string.rb
98
101
  - lib/rails_com/engine.rb
99
- - lib/rails_com/helpers/jobber.rb
100
- - lib/rails_com/helpers/uid_helper.rb
101
- - lib/rails_com/model_helper.rb
102
- - lib/rails_com/models.rb
102
+ - lib/rails_com/helpers/controller_helper.rb
103
+ - lib/rails_com/helpers/model_helper.rb
104
+ - lib/rails_com/meta/controllers.rb
105
+ - lib/rails_com/meta/models.rb
106
+ - lib/rails_com/meta/routes.rb
103
107
  - lib/rails_com/rails_ext/activestorage_attached.rb
108
+ - lib/rails_com/rails_ext/attachment_transfer.rb
109
+ - lib/rails_com/rails_ext/named_base.rb
104
110
  - lib/rails_com/rails_ext/persistence_sneakily.rb
105
111
  - lib/rails_com/rails_ext/scaffold_generator.rb
106
112
  - lib/rails_com/rails_ext/template_renderer.rb
107
113
  - lib/rails_com/rails_ext/translation_helper.rb
108
- - lib/rails_com/routes.rb
109
- - lib/rails_com/setting.rb
114
+ - lib/rails_com/rails_ext/video_response.rb
110
115
  - lib/rails_com/sprockets/non_digest_assets.rb
116
+ - lib/rails_com/utils/ip_helper.rb
117
+ - lib/rails_com/utils/jobber.rb
118
+ - lib/rails_com/utils/num_helper.rb
119
+ - lib/rails_com/utils/setting.rb
120
+ - lib/rails_com/utils/time_helper.rb
121
+ - lib/rails_com/utils/uid_helper.rb
111
122
  - lib/rails_com/version.rb
112
123
  - lib/tasks/rails_com_tasks.rake
113
124
  - lib/templates/erb/scaffold/_form.html.erb.tt
@@ -116,12 +127,11 @@ files:
116
127
  - lib/templates/erb/scaffold/index.html.erb.tt
117
128
  - lib/templates/erb/scaffold/new.html.erb.tt
118
129
  - lib/templates/erb/scaffold/show.html.erb.tt
130
+ - lib/templates/rails/scaffold_controller/api_controller.rb.tt
119
131
  - lib/templates/rails/scaffold_controller/controller.rb.tt
120
- - lib/utils/ip_helper.rb
121
- - lib/utils/time_helper.rb
122
132
  homepage: https://github.com/qinmingyuan/rails_com
123
133
  licenses:
124
- - MIT
134
+ - LGPL-3.0
125
135
  metadata: {}
126
136
  post_install_message:
127
137
  rdoc_options: []
@@ -139,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
149
  version: '0'
140
150
  requirements: []
141
151
  rubyforge_project:
142
- rubygems_version: 2.7.6
152
+ rubygems_version: 2.7.7
143
153
  signing_key:
144
154
  specification_version: 4
145
- summary: Rails Engine with many common utils
155
+ summary: Rails Engine with common utils
146
156
  test_files: []