Class: SceneToolkit::Release
- Inherits:
-
Object
- Object
- SceneToolkit::Release
- Includes:
- AutoRename, Helpers, Validations, Validations::Checksum, Validations::Files, Validations::Name, Validations::Playlist
- Defined in:
- lib/scene_toolkit/release.rb,
lib/scene_toolkit/release/helpers.rb,
lib/scene_toolkit/release/auto_rename.rb,
lib/scene_toolkit/release/validations.rb,
lib/scene_toolkit/release/validations/name.rb,
lib/scene_toolkit/release/validations/files.rb,
lib/scene_toolkit/release/validations/checksum.rb,
lib/scene_toolkit/release/validations/playlist.rb
Defined Under Namespace
Modules: AutoRename, Helpers, Validations
Constant Summary
Constants included from Validations::Files
Validations::Files::REQUIRED_FILES_EXT
Constants included from Validations::Name
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
- #heuristic_filename(ext) ⇒ Object
- #heuristic_name ⇒ Object
-
#initialize(path) ⇒ Release
constructor
A new instance of Release.
Methods included from Validations::Checksum
Methods included from Validations::Playlist
Methods included from Validations::Files
Methods included from Validations::Name
Methods included from Helpers
Methods included from AutoRename
Methods included from Validations
Constructor Details
#initialize(path) ⇒ Release
Returns a new instance of Release.
23 24 25 26 27 |
# File 'lib/scene_toolkit/release.rb', line 23 def initialize(path) @path = File.(path) @name = File.basename(path) @errors, @warnings = [], [] end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
12 13 14 |
# File 'lib/scene_toolkit/release.rb', line 12 def errors @errors end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/scene_toolkit/release.rb', line 11 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/scene_toolkit/release.rb', line 11 def path @path end |
#warnings ⇒ Object
Returns the value of attribute warnings.
12 13 14 |
# File 'lib/scene_toolkit/release.rb', line 12 def warnings @warnings end |
Instance Method Details
#heuristic_filename(ext) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/scene_toolkit/release.rb', line 37 def heuristic_filename(ext) if candidates = common_filenames "#{candidates.first}.#{ext}" else "00-#{self.name.downcase}.#{ext}" end end |
#heuristic_name ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/scene_toolkit/release.rb', line 29 def heuristic_name if candidates = common_filenames candidates.first.gsub(/^\d+[-_]/, "") else self.name end end |