Sha256: 48033b1b821af8683f9c305fa2fb4dbdd8495994fc7cb1d730fbfacacfebbbd4
Contents?: true
Size: 1.87 KB
Versions: 7
Compression:
Stored size: 1.87 KB
Contents
# frozen_string_literal: true ## # Usage example: # # result = ConvenientService::Examples::Rails::Gemfile::Services::Format.result(path: "Gemfile") # result = ConvenientService::Examples::Rails::Gemfile::Services::Format.result(path: "spec/cli/gemfile/format/fixtures/Gemfile") # module ConvenientService module Examples module Rails module Gemfile module Services class Format include RailsService::Config attribute :path, :string validates :path, presence: true if ConvenientService::Dependencies.support_has_result_params_validations_using_active_model_validations? step Services::ReadFileContent, in: :path, out: :content step Services::StripComments, in: :content, out: :content_without_comments step Services::ParseContent, in: {content: :content_without_comments}, out: :parsed_content step Services::FormatHeader, in: :parsed_content, out: {formatted_content: :formatted_header_content} step Services::FormatBody, in: :parsed_content, out: {formatted_content: :formatted_body_content} step Services::MergeSections, in: [ {header: :formatted_header_content}, {body: :formatted_body_content} ], out: :merged_sections step Services::ReplaceFileContent, in: [ :path, {content: :merged_sections} ] before :result do @progressbar = ::ProgressBar.create(title: "Formatting", total: steps.count) end after :step do |step| @progressbar.increment end end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems