File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22
3+ # Customize this name
4+ module_name = "Org"
5+
36module JSExporter
47 class Sorter
58 def initialize ( )
@@ -88,18 +91,27 @@ def normalize_path(path)
8891 end
8992end
9093
91- module_name = "Org"
92-
9394exporter = JSExporter ::Exporter . new ( ARGV )
9495exporter . remove_depend_notations
95- exported = exporter . sorted_contents . join ( " \n " )
96+ sorted_contents = exporter . sorted_contents
9697
9798puts <<EOS
9899var #{ module_name } = (function () {
99100 var exports = {};
100101
101102EOS
102- puts exported . split ( "\n " ) . map { |line | " " + line } . join ( "\n " )
103+
104+ puts sorted_contents . map { |content |
105+ # Add indentation
106+ content . split ( "\n " ) . map { |line |
107+ if line == ""
108+ line
109+ else
110+ " " + line
111+ end
112+ } . join ( "\n " ) + "\n "
113+ } . join ( "\n " )
114+
103115puts <<EOS
104116
105117 return exports;
You can’t perform that action at this time.
0 commit comments