difftastic 0.0.1-x86_64-darwin → 0.1.0-x86_64-darwin

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: '0485c3f765de39a6ef2516debd0940af0336aee9536359c1e86887dc652ff206'
4
- data.tar.gz: 0e55edc77308f3f8a11d101ce14f50d1e23c415edffcba40c3786ceac248fef4
3
+ metadata.gz: db2afcad5cbb3d471632a1f8ad39009973186904c7f035fadaa02b636598d4dc
4
+ data.tar.gz: a5fc272eaac1425c405fa90354a2efbae1da242421db4895f585253a193d5501
5
5
  SHA512:
6
- metadata.gz: 63c8711f96086a9b686b20354ebd7e15a06ab6a81698712748bf09b07dda7ece55fb6e45615ca1f6de5022351cf7a4a7f742067b4e2e00c6dc03c880a0f67754
7
- data.tar.gz: b0ee151e612d37c2262c5690afb3bac49aff49121210da94dc6d9edd8531bf431851762ffbc93f843ef7e1a95e249c3fe6a30268820d5733882c89e7e26a81bf
6
+ metadata.gz: 8b5ce0b2bec2f0b4b7de75ddc681a1aec6b05eb006809d13c8629378330cd7cb52e3ea7f2116d32f9d02077899cda0ba4c740b5af196f8bebcbc1caea06d7b47
7
+ data.tar.gz: 60beb71acbceb5bb83efd4513dab0e96ec17db1e3b04c68352faa3d90687c0203d3cafe270371ecf523e7a877830da6c26fe31135cacc4cea74f8d6182031d69
@@ -1824,9 +1824,131 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1824
1824
  SOFTWARE.
1825
1825
  ```
1826
1826
 
1827
- ### [`tree-sitter-janet-simple`](https://github.com/sogaiu/tree-sitter-janet-simple)
1827
+ ### [`tree-sitter-janet-simple`](https://github.com/sogaiu/tree-sitter-janet-simple/blob/master/COPYING.txt)
1828
1828
 
1829
- License unknown.
1829
+ ```
1830
+ Creative Commons Legal Code
1831
+
1832
+ CC0 1.0 Universal
1833
+
1834
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
1835
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
1836
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
1837
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
1838
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
1839
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
1840
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
1841
+ HEREUNDER.
1842
+
1843
+ Statement of Purpose
1844
+
1845
+ The laws of most jurisdictions throughout the world automatically confer
1846
+ exclusive Copyright and Related Rights (defined below) upon the creator
1847
+ and subsequent owner(s) (each and all, an "owner") of an original work of
1848
+ authorship and/or a database (each, a "Work").
1849
+
1850
+ Certain owners wish to permanently relinquish those rights to a Work for
1851
+ the purpose of contributing to a commons of creative, cultural and
1852
+ scientific works ("Commons") that the public can reliably and without fear
1853
+ of later claims of infringement build upon, modify, incorporate in other
1854
+ works, reuse and redistribute as freely as possible in any form whatsoever
1855
+ and for any purposes, including without limitation commercial purposes.
1856
+ These owners may contribute to the Commons to promote the ideal of a free
1857
+ culture and the further production of creative, cultural and scientific
1858
+ works, or to gain reputation or greater distribution for their Work in
1859
+ part through the use and efforts of others.
1860
+
1861
+ For these and/or other purposes and motivations, and without any
1862
+ expectation of additional consideration or compensation, the person
1863
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
1864
+ is an owner of Copyright and Related Rights in the Work, voluntarily
1865
+ elects to apply CC0 to the Work and publicly distribute the Work under its
1866
+ terms, with knowledge of his or her Copyright and Related Rights in the
1867
+ Work and the meaning and intended legal effect of CC0 on those rights.
1868
+
1869
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
1870
+ protected by copyright and related or neighboring rights ("Copyright and
1871
+ Related Rights"). Copyright and Related Rights include, but are not
1872
+ limited to, the following:
1873
+
1874
+ i. the right to reproduce, adapt, distribute, perform, display,
1875
+ communicate, and translate a Work;
1876
+ ii. moral rights retained by the original author(s) and/or performer(s);
1877
+ iii. publicity and privacy rights pertaining to a person's image or
1878
+ likeness depicted in a Work;
1879
+ iv. rights protecting against unfair competition in regards to a Work,
1880
+ subject to the limitations in paragraph 4(a), below;
1881
+ v. rights protecting the extraction, dissemination, use and reuse of data
1882
+ in a Work;
1883
+ vi. database rights (such as those arising under Directive 96/9/EC of the
1884
+ European Parliament and of the Council of 11 March 1996 on the legal
1885
+ protection of databases, and under any national implementation
1886
+ thereof, including any amended or successor version of such
1887
+ directive); and
1888
+ vii. other similar, equivalent or corresponding rights throughout the
1889
+ world based on applicable law or treaty, and any national
1890
+ implementations thereof.
1891
+
1892
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
1893
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
1894
+ irrevocably and unconditionally waives, abandons, and surrenders all of
1895
+ Affirmer's Copyright and Related Rights and associated claims and causes
1896
+ of action, whether now known or unknown (including existing as well as
1897
+ future claims and causes of action), in the Work (i) in all territories
1898
+ worldwide, (ii) for the maximum duration provided by applicable law or
1899
+ treaty (including future time extensions), (iii) in any current or future
1900
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
1901
+ including without limitation commercial, advertising or promotional
1902
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
1903
+ member of the public at large and to the detriment of Affirmer's heirs and
1904
+ successors, fully intending that such Waiver shall not be subject to
1905
+ revocation, rescission, cancellation, termination, or any other legal or
1906
+ equitable action to disrupt the quiet enjoyment of the Work by the public
1907
+ as contemplated by Affirmer's express Statement of Purpose.
1908
+
1909
+ 3. Public License Fallback. Should any part of the Waiver for any reason
1910
+ be judged legally invalid or ineffective under applicable law, then the
1911
+ Waiver shall be preserved to the maximum extent permitted taking into
1912
+ account Affirmer's express Statement of Purpose. In addition, to the
1913
+ extent the Waiver is so judged Affirmer hereby grants to each affected
1914
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
1915
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
1916
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
1917
+ maximum duration provided by applicable law or treaty (including future
1918
+ time extensions), (iii) in any current or future medium and for any number
1919
+ of copies, and (iv) for any purpose whatsoever, including without
1920
+ limitation commercial, advertising or promotional purposes (the
1921
+ "License"). The License shall be deemed effective as of the date CC0 was
1922
+ applied by Affirmer to the Work. Should any part of the License for any
1923
+ reason be judged legally invalid or ineffective under applicable law, such
1924
+ partial invalidity or ineffectiveness shall not invalidate the remainder
1925
+ of the License, and in such case Affirmer hereby affirms that he or she
1926
+ will not (i) exercise any of his or her remaining Copyright and Related
1927
+ Rights in the Work or (ii) assert any associated claims and causes of
1928
+ action with respect to the Work, in either case contrary to Affirmer's
1929
+ express Statement of Purpose.
1930
+
1931
+ 4. Limitations and Disclaimers.
1932
+
1933
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
1934
+ surrendered, licensed or otherwise affected by this document.
1935
+ b. Affirmer offers the Work as-is and makes no representations or
1936
+ warranties of any kind concerning the Work, express, implied,
1937
+ statutory or otherwise, including without limitation warranties of
1938
+ title, merchantability, fitness for a particular purpose, non
1939
+ infringement, or the absence of latent or other defects, accuracy, or
1940
+ the present or absence of errors, whether or not discoverable, all to
1941
+ the greatest extent permissible under applicable law.
1942
+ c. Affirmer disclaims responsibility for clearing rights of other persons
1943
+ that may apply to the Work or any use thereof, including without
1944
+ limitation any person's Copyright and Related Rights in the Work.
1945
+ Further, Affirmer disclaims responsibility for obtaining any necessary
1946
+ consents, permissions or other rights required for any use of the
1947
+ Work.
1948
+ d. Affirmer understands and acknowledges that Creative Commons is not a
1949
+ party to this document and has no duty or obligation with respect to
1950
+ this CC0 or use of the Work.
1951
+ ```
1830
1952
 
1831
1953
  ### [`tree-sitter-java`](https://github.com/tree-sitter/tree-sitter-java/blob/master/LICENSE)
1832
1954
 
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Joel Drapper
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1 +1 @@
1
- # Difftastic
1
+ # Difftastic Ruby
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Difftastic::Differ
4
- def initialize(background: nil, color: nil, syntax_highlight: nil, context: nil, tab_width: nil, parse_error_limit: nil)
4
+ def initialize(background: nil, color: nil, syntax_highlight: nil, context: nil, tab_width: nil, parse_error_limit: nil, underline_highlights: true)
5
5
  @show_paths = false
6
6
  @background = background => :dark | :light | nil
7
7
  @color = color => :always | :never | :auto | nil
@@ -9,6 +9,7 @@ class Difftastic::Differ
9
9
  @context = context => Integer | nil
10
10
  @tab_width = tab_width => Integer | nil
11
11
  @parse_error_limit = parse_error_limit => Integer | nil
12
+ @underline_highlights = underline_highlights => true | false
12
13
  end
13
14
 
14
15
  def diff_objects(old, new)
@@ -291,11 +292,22 @@ class Difftastic::Differ
291
292
 
292
293
  result = Difftastic.execute(options.join(" "))
293
294
 
294
- if @show_paths
295
- result
296
- else
295
+ unless @show_paths
297
296
  new_line_index = result.index("\n") + 1
298
- result.byteslice(new_line_index, result.bytesize - new_line_index)
297
+ result = result.byteslice(new_line_index, result.bytesize - new_line_index)
299
298
  end
299
+
300
+ if @underline_highlights
301
+ result.gsub!(/\e\[([0-9;]*)m/) {
302
+ codes = $1
303
+ if codes =~ /9[12]/ # Matches 91 or 92
304
+ "\e[#{codes};4m"
305
+ else
306
+ "\e[#{codes}m"
307
+ end
308
+ }
309
+ end
310
+
311
+ result
300
312
  end
301
313
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Difftastic
4
- VERSION = "0.0.1"
4
+ VERSION = "0.1.0"
5
5
  end
data/lib/difftastic.rb CHANGED
@@ -99,7 +99,7 @@ module Difftastic
99
99
  when Set
100
100
  buffer << "Set[\n"
101
101
  indent += 1
102
- object.each do |value|
102
+ object.to_a.sort!.each do |value|
103
103
  buffer << (" " * indent)
104
104
  pretty(value, buffer:, indent:)
105
105
  buffer << ",\n"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: difftastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Joel Drapper
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-21 00:00:00.000000000 Z
10
+ date: 2025-01-22 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email:
13
13
  - joel@drapper.me
@@ -17,6 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - LICENSE-DEPENDENCIES.md
20
+ - LICENSE.txt
20
21
  - README.md
21
22
  - exe/difft
22
23
  - exe/x86_64-darwin/difft