Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby Warnings #276

Merged
merged 2 commits into from
Dec 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/asset_sync/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def google?
end

def yml_exists?
defined?(Rails.root) ? File.exists?(self.yml_path) : false
defined?(Rails.root) ? File.exist?(self.yml_path) : false
end

def yml
Expand Down
6 changes: 3 additions & 3 deletions lib/asset_sync/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class Engine < Rails::Engine
app_initializer = Rails.root.join('config', 'initializers', 'asset_sync.rb').to_s
app_yaml = Rails.root.join('config', 'asset_sync.yml').to_s

if File.exists?( app_initializer )
if File.exist?( app_initializer )
AssetSync.log "AssetSync: using #{app_initializer}"
load app_initializer
elsif !File.exists?( app_initializer ) && !File.exists?( app_yaml )
elsif !File.exist?( app_initializer ) && !File.exist?( app_yaml )
AssetSync.log "AssetSync: using default configuration from built-in initializer"
AssetSync.configure do |config|
config.fog_provider = ENV['FOG_PROVIDER'] if ENV.has_key?('FOG_PROVIDER')
Expand Down Expand Up @@ -44,7 +44,7 @@ class Engine < Rails::Engine

end

if File.exists?( app_yaml )
if File.exist?( app_yaml )
AssetSync.log "AssetSync: YAML file found #{app_yaml} settings will be merged into the configuration"
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/asset_sync/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_local_files
log "Using: Rails 4.0 manifest access"
manifest = Sprockets::Manifest.new(ActionView::Base.assets_manifest.environment, ActionView::Base.assets_manifest.dir)
return manifest.assets.values.map { |f| File.join(self.config.assets_prefix, f) }
elsif File.exists?(self.config.manifest_path)
elsif File.exist?(self.config.manifest_path)
log "Using: Manifest #{self.config.manifest_path}"
yml = YAML.load(IO.read(self.config.manifest_path))

Expand Down Expand Up @@ -150,8 +150,8 @@ def upload_file(f)
log "Overwriting #{f} with custom headers #{files_with_custom_headers[f].to_s}"
elsif key = self.config.custom_headers.keys.detect {|k| f.match(Regexp.new(k))}
headers = {}
self.config.custom_headers[key].each do |key, value|
headers[key.to_sym] = value
self.config.custom_headers[key].each do |k, value|
headers[k.to_sym] = value
end
file.merge! headers
log "Overwriting matching file #{f} with custom headers #{headers.to_s}"
Expand All @@ -166,7 +166,7 @@ def upload_file(f)
# as we will overwrite file.css with file.css.gz if it exists.
log "Ignoring: #{f}"
ignore = true
elsif config.gzip? && File.exists?(gzipped)
elsif config.gzip? && File.exist?(gzipped)
original_size = File.size("#{path}/#{f}")
gzipped_size = File.size(gzipped)

Expand Down
2 changes: 1 addition & 1 deletion spec/dummy_app/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require 'rubygems'
ENV['RAILS_ROOT'] = File.dirname(__FILE__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
# require 'rails/all'
require "action_controller/railtie"
require "sprockets/railtie"
Expand Down