Merge pull request #108 from sebastianludwig/small_improvements

Small improvements
This commit is contained in:
Sebastian Celis 2015-11-27 10:59:25 -05:00
commit 3b638f9b7e
2 changed files with 7 additions and 14 deletions

View file

@ -3,8 +3,8 @@ require 'fileutils'
module Twine
module Formatters
class Abstract
attr_accessor :strings
attr_accessor :options
attr_reader :strings
attr_reader :options
def self.can_handle_directory?(path)
return false
@ -90,7 +90,7 @@ module Twine
current_section.rows << current_row
if @options[:tags] && @options[:tags].length > 0
current_row.tags = @options[:tags]
current_row.tags = @options[:tags]
end
@strings.strings_map[key] = current_row

View file

@ -42,11 +42,7 @@ module Twine
elsif @tags.empty?
return include_untagged
else
tags.each do |tag|
if @tags.include? tag
return true
end
end
return !(tags & @tags).empty?
end
return false
@ -106,9 +102,7 @@ module Twine
end
def set_developer_language_code(code)
if @language_codes.include?(code)
@language_codes.delete(code)
end
@language_codes.delete(code)
@language_codes.insert(0, code)
end
@ -154,9 +148,8 @@ module Twine
if match
key = match[1].strip
value = match[2].strip
if value[0,1] == '`' && value[-1,1] == '`'
value = value[1..-2]
end
value = value[1..-2] if value[0] == '`' && value[-1] == '`'
case key
when 'comment'