Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
Adds default rake task, don't log warnings during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Saunders committed Oct 31, 2013
1 parent 73b6806 commit beece6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -2,7 +2,10 @@ require 'bundler'
require 'rake/testtask'
Bundler::GemHelper.install_tasks

task :default => [:spec]

Rake::TestTask.new 'spec' do |t|
ENV['test'] = 'true'
t.libs = ['lib', 'spec']
t.ruby_opts << '-rubygems'
t.verbose = true
Expand Down
8 changes: 6 additions & 2 deletions lib/shopify_theme.rb
Expand Up @@ -6,6 +6,10 @@ module ShopifyTheme
TIMER_RESET = 5 * 60 + 5
PERMIT_LOWER_LIMIT = 10

def self.test?
ENV['test']
end

def self.manage_timer(response)
@@current_api_call_count, @@total_api_calls = response.headers['x-shopify-shop-api-call-limit'].split('/')
@@current_timer = Time.now if @current_timer.nil?
Expand Down Expand Up @@ -71,10 +75,10 @@ def self.delete_asset(asset)
def self.config
@config ||= if File.exist? 'config.yml'
config = YAML.load(File.read('config.yml'))
puts ":ignore_files: is deprecated for a white list, use :whitelist_files: instead" if config[:ignore_files]
puts ":ignore_files: is deprecated for a white list, use :whitelist_files: instead" if config[:ignore_files] && !test?
config
else
puts "config.yml does not exist!"
puts "config.yml does not exist!" unless test?
{}
end
end
Expand Down

0 comments on commit beece6c

Please sign in to comment.