Class: JSONCop::Command::Install
- Inherits:
-
JSONCop::Command
- Object
- CLAide::Command
- JSONCop::Command
- JSONCop::Command::Install
- Defined in:
- lib/jsoncop/command/install.rb
Instance Method Summary collapse
- #create_analyzer_for_file(file_path) ⇒ Object
- #create_generator_for_file(file_path, model) ⇒ Object
-
#initialize(argv) ⇒ Install
constructor
A new instance of Install.
- #run ⇒ Object
Methods inherited from JSONCop::Command
Constructor Details
#initialize(argv) ⇒ Install
Returns a new instance of Install.
12 13 14 |
# File 'lib/jsoncop/command/install.rb', line 12 def initialize(argv) super end |
Instance Method Details
#create_analyzer_for_file(file_path) ⇒ Object
27 28 29 |
# File 'lib/jsoncop/command/install.rb', line 27 def create_analyzer_for_file(file_path) Analyzer.new file_path end |
#create_generator_for_file(file_path, model) ⇒ Object
31 32 33 |
# File 'lib/jsoncop/command/install.rb', line 31 def create_generator_for_file(file_path, model) Generator.new file_path, model end |
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jsoncop/command/install.rb', line 16 def run Dir.glob("**/*.swift").each do |file| analyzer = create_analyzer_for_file file model = analyzer.analyze! next unless model generator = create_generator_for_file file, model generator.generate! end end |