Skip to content

Commit

Permalink
Rename unnecessary "attache/boot" to "attache"
Browse files Browse the repository at this point in the history
  • Loading branch information
choonkeat committed Oct 27, 2015
1 parent 36e9042 commit 6c6678c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Procfile
@@ -1,2 +1,2 @@
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -e production -q attache_vhost_jobs -r ./lib/attache/boot.rb
worker: bundle exec sidekiq -e production -q attache_vhost_jobs -r ./lib/attache.rb
2 changes: 1 addition & 1 deletion config.ru
@@ -1,4 +1,4 @@
require 'attache/boot'
require 'attache'

use Attache::Delete
use Attache::Upload
Expand Down
2 changes: 1 addition & 1 deletion exe/attache
Expand Up @@ -29,7 +29,7 @@ else
open("Procfile", "w") do |f|
f.write <<-EOM.gsub(/^\s+/, '')
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -e production -q attache_vhost_jobs -r #{File.expand_path("../lib/attache/boot.rb", File.dirname(__FILE__))}
worker: bundle exec sidekiq -e production -q attache_vhost_jobs -r #{File.expand_path("../lib/attache.rb", File.dirname(__FILE__))}
EOM
end
puts "Initialized Procfile"
Expand Down
37 changes: 37 additions & 0 deletions lib/attache.rb
@@ -1,3 +1,27 @@
require 'active_support/all'
require 'sys/filesystem'
require 'securerandom'
require 'disk_store'
require 'fileutils'
require 'paperclip'
require 'sidekiq'
require 'tmpdir'
require 'logger'
require 'base64'
require 'rack'
require 'json'
require 'uri'
require 'cgi'
require 'fog'

if ENV['REDIS_PROVIDER'] || ENV['REDIS_URL']
# default sidekiq
elsif ENV['INLINE_UPLOAD']
require 'sidekiq/testing/inline'
else
require 'sucker_punch'
end

module Attache
class << self
attr_accessor :localdir,
Expand All @@ -19,3 +43,16 @@ class << self
reaper_interval: ENV.fetch('CACHE_EVICTION_INTERVAL_SECONDS') { 60 }.to_i,
eviction_strategy: (Attache.vhost.empty? ? nil : :LRU), # lru eviction only when there is remote storage
})
Attache.publicdir = ENV.fetch("PUBLIC_DIR") { File.expand_path("../public", File.dirname(__FILE__)) }

require 'attache/job'
require 'attache/resize_job'
require 'attache/base'
require 'attache/vhost'
require 'attache/upload'
require 'attache/delete'
require 'attache/download'
require 'attache/file_response_body'

require 'attache/tus'
require 'attache/tus/upload'
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
@@ -1,4 +1,4 @@
require 'attache/boot.rb'
require 'attache.rb'
require 'sucker_punch/testing/inline'

# This file was generated by the `rspec --init` command. Conventionally, all
Expand Down

0 comments on commit 6c6678c

Please sign in to comment.