Class: CarthageCacheRes::CartfileResolvedFile
- Inherits:
-
Object
- Object
- CarthageCacheRes::CartfileResolvedFile
- Defined in:
- lib/carthage_cache_res/carthage_resolved_file.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#swift_version_resolver ⇒ Object
readonly
Returns the value of attribute swift_version_resolver.
-
#terminal ⇒ Object
readonly
Returns the value of attribute terminal.
Instance Method Summary collapse
- #content ⇒ Object
- #digest ⇒ Object
- #frameworks ⇒ Object
-
#initialize(file_path, terminal, swift_version_resolver = SwiftVersionResolver.new) ⇒ CartfileResolvedFile
constructor
A new instance of CartfileResolvedFile.
- #swift_version ⇒ Object
Constructor Details
#initialize(file_path, terminal, swift_version_resolver = SwiftVersionResolver.new) ⇒ CartfileResolvedFile
Returns a new instance of CartfileResolvedFile.
11 12 13 14 15 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 11 def initialize(file_path, terminal, swift_version_resolver = SwiftVersionResolver.new) @file_path = file_path @swift_version_resolver = swift_version_resolver @terminal = terminal end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 7 def file_path @file_path end |
#swift_version_resolver ⇒ Object (readonly)
Returns the value of attribute swift_version_resolver.
9 10 11 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 9 def swift_version_resolver @swift_version_resolver end |
#terminal ⇒ Object (readonly)
Returns the value of attribute terminal.
8 9 10 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 8 def terminal @terminal end |
Instance Method Details
#content ⇒ Object
21 22 23 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 21 def content @content ||= File.read(file_path) end |
#digest ⇒ Object
17 18 19 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 17 def digest @digest ||= generate_digest end |
#frameworks ⇒ Object
29 30 31 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 29 def frameworks @frameworks ||= content.each_line.map { |line| extract_framework_name(line) } end |
#swift_version ⇒ Object
25 26 27 |
# File 'lib/carthage_cache_res/carthage_resolved_file.rb', line 25 def swift_version @swift_version ||= swift_version_resolver.swift_version end |