Class: TypesFromSerializers::Changes
- Inherits:
-
Object
- Object
- TypesFromSerializers::Changes
- Defined in:
- lib/types_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.
151 152 153 154 155 156 |
# File 'lib/types_from_serializers/generator.rb', line 151 def initialize(dirs) @added = Set.new @removed = Set.new @modified = Set.new track_changes(dirs) end |
Instance Method Details
#any_removed? ⇒ Boolean
162 163 164 |
# File 'lib/types_from_serializers/generator.rb', line 162 def any_removed? @removed.any? end |
#clear ⇒ Object
174 175 176 177 178 |
# File 'lib/types_from_serializers/generator.rb', line 174 def clear @added.clear @removed.clear @modified.clear end |
#modified_files ⇒ Object
166 167 168 |
# File 'lib/types_from_serializers/generator.rb', line 166 def modified_files @modified end |
#only_modified? ⇒ Boolean
170 171 172 |
# File 'lib/types_from_serializers/generator.rb', line 170 def only_modified? @added.empty? && @removed.empty? end |
#updated? ⇒ Boolean
158 159 160 |
# File 'lib/types_from_serializers/generator.rb', line 158 def updated? @modified.any? || @added.any? || @removed.any? end |