dorian 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/dorian/bin.rb +16 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daa34dbc25084cd6652c8cf7b999ab959b3e41e92a10a971448e1475266a1ed2
|
4
|
+
data.tar.gz: 5d734255d29aa6d47c43b48324ded6b851783faf209860e5b882b21c2b9df2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef74841482a663c41d1c2aef834f3357d8cc826c7b5d9d052faaa882c204bf5001c91a08224c91527f550ca3ebf93ed0f0e1b70d2ca313ce6d7989cae6388a97
|
7
|
+
data.tar.gz: 0ce5e3e7cf0e096a21b0277050ba583ffb3b160c5b77cc6cebdebfb8ba1260fea3ef5cae20ff408e947dc2137663378a37a385e0e255eaed29b8b1a71cb98797
|
data/.rubocop.yml
CHANGED
@@ -101,12 +101,16 @@ Security/Eval:
|
|
101
101
|
Enabled: false
|
102
102
|
Style/CaseEquality:
|
103
103
|
Enabled: false
|
104
|
+
Style/DocumentDynamicEvalDefinition:
|
105
|
+
Enabled: false
|
104
106
|
Style/Documentation:
|
105
107
|
Enabled: false
|
106
108
|
Style/DoubleNegation:
|
107
109
|
Enabled: false
|
108
110
|
Style/EmptyMethod:
|
109
111
|
Enabled: false
|
112
|
+
Style/HashEachMethods:
|
113
|
+
Enabled: false
|
110
114
|
Style/IfUnlessModifier:
|
111
115
|
Enabled: false
|
112
116
|
Style/MultilineBlockChain:
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.1
|
data/lib/dorian/bin.rb
CHANGED
@@ -932,12 +932,13 @@ class Dorian
|
|
932
932
|
|
933
933
|
case output
|
934
934
|
when :csv
|
935
|
-
|
935
|
+
"#{headers_of(content)&.to_csv}#{
|
936
936
|
map(content) do |element|
|
937
937
|
CSV.generate(headers: headers_of(content)) do |csv|
|
938
938
|
csv << wrap(element)
|
939
939
|
end
|
940
940
|
end.join
|
941
|
+
}"
|
941
942
|
when :json
|
942
943
|
pretty? ? JSON.pretty_generate(content) : content.to_json
|
943
944
|
when :jsonl
|
@@ -1576,7 +1577,6 @@ class Dorian
|
|
1576
1577
|
before = File.read(path)
|
1577
1578
|
|
1578
1579
|
case filetype(path)
|
1579
|
-
when :directory
|
1580
1580
|
when :ruby
|
1581
1581
|
after = SyntaxTree.format(before)
|
1582
1582
|
when :haml
|
@@ -1588,20 +1588,23 @@ class Dorian
|
|
1588
1588
|
when :json
|
1589
1589
|
after = JSON.pretty_generate(JSON.parse(before))
|
1590
1590
|
when :jsonl
|
1591
|
-
after =
|
1591
|
+
after =
|
1592
|
+
"#{before.lines.map { |line| JSON.parse(line).to_json }.join("\n")}\n"
|
1592
1593
|
when :csv
|
1593
1594
|
after =
|
1594
|
-
CSV.generate { |csv| CSV.parse(before).each { |row| csv << row } }
|
1595
|
+
"#{CSV.generate { |csv| CSV.parse(before).each { |row| csv << row } }}\n"
|
1595
1596
|
when :yaml
|
1596
1597
|
after = sort(YAML.safe_load(before)).to_yaml
|
1597
1598
|
when :yamll
|
1598
1599
|
after =
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1600
|
+
"#{
|
1601
|
+
before
|
1602
|
+
.lines
|
1603
|
+
.map do |line|
|
1604
|
+
sort(YAML.safe_load(JSON.parse(line))).to_yaml.to_json
|
1605
|
+
end
|
1606
|
+
.join("\n")
|
1607
|
+
}\n"
|
1605
1608
|
when :js
|
1606
1609
|
context.eval("format(#{path.to_json}, 'babel')")
|
1607
1610
|
when :ts
|
@@ -1628,7 +1631,7 @@ class Dorian
|
|
1628
1631
|
end
|
1629
1632
|
when :pdf
|
1630
1633
|
doc = HexaPDF::Document.open(path)
|
1631
|
-
doc.trailer.info.
|
1634
|
+
doc.trailer.info.each { |key, _| doc.trailer.info.delete(key) }
|
1632
1635
|
doc.write(path, update_fields: false)
|
1633
1636
|
after = File.read(path)
|
1634
1637
|
when :tex
|
@@ -1661,8 +1664,8 @@ class Dorian
|
|
1661
1664
|
else
|
1662
1665
|
warn "run: `brew install ktlint` for #{path}"
|
1663
1666
|
end
|
1664
|
-
when :raw, :
|
1665
|
-
:
|
1667
|
+
when :raw, :env, :enc, :txt, :pro, :binary, :slim, :fish, :bat, :xcconfig,
|
1668
|
+
:pbxproj, :jpeg, :png, :webp, :heic, :ico
|
1666
1669
|
# nothing to do
|
1667
1670
|
else
|
1668
1671
|
case File.basename(path)
|
@@ -1686,7 +1689,6 @@ class Dorian
|
|
1686
1689
|
end
|
1687
1690
|
rescue StandardError => e
|
1688
1691
|
warn "failed to parse #{path}: #{e.message}"
|
1689
|
-
binding.irb
|
1690
1692
|
end
|
1691
1693
|
end
|
1692
1694
|
end
|