Class: TypeSpecFromSerializers::Changes
- Inherits:
-
Object
- Object
- TypeSpecFromSerializers::Changes
- Defined in:
- lib/typespec_from_serializers/generator.rb
Overview
Internal: Structure to keep track of changed files.
Instance Method Summary collapse
- #any_removed? ⇒ Boolean
- #clear ⇒ Object
-
#initialize(dirs) ⇒ Changes
constructor
A new instance of Changes.
- #modified_files ⇒ Object
- #only_modified? ⇒ Boolean
- #updated? ⇒ Boolean
Constructor Details
#initialize(dirs) ⇒ Changes
Returns a new instance of Changes.
261 262 263 264 265 266 |
# File 'lib/typespec_from_serializers/generator.rb', line 261 def initialize(dirs) @added = Set.new @removed = Set.new @modified = Set.new track_changes(dirs) end |
Instance Method Details
#any_removed? ⇒ Boolean
272 273 274 |
# File 'lib/typespec_from_serializers/generator.rb', line 272 def any_removed? @removed.any? end |
#clear ⇒ Object
284 285 286 287 288 |
# File 'lib/typespec_from_serializers/generator.rb', line 284 def clear @added.clear @removed.clear @modified.clear end |
#modified_files ⇒ Object
276 277 278 |
# File 'lib/typespec_from_serializers/generator.rb', line 276 def modified_files @modified end |
#only_modified? ⇒ Boolean
280 281 282 |
# File 'lib/typespec_from_serializers/generator.rb', line 280 def only_modified? @added.empty? && @removed.empty? end |
#updated? ⇒ Boolean
268 269 270 |
# File 'lib/typespec_from_serializers/generator.rb', line 268 def updated? @modified.any? || @added.any? || @removed.any? end |