Class: GobbleSingleFile

Inherits:
Object
  • Object
show all
Includes:
GobbleShare
Defined in:
lib/commandline/gobble_single_file.rb

Instance Method Summary collapse

Methods included from GobbleShare

#convert_path_to_key_path

Constructor Details

#initialize(rails_root, type, options) ⇒ GobbleSingleFile

Returns a new instance of GobbleSingleFile.



4
5
6
7
8
# File 'lib/commandline/gobble_single_file.rb', line 4

def initialize( rails_root, type, options )
  @rails_root = rails_root
  @options = options
  @text_extractor_type = type
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
# File 'lib/commandline/gobble_single_file.rb', line 10

def execute
  file_name = @options.first
  if( @text_extractor_type == 'tr8n' )
    execute_tr8n( file_name )
  else
    execute_i18n( file_name )
  end
  
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/commandline/gobble_single_file.rb', line 20

def valid?
  @options.size == 1
end