lib/packnga/reference-task.rb in packnga-1.0.0 vs lib/packnga/reference-task.rb in packnga-1.0.1

- old
+ new

@@ -12,11 +12,11 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "erb" require "gettext/tools" require "gettext/tools/task" require "tempfile" @@ -166,10 +166,20 @@ @translate_languages.each do |language| po_file = "#{@po_dir}/#{language}/#{@spec.name}.po" yard_po_file = "#{@po_dir}/#{language}.po" yard_po_files << yard_po_file - file yard_po_file => po_file do + namespace :po do + namespace language do + task :prepare do + if File.exist?(yard_po_file) + mkdir_p(File.dirname(po_file)) + mv(yard_po_file, po_file) + end + end + end + end + file yard_po_file => ["po:#{language}:prepare", po_file] do cp(po_file, yard_po_file) end end namespace :po do