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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71b8b344806e358d754e6e68eb0333bdb33e5099eab13e3b0df41ccc13bd3c5f
4
- data.tar.gz: c26ab096a11c5c9c8da1845e3e83fe41adb3836397e6581669c550d3d8837b3f
3
+ metadata.gz: daa34dbc25084cd6652c8cf7b999ab959b3e41e92a10a971448e1475266a1ed2
4
+ data.tar.gz: 5d734255d29aa6d47c43b48324ded6b851783faf209860e5b882b21c2b9df2ab
5
5
  SHA512:
6
- metadata.gz: 9eda2aa612da2a4d35854f9ada61d35e7917c19c56bc9335d25045a748965b65990230f7a5300f4aeb1b320b2aabe5c608a00031719137549eda6c0e88384a30
7
- data.tar.gz: 52af3c55d0a75ba0aead5ffe111edf5ef448b5fb6a3791ee485a20eea3191a3198c8f4e071b551210a4bb99a62a80b2ce7c33e504cbc8e30ccd765a689d396a8
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dorian (2.5.0)
4
+ dorian (2.5.1)
5
5
  csv
6
6
  dorian-arguments
7
7
  dorian-eval
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.0
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
- (headers_of(content) ? headers_of(content).to_csv : "") +
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 = before.lines.map { |line| JSON.parse(line).to_json }.join("\n")
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
- before
1600
- .lines
1601
- .map do |line|
1602
- sort(YAML.safe_load(JSON.parse(line))).to_yaml.to_json
1603
- end
1604
- .join("\n") + "\n"
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.each_key { |key| doc.trailer.info.delete(key) }
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, :directory, :symlink, :env, :enc, :txt, :pro, :binary, :slim,
1665
- :fish, :bat, :xcconfig, :pbxproj, :jpeg, :png, :webp, :heic, :ico
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié