itmammoth / rails_sortable

Easy drag & drop sorting with persisting the arranged order for rails
MIT License
142 stars 37 forks source link

Remove cache files in dummy in spec #41

Closed ekremkaraca closed 5 years ago

ekremkaraca commented 5 years ago

Hi,

while installing the gem, sprockets caches in dummy in spec folder is installed. It uses more than 8 MB space and the gem weighs 5 MB. Can you remove it from the gem?

❯ gem i rails_sortable --verbose
... # omitted for brevity
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/wX/wX5TuuAiX0KoZZQDqA0pkg0_zxQpPI7SDTn0ZZUTxcQ.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/wv/wvLIhRJ2wqhPrnqvkacm2QHyG0rFmmf3VSAGNiZnOWU.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/x5/x5ha-Z4qc_6UIT9KoHrYIvcDTGzhHTJUBYSnsxL_R9o.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7xEhYRDDUBfDKsN0jxX__uWTgzdd5XG51EBrTcof3E.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xP/xP6CXq8ijIC31bX-551FhfNHTjzVi19Y1HM4P-l05gk.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xb/xbyHnHRcdnYQamtz02quX36a2_ef91bDpDlDcKN9k8w.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xf/xfR7DxnUeBsEPt3xHCn6q28Ywsa1QjteIkEN-cO7mLc.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xi/Xi_I5uFryOqg-E4QMxsRsbGzlFo5sEd8IgQhNL3pG2I.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xi/xiyktcCc7fjOiqg8GNi_eaQKrlTYOEKfBMGowfYymKs.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xm/xmzEYT9vU2zilqOPOVas6v0laZBUghwJbMZPkcmseT0.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xo/xomBLC8CXZdVx5BbdIwBVW9ROU-L7Lx6udDAW3t43I4.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xo/xox6GSP3_45BgwDA_Qsm5x9I4tMzd_-JBiArTeUVQQI.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/xu/xugyT_m59-IPS-aiULB0gxNzv1gbjlfhGlvlsFO0x2Y.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/y4/y4_xKOEmTFo148XzK_emCdlTe5iqORvm-au3IDHHxPg.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/y4/y4gr7bfK2vf1y-Zo9vCb1XBPN8E3xPYWW3Z4m7vjVMw.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/y9/y9FjqA20KTbfYLOcyl8IvHlLHJ4CHaFiq4dpwC1NwAc.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/yu/Yu-KtWcpPD1MEg-wKGjeBP6ON_3ieFVU01dzVmi96jc.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/yu/yue8-Q5bNZaBmyxqsXfEfa-f2AFyNQfYiPjFz1iiOC8.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/yu/yuwmn98doTj56vnrPNlt0MuB_saWjn0L3FxjZRnAXwM.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/yv/yvMbRMt8t7laAS_JbXEu1AGKqtNpY1ssT0Pd91PiJBQ.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/yz/yzlOl-E-9KRNx3srRMsJOBf6sPVDpEXf5K5St-h7J2w.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/z4/z4IPqa2GavyC7WdY_wl7hSK6UzXmMrtiS2ibU2USzig.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zD/zD3nxsMe3UFxFoV5-gI9RNqYHG3tEj737-irq20e6Fo.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zf/zF1W191tyyUh00LT5FNorujBZKbT0S6emjIsaoTyOHE.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zf/zfMPdEUfQOzkNPjdvWAjTqbY2NYcDouR1aWyxGy1k6o.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zp/zpHzjLS4rrb5Z7QGgYBKexGFcPuSHOpanTl4PD3tePU.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zw/zwJgJL0K4GhfgTJSYALV6kWoitPrL2DXnHHKBZEO6Gw.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zx/zxq9NzAONMCEslN4ziYTixCSXQIEK7jM97P3CbOgyWk.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/dummy/tmp/cache/assets/sprockets/v3.0/zx/zxsh3jMQyGNRzstETFfbXwiemTRPlufYWQTPehDi6Ek.cache
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/helpers/sortable_helper_spec.rb
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/models/rails_sortable/model_spec.rb
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/spec/spec_helper.rb
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/vendor/assets/javascripts/plugin.js
/home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0/vendor/assets/javascripts/rails_sortable.js
Successfully installed rails_sortable-1.3.0
1 gem installed
itmammoth commented 5 years ago

I removed them from the gem. Please try version 1.3.1. Thanks!

ekremkaraca commented 5 years ago

@itmammoth Wow, the gem is now 21KB! Thanks so much! Here are difference in size (using ncdu):

Before:

--- /home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.0
   11.5 MiB [##########] /spec                                                                                            
   32.0 KiB [          ] /app
   32.0 KiB [          ] /lib
   20.0 KiB [          ] /vendor
    8.0 KiB [          ] /config
    4.0 KiB [          ]  README.md
    4.0 KiB [          ]  LICENSE
    4.0 KiB [          ]  Rakefile

After:

--- /home/ekrem/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_sortable-1.3.1
  356.0 KiB [##########] /spec                                                                                            
   32.0 KiB [          ] /app
   32.0 KiB [          ] /lib
   20.0 KiB [          ] /vendor
    8.0 KiB [          ] /config
    4.0 KiB [          ]  README.md
    4.0 KiB [          ]  LICENSE
    4.0 KiB [          ]  Rakefile