Sha256: 94219516cd701745b997bec1b863f3db88beba933f5bb4ca935a0ed89d42738f
Contents?: true
Size: 1.88 KB
Versions: 5
Compression:
Stored size: 1.88 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 class Gemfile module Services class Format include RailsService::Config attribute :path, :string validates :path, presence: true if ConvenientService::Dependencies.support_has_j_send_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
5 entries across 5 versions & 1 rubygems