Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/twine.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Celis <sebastian@sebastiancelis.com>2016-12-15 02:13:25 +0300
committerGitHub <noreply@github.com>2016-12-15 02:13:25 +0300
commitfdda09ca3cb74f0aa358631e16c0417c83cce63e (patch)
treed5af19f6ae25cb5eacbb0d1a70d3385708cf91be /lib/twine/formatters/django.rb
parent9fc741c26122d90f99c42c8241e6de2ba265a102 (diff)
parent47e95e6db71303040946383329f0d2ec461cab27 (diff)
Merge pull request #178 from sebastianludwig/can-handle-directory-default-and-formatting
Minor improvements and a little cleanup
Diffstat (limited to 'lib/twine/formatters/django.rb')
-rw-r--r--lib/twine/formatters/django.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/twine/formatters/django.rb b/lib/twine/formatters/django.rb
index 19685b3..5c88766 100644
--- a/lib/twine/formatters/django.rb
+++ b/lib/twine/formatters/django.rb
@@ -9,23 +9,17 @@ module Twine
'.po'
end
- def can_handle_directory?(path)
- Dir.entries(path).any? { |item| /^.+\.po$/.match(item) }
- end
-
def default_file_name
- return 'strings.po'
+ 'strings.po'
end
def determine_language_given_path(path)
- path_arr = path.split(File::SEPARATOR)
- path_arr.each do |segment|
- match = /(..)\.po$/.match(segment)
- if match
- return match[1]
- end
- end
-
+ path_arr = path.split(File::SEPARATOR)
+ path_arr.each do |segment|
+ match = /(..)\.po$/.match(segment)
+ return match[1] if match
+ end
+
return
end