Class: XxxRename::Data::Config

Inherits:
Base
  • Object
show all
Defined in:
lib/xxx_rename/data/config.rb

Instance Method Summary collapse

Methods inherited from Base

#to_h

Instance Method Details

#collection_tag_to_site_clientObject



66
67
68
69
70
71
72
# File 'lib/xxx_rename/data/config.rb', line 66

def collection_tag_to_site_client
  @collection_tag_to_site_client ||= {}.tap do |h|
    site.attributes.each_pair do |site_name, site_config|
      h[site_config.collection_tag] = site_name
    end
  end
end

#mutexObject



74
75
76
# File 'lib/xxx_rename/data/config.rb', line 74

def mutex
  @mutex ||= Mutex.new
end

#output_recorderObject



86
87
88
89
90
91
92
93
94
# File 'lib/xxx_rename/data/config.rb', line 86

def output_recorder
  @output_recorder ||=
    begin
      store = Data::OutputDatastore.new(generated_files_dir).store
      datastore = Data::FileRenameOpDatastore.new(store, mutex)
      datastore.migration_status = 0
      datastore
    end
end

#prefix_hashObject



56
57
58
59
60
61
62
63
64
# File 'lib/xxx_rename/data/config.rb', line 56

def prefix_hash
  {
    female_actors_prefix: global.female_actors_prefix,
    male_actors_prefix: global.male_actors_prefix,
    actors_prefix: global.actors_prefix,
    title_prefix: global.title_prefix,
    id_prefix: global.id_prefix
  }
end

#scene_datastoreObject



78
79
80
81
82
83
84
# File 'lib/xxx_rename/data/config.rb', line 78

def scene_datastore
  @scene_datastore ||=
    begin
      store = Data::SceneDatastore.new(File.join(generated_files_dir, "..")).store
      SceneDatastoreQuery.new(store, mutex)
    end
end