Sha256: b4705876ffbe2c6afdf647b4e1c1e2e41a7f487450eb623e38156bef93868bb2

Contents?: true

Size: 341 Bytes

Versions: 14

Compression:

Stored size: 341 Bytes

Contents

class RakeCommander
  module Options
    module Description
      DESC_MAX_LENGTH = 80

      private

      def string_to_lines(str, max: DESC_MAX_LENGTH)
        str.scan(liner_regex(max)).map(&:strip)
      end

      def liner_regex(len = DESC_MAX_LENGTH)
        /.{0,#{len}}[^ ](?:\s|$)/mi
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake-commander-0.4.0 lib/rake-commander/options/description.rb
rake-commander-0.3.6 lib/rake-commander/options/description.rb
rake-commander-0.3.5 lib/rake-commander/options/description.rb
rake-commander-0.3.3 lib/rake-commander/options/description.rb
rake-commander-0.2.12 lib/rake-commander/options/description.rb
rake-commander-0.2.11 lib/rake-commander/options/description.rb
rake-commander-0.2.10 lib/rake-commander/options/description.rb
rake-commander-0.2.7 lib/rake-commander/options/description.rb
rake-commander-0.2.6 lib/rake-commander/options/description.rb
rake-commander-0.2.5 lib/rake-commander/options/description.rb
rake-commander-0.2.4 lib/rake-commander/options/description.rb
rake-commander-0.2.3 lib/rake-commander/options/description.rb
rake-commander-0.2.2 lib/rake-commander/options/description.rb
rake-commander-0.2.0 lib/rake-commander/options/description.rb