attachs 0.4.5 → 4.0.0.0

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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +83 -218
  4. data/Rakefile +1 -14
  5. data/lib/attachs.rb +98 -31
  6. data/lib/attachs/attachment.rb +301 -72
  7. data/lib/attachs/builder.rb +78 -0
  8. data/lib/attachs/collection.rb +84 -0
  9. data/lib/attachs/concern.rb +47 -0
  10. data/lib/attachs/configuration.rb +11 -0
  11. data/lib/attachs/console.rb +40 -0
  12. data/lib/attachs/extensions/active_record/base.rb +24 -0
  13. data/lib/attachs/extensions/active_record/validations/attachment_content_type_validator.rb +37 -0
  14. data/lib/attachs/extensions/active_record/validations/attachment_presence_validator.rb +27 -0
  15. data/lib/attachs/extensions/active_record/validations/attachment_size_validator.rb +55 -0
  16. data/lib/attachs/extensions/active_record/validations/attachment_validator.rb +24 -0
  17. data/lib/attachs/interpolations.rb +27 -0
  18. data/lib/attachs/jobs/base.rb +14 -0
  19. data/lib/attachs/jobs/delete_job.rb +15 -0
  20. data/lib/attachs/jobs/update_job.rb +11 -0
  21. data/lib/attachs/locales/en.yml +2 -6
  22. data/lib/attachs/locales/es.yml +2 -6
  23. data/lib/attachs/processors/base.rb +4 -14
  24. data/lib/attachs/processors/image.rb +45 -0
  25. data/lib/attachs/railtie.rb +7 -27
  26. data/lib/attachs/storages/base.rb +10 -59
  27. data/lib/attachs/storages/s3.rb +68 -63
  28. data/lib/attachs/version.rb +1 -1
  29. data/lib/generators/attachs/install/install_generator.rb +15 -0
  30. data/lib/generators/attachs/install/templates/initializer.rb +7 -0
  31. data/lib/generators/attachs/upload/templates/migration.rb +11 -0
  32. data/lib/generators/attachs/upload/templates/model.rb +19 -0
  33. data/lib/generators/attachs/upload/upload_generator.rb +24 -0
  34. data/lib/tasks/attachs.rake +12 -26
  35. data/test/attachment_test.rb +175 -12
  36. data/test/collection_test.rb +52 -0
  37. data/test/concern_test.rb +10 -0
  38. data/test/dummy/Rakefile +1 -2
  39. data/test/dummy/app/assets/javascripts/application.js +2 -2
  40. data/test/dummy/app/assets/stylesheets/application.css +6 -4
  41. data/test/dummy/app/models/product.rb +16 -0
  42. data/test/dummy/app/models/shop.rb +14 -0
  43. data/test/dummy/app/models/upload.rb +19 -0
  44. data/test/dummy/app/views/layouts/application.html.erb +9 -11
  45. data/test/dummy/bin/bundle +1 -0
  46. data/test/dummy/bin/rails +2 -1
  47. data/test/dummy/bin/rake +1 -0
  48. data/test/dummy/bin/setup +30 -0
  49. data/test/dummy/config.ru +1 -1
  50. data/test/dummy/config/application.rb +3 -2
  51. data/test/dummy/config/boot.rb +1 -1
  52. data/test/dummy/config/database.yml +4 -22
  53. data/test/dummy/config/database.yml.travis +3 -0
  54. data/test/dummy/config/environment.rb +1 -1
  55. data/test/dummy/config/environments/development.rb +15 -3
  56. data/test/dummy/config/environments/production.rb +21 -26
  57. data/test/dummy/config/environments/test.rb +10 -12
  58. data/test/dummy/config/initializers/assets.rb +11 -0
  59. data/test/dummy/config/initializers/attachs.rb +7 -21
  60. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  61. data/test/dummy/config/initializers/mime_types.rb +1 -2
  62. data/test/dummy/config/initializers/session_store.rb +1 -1
  63. data/test/dummy/config/routes.rb +54 -0
  64. data/test/dummy/config/secrets.yml +24 -0
  65. data/test/dummy/db/migrate/20161024234003_create_shops.rb +11 -0
  66. data/test/dummy/db/migrate/20161024234029_create_products.rb +12 -0
  67. data/test/dummy/db/migrate/20161031135453_create_uploads.rb +11 -0
  68. data/test/dummy/db/schema.rb +27 -16
  69. data/test/dummy/log/development.log +61 -0
  70. data/test/dummy/log/test.log +5873 -0
  71. data/test/dummy/public/404.html +58 -55
  72. data/test/dummy/public/422.html +58 -55
  73. data/test/dummy/public/500.html +57 -54
  74. data/test/fixtures/big_file.txt +50 -0
  75. data/test/fixtures/big_image.jpg +0 -0
  76. data/test/fixtures/file.txt +1 -0
  77. data/test/fixtures/image.jpg +0 -0
  78. data/test/{dummy/test/fixtures/file.txt → fixtures/small_file.txt} +0 -0
  79. data/test/fixtures/small_image.jpg +0 -0
  80. data/test/generator_test.rb +14 -6
  81. data/test/helper_test.rb +28 -0
  82. data/test/query_test.rb +26 -0
  83. data/test/support/storage_helper.rb +65 -0
  84. data/test/task_test.rb +69 -0
  85. data/test/test_helper.rb +6 -45
  86. data/test/upload_test.rb +27 -0
  87. data/test/validator_test.rb +160 -0
  88. metadata +114 -68
  89. data/lib/attachs/active_record/base.rb +0 -103
  90. data/lib/attachs/active_record/connection_adapters.rb +0 -40
  91. data/lib/attachs/active_record/migration.rb +0 -17
  92. data/lib/attachs/active_record/validators.rb +0 -7
  93. data/lib/attachs/active_record/validators/attachment_content_type_validator.rb +0 -30
  94. data/lib/attachs/active_record/validators/attachment_presence_validator.rb +0 -22
  95. data/lib/attachs/active_record/validators/attachment_size_validator.rb +0 -47
  96. data/lib/attachs/processors/thumbnail.rb +0 -69
  97. data/lib/attachs/storages/local.rb +0 -95
  98. data/lib/attachs/types/base.rb +0 -22
  99. data/lib/attachs/types/default.rb +0 -29
  100. data/lib/attachs/types/regular.rb +0 -21
  101. data/lib/generators/attachs/install_generator.rb +0 -13
  102. data/lib/generators/attachs/templates/attachs.rb +0 -2
  103. data/test/dummy/README.rdoc +0 -28
  104. data/test/dummy/app/models/medium.rb +0 -5
  105. data/test/dummy/app/models/picture.rb +0 -2
  106. data/test/dummy/config/initializers/secret_token.rb +0 -13
  107. data/test/dummy/config/s3.yml +0 -15
  108. data/test/dummy/db/migrate/20140808012639_create_media.rb +0 -11
  109. data/test/dummy/test/fixtures/image.gif +0 -0
  110. data/test/local_storage_test.rb +0 -72
  111. data/test/migration_test.rb +0 -65
  112. data/test/processor_test.rb +0 -49
  113. data/test/s3_storage_tes.rb +0 -66
  114. data/test/tasks_test.rb +0 -57
  115. data/test/validators_test.rb +0 -100
@@ -1,30 +1,16 @@
1
- module Attachs
2
- module Task
3
- def self.process(force)
4
- model = (ENV['class'] || ENV['CLASS']).classify.constantize
5
- attachment = (ENV['attachment'] || ENV['ATTACHMENT']).to_sym
6
- model.find_each do |record|
7
- model.attachments.each do |attr, options|
8
- if attr == attachment
9
- record.send(attr).process(force)
10
- end
11
- end
12
- end
13
- end
1
+ namespace :attachs do
2
+ desc 'Reprocess all attachments.'
3
+ task reprocess: :environment do
4
+ Attachs.reprocess
14
5
  end
15
- end
16
6
 
17
- namespace :attachs do
18
- namespace :refresh do
19
- desc 'Refreshs all styles.'
20
- task all: :environment do
21
- Attachs::Task.process true
22
- Rails.logger.info 'All styles regenerated successfully.'
23
- end
24
- desc 'Refreshs missing styles.'
25
- task missing: :environment do
26
- Attachs::Task.process false
27
- Rails.logger.info 'Missing styles regenerated successfully.'
28
- end
7
+ desc 'Fixes missing styles.'
8
+ task fix_missings: :environment do
9
+ Attachs.fix_missings
10
+ end
11
+
12
+ desc 'Clears orphan files.'
13
+ task clear: :environment do
14
+ Attachs.clear
29
15
  end
30
16
  end
@@ -1,23 +1,186 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class AttachmentTest < ActiveSupport::TestCase
4
+ include StorageHelper
4
5
 
5
- teardown do
6
- clean_storage
6
+ test 'nested attributes' do
7
+ product = Product.new
8
+ product.brief_attributes = { value: file }
9
+
10
+ assert product.brief.present?
11
+ end
12
+
13
+ test 'default' do
14
+ product = Product.new
15
+ attachment = product.pictures.new
16
+
17
+ assert_equal 'https://s3.amazonaws.com/attachs.test/missing.png', attachment.url
7
18
  end
8
19
 
9
- test 'attachment source' do
10
- original_medium = Medium.create(attach: file_upload)
11
- copied_medium = Medium.create(attach: original_medium.attach)
12
- %w(filename content_type size updated_at).each do |attr|
13
- assert_equal original_medium.attach.send(attr), copied_medium.attach.send(attr)
14
- end
20
+ test 'attributes' do
21
+ shop = Shop.new
22
+ attachment = shop.logo
23
+
24
+ assert_nil attachment.id
25
+ assert_nil attachment.filename
26
+ assert_nil attachment.basename
27
+ assert_nil attachment.extension
28
+ assert_nil attachment.content_type
29
+ assert_nil attachment.type
30
+ assert_nil attachment.size
31
+ assert_nil attachment.uploaded_at
32
+ assert_equal Hash[tiny: '25x25', small: '150x150#', medium: '300x300!', large: '600x'], attachment.styles
33
+ assert_not attachment.changed?
34
+ assert_not attachment.present?
35
+ assert_not attachment.persisted?
36
+ assert attachment.blank?
37
+ assert_raises { attachment.width }
38
+ assert_raises { attachment.height }
39
+ assert_raises { attachment.ratio }
40
+ assert_nil attachment.url
41
+ assert_nil attachment.url(:tiny)
42
+
43
+ shop.logo = image
44
+ attachment = shop.logo
45
+
46
+ assert attachment.id
47
+ assert_equal 'image.jpg', attachment.filename
48
+ assert_equal 'image', attachment.basename
49
+ assert_equal '.jpg', attachment.extension
50
+ assert_equal 'image/jpeg', attachment.content_type
51
+ assert_equal 'image', attachment.type
52
+ assert_equal 74474, attachment.size
53
+ assert_equal Date.today, attachment.uploaded_at.to_date
54
+ assert_equal Hash[tiny: '25x25', small: '150x150#', medium: '300x300!', large: '600x'], attachment.styles
55
+ assert attachment.changed?
56
+ assert attachment.present?
57
+ assert_not attachment.blank?
58
+ assert_not attachment.persisted?
59
+ assert_equal 400, attachment.width
60
+ assert_equal 269, attachment.height
61
+ assert_equal (269.0 / 400.0), attachment.ratio
62
+ assert_nil attachment.url
63
+ assert_nil attachment.url(:tiny)
64
+
65
+ shop.save!
66
+ shop.run_callbacks :commit
67
+ shop.reload
68
+ attachment = shop.logo
69
+
70
+ assert attachment.id
71
+ assert_equal 'image.jpg', attachment.filename
72
+ assert_equal 'image', attachment.basename
73
+ assert_equal '.jpg', attachment.extension
74
+ assert_equal 'image/jpeg', attachment.content_type
75
+ assert_equal 'image', attachment.type
76
+ assert_equal 74474, attachment.size
77
+ assert_equal Date.today, attachment.uploaded_at.to_date
78
+ assert_equal Hash[tiny: '25x25', small: '150x150#', medium: '300x300!', large: '600x'], attachment.styles
79
+ assert_not attachment.changed?
80
+ assert attachment.present?
81
+ assert attachment.persisted?
82
+ assert_not attachment.blank?
83
+ assert_equal 400, attachment.width
84
+ assert_equal 269, attachment.height
85
+ assert_equal (269.0 / 400.0), attachment.ratio
86
+ assert_equal "https://s3.amazonaws.com/attachs.test/#{attachment.id}-original.png", attachment.url
87
+ assert_equal "https://s3.amazonaws.com/attachs.test/#{attachment.id}-tiny.png", attachment.url(:tiny)
88
+ assert_equal "https://s3.amazonaws.com/attachs.test/#{attachment.id}-small.png", attachment.url(:small)
89
+ assert_equal "https://s3.amazonaws.com/attachs.test/#{attachment.id}-medium.png", attachment.url(:medium)
90
+ assert_equal "https://s3.amazonaws.com/attachs.test/#{attachment.id}-large.png", attachment.url(:large)
91
+ assert_url_content_type 'image/png', attachment.url
92
+ assert_url_dimensions '400x269', attachment.url
93
+ assert_url_content_type 'image/png', attachment.url(:tiny)
94
+ assert_url_dimensions '25x17', attachment.url(:tiny)
95
+ assert_url_content_type 'image/png', attachment.url(:small)
96
+ assert_url_dimensions '150x150', attachment.url(:small)
97
+ assert_url_content_type 'image/png', attachment.url(:medium)
98
+ assert_url_dimensions '300x300', attachment.url(:medium)
99
+ assert_url_content_type 'image/png', attachment.url(:large)
100
+ assert_url_dimensions '600x404', attachment.url(:large)
101
+
102
+ saved_attachment = attachment.dup
103
+ shop.destroy
104
+ shop.run_callbacks :commit
105
+
106
+ assert_nil attachment.id
107
+ assert_nil attachment.filename
108
+ assert_nil attachment.basename
109
+ assert_nil attachment.extension
110
+ assert_nil attachment.content_type
111
+ assert_nil attachment.type
112
+ assert_nil attachment.size
113
+ assert_nil attachment.uploaded_at
114
+ assert_equal Hash[tiny: '25x25', small: '150x150#', medium: '300x300!', large: '600x'], attachment.styles
115
+ assert_not attachment.changed?
116
+ assert_not attachment.present?
117
+ assert_not attachment.persisted?
118
+ assert attachment.blank?
119
+ assert_raises { attachment.width }
120
+ assert_raises { attachment.height }
121
+ assert_raises { attachment.ratio }
122
+ sleep 5
123
+ assert_not_url saved_attachment.url
124
+ assert_not_url saved_attachment.url(:tiny)
125
+ assert_not_url saved_attachment.url(:small)
126
+ assert_not_url saved_attachment.url(:medium)
127
+ assert_not_url saved_attachment.url(:large)
15
128
  end
16
129
 
17
- test 'uri source' do
18
- medium = Medium.create(attach: URI('https://s3.amazonaws.com/attachs-test/file.txt'))
19
- file_path = Rails.root.join('public/storage/original/file.txt')
20
- assert File.exist?(file_path)
130
+ test 'renames' do
131
+ shop = Shop.create(logo: image, name: 'Anderstons')
132
+ shop.run_callbacks :commit
133
+ attachment = shop.logo
134
+
135
+ assert_equal "https://s3.amazonaws.com/attachs.test/anderstons/#{attachment.id}-original.png", attachment.url
136
+ assert_equal "https://s3.amazonaws.com/attachs.test/anderstons/#{attachment.id}-tiny.png", attachment.url(:tiny)
137
+ assert_equal "https://s3.amazonaws.com/attachs.test/anderstons/#{attachment.id}-small.png", attachment.url(:small)
138
+ assert_equal "https://s3.amazonaws.com/attachs.test/anderstons/#{attachment.id}-medium.png", attachment.url(:medium)
139
+ assert_equal "https://s3.amazonaws.com/attachs.test/anderstons/#{attachment.id}-large.png", attachment.url(:large)
140
+ assert_url attachment.url
141
+ assert_url attachment.url(:tiny)
142
+ assert_url attachment.url(:small)
143
+ assert_url attachment.url(:medium)
144
+ assert_url attachment.url(:large)
145
+
146
+ original_attachment = attachment.dup
147
+ shop.update! name: 'Musicians Friend'
148
+ shop.run_callbacks :commit
149
+ shop.reload
150
+ attachment = shop.logo
151
+
152
+ sleep 5
153
+ assert_equal "https://s3.amazonaws.com/attachs.test/musicians-friend/#{attachment.id}-original.png", attachment.url
154
+ assert_equal "https://s3.amazonaws.com/attachs.test/musicians-friend/#{attachment.id}-tiny.png", attachment.url(:tiny)
155
+ assert_equal "https://s3.amazonaws.com/attachs.test/musicians-friend/#{attachment.id}-small.png", attachment.url(:small)
156
+ assert_equal "https://s3.amazonaws.com/attachs.test/musicians-friend/#{attachment.id}-medium.png", attachment.url(:medium)
157
+ assert_equal "https://s3.amazonaws.com/attachs.test/musicians-friend/#{attachment.id}-large.png", attachment.url(:large)
158
+ assert_url attachment.url
159
+ assert_url attachment.url(:tiny)
160
+ assert_url attachment.url(:small)
161
+ assert_url attachment.url(:medium)
162
+ assert_url attachment.url(:large)
163
+ assert_url original_attachment.url
164
+ assert_url original_attachment.url(:tiny)
165
+ assert_url original_attachment.url(:small)
166
+ assert_url original_attachment.url(:medium)
167
+ assert_url original_attachment.url(:large)
168
+
169
+ renamed_attachment = attachment.dup
170
+ shop.destroy
171
+ shop.run_callbacks :commit
172
+
173
+ sleep 5
174
+ assert_not_url renamed_attachment.url
175
+ assert_not_url renamed_attachment.url(:tiny)
176
+ assert_not_url renamed_attachment.url(:small)
177
+ assert_not_url renamed_attachment.url(:medium)
178
+ assert_not_url renamed_attachment.url(:large)
179
+ assert_not_url original_attachment.url
180
+ assert_not_url original_attachment.url(:tiny)
181
+ assert_not_url original_attachment.url(:small)
182
+ assert_not_url original_attachment.url(:medium)
183
+ assert_not_url original_attachment.url(:large)
21
184
  end
22
185
 
23
186
  end
@@ -0,0 +1,52 @@
1
+ require 'test_helper'
2
+
3
+ class CollectionTest < ActiveSupport::TestCase
4
+ include StorageHelper
5
+
6
+ test 'nested attributes' do
7
+ product = Product.new(pictures: [image])
8
+ product.pictures_attributes = [
9
+ { id: product.pictures.first.id, _destroy: '1' },
10
+ { value: image }
11
+ ]
12
+
13
+ assert product.pictures.first.blank?
14
+ assert product.pictures.second.present?
15
+ end
16
+
17
+ test 'attributes' do
18
+ product = Product.new(pictures: [image])
19
+ assert_equal 1, product.pictures.size
20
+
21
+ product.pictures.new
22
+ assert_equal 2, product.pictures.size
23
+
24
+ product.pictures[1] = image
25
+ assert_equal 2, product.pictures.size
26
+
27
+ product.save
28
+ product.run_callbacks :commit
29
+ product.reload
30
+
31
+ assert_equal 2, product.pictures.size
32
+
33
+ product.pictures.destroy
34
+ end
35
+
36
+ test 'index' do
37
+ product = Product.new(pictures: [image, image])
38
+ attachment1 = product.pictures.first
39
+ attachment2 = product.pictures.second
40
+ attachment2.position = 0
41
+
42
+ assert_equal attachment2.id, product.pictures.first.id
43
+ assert_equal attachment1.id, product.pictures.second.id
44
+
45
+ product.save
46
+ product.reload
47
+
48
+ assert_equal attachment2.id, product.pictures.first.id
49
+ assert_equal attachment1.id, product.pictures.second.id
50
+ end
51
+
52
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class ConcernTest < ActiveSupport::TestCase
4
+
5
+ test 'inherit' do
6
+ Subclass = Class.new(Product)
7
+ assert_equal Product.attachments, Subclass.attachments
8
+ end
9
+
10
+ end
@@ -2,5 +2,4 @@
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
4
  require File.expand_path('../config/application', __FILE__)
5
-
6
- Dummy::Application.load_tasks
5
+ Rails.application.load_tasks
@@ -2,12 +2,12 @@
2
2
  // listed below.
3
3
  //
4
4
  // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
8
  // compiled file.
9
9
  //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
13
  //= require_tree .
@@ -3,11 +3,13 @@
3
3
  * listed below.
4
4
  *
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
10
12
  *
11
- *= require_self
12
13
  *= require_tree .
14
+ *= require_self
13
15
  */
@@ -0,0 +1,16 @@
1
+ class Product < ActiveRecord::Base
2
+
3
+ belongs_to :shop
4
+
5
+ has_attachments(
6
+ :pictures,
7
+ path: ':id-:style.:extension',
8
+ default_path: 'missing.png'
9
+ )
10
+
11
+ has_attachment(
12
+ :brief,
13
+ path: ':id.:extension'
14
+ )
15
+
16
+ end
@@ -0,0 +1,14 @@
1
+ class Shop < ActiveRecord::Base
2
+
3
+ has_attachment(
4
+ :logo,
5
+ path: ':name/:id-:style.png',
6
+ styles: {
7
+ tiny: '25x25',
8
+ small: '150x150#',
9
+ medium: '300x300!',
10
+ large: '600x'
11
+ }
12
+ )
13
+
14
+ end
@@ -0,0 +1,19 @@
1
+ class Upload < ActiveRecord::Base
2
+
3
+ has_attachment(
4
+ :file,
5
+ path: ':id-:style.:extension',
6
+ styles: ->(record) {
7
+ record.model.attachments[record.record_attribute.to_sym][:styles]
8
+ }
9
+ )
10
+
11
+ validates_presence_of :file, :record_type, :record_attribute
12
+
13
+ def model
14
+ if record_type
15
+ record_type.classify.constantize
16
+ end
17
+ end
18
+
19
+ end
@@ -1,14 +1,12 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+ <%= yield %>
11
+ </body>
14
12
  </html>
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
4
  load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
2
+
3
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
4
  require_relative '../config/boot'
4
5
  require 'rails/commands'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require_relative '../config/boot'
3
4
  require 'rake'
4
5
  Rake.application.run