Class: Generator::Specs
- Inherits:
-
Object
- Object
- Generator::Specs
- Defined in:
- lib/generator/specs.rb
Class Method Summary collapse
Class Method Details
.directory ⇒ Object
26 27 28 |
# File 'lib/generator/specs.rb', line 26 def directory File.join(Config::BASE_PATH, "selling-partner-api-models") end |
.sync ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/generator/specs.rb', line 10 def sync # Remove directory if it exists but is empty if Dir.exist?(directory) && Dir.empty?(directory) FileUtils.rm_rf(directory) end if !Dir.exist?(directory) clone! elsif older_than_one_day? Generator.logger.info("API models are over 1 day old, updating") update! else Generator.logger.info("Existing API models found") end end |