forked from solidusio/solidus_i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (31 loc) · 922 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true
require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :default do
if Dir['spec/dummy'].empty?
Rake::Task[:test_app].invoke
Dir.chdir('../../')
end
Rake::Task[:spec].invoke
end
require 'spree/testing_support/common_rake'
desc 'Generates a dummy app for testing'
task :test_app do
ENV['LIB_NAME'] = 'solidus_i18n'
Rake::Task['common:test_app'].invoke
end
require 'solidus_i18n'
namespace :solidus_i18n do
desc 'Update by retrieving the latest Solidus locale files'
task :update_default do
require 'open-uri'
puts 'Fetching latest Solidus locale file'
location = 'https://raw.github.com/solidusio/solidus/master/core/config/locales/en.yml'
File.write("#{locales_dir}/en.yml", URI.parse(location).read)
end
def locales_dir
File.join File.dirname(__FILE__), 'config/locales'
end
end