lslinks 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcaf27dbf9771119d244c77f11a2c8c635c21579390cf8871b2131eb4b4e514d
4
- data.tar.gz: 2c5e76d18208a9a582077d83662c34110d002533849ea23e2edf7e967854ff74
3
+ metadata.gz: aa7bd2c9cd6dcb396ebfcb7267b7a1d70118fe172da958b2df999ef50fcd1f34
4
+ data.tar.gz: f1cc6815ed745e323fe1478bd89bce0b0eb51eb0c8d20c64e7e038b95b1dfe64
5
5
  SHA512:
6
- metadata.gz: 91de13c8881a9daf128e1e1bc4e16232453501c90791337bbad074c1041f58ea444be450f2fc068690b5cb8f8b97a3e4cf7d28b3e850bee04a0da5fd43d06c2a
7
- data.tar.gz: 44910da85da36eb115f348830976aef77c6c29cf97c04899a3894ec26ba1d1fdcd033c1b67b0dda2929c932a252aacb07bc8124f944a31da2591f5460207e809
6
+ metadata.gz: ed1234dc4c584b720419060f199947df3cf5f17ec94cf132069deb834b84def678c713c42d3f116c57cef066e0440bf3d8df12cdf9be1b406238ef9760b4bb72
7
+ data.tar.gz: ab2bfbf88b4a19909cd114a01a086bf00e392abddac854a97c87832250a803a69e800fd3c61ad15b834b14bb483071ad8180b384cf37a9eba99d49d668361468
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # lslinks
2
2
 
3
- A command line tool to list links.
3
+ [![License X11](https://img.shields.io/badge/license-X11-blue.svg)](https://raw.githubusercontent.com/nishidayuya/lslinks/master/LICENSE.txt)
4
+ [![Gem Version](https://badge.fury.io/rb/lslinks.svg)](https://rubygems.org/gems/lslinks)
5
+ [![Build Status](https://github.com/nishidayuya/lslinks/workflows/test/badge.svg)](https://github.com/nishidayuya/lslinks/actions?query=workflow%3Atest)
6
+
7
+ A command line tool to list links. ls-like.
4
8
 
5
9
  ## Installation
6
10
 
data/Rakefile CHANGED
@@ -1,4 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- task default: %i[]
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << "test"
8
+ t.test_files = FileList["test/**/*_test.rb"]
9
+ end
10
+
11
+ task(default: %i[test])
data/exe/lslinks CHANGED
File without changes
data/lib/lslinks/cli.rb CHANGED
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Cli
4
2
  class << self
5
3
  def run(argv)
@@ -1,4 +1,2 @@
1
- require "lslinks"
2
-
3
1
  class Lslinks::Error::UnsupportedResource < Lslinks::Error
4
2
  end
data/lib/lslinks/error.rb CHANGED
@@ -1,4 +1,2 @@
1
- require "lslinks"
2
-
3
1
  class Lslinks::Error < StandardError
4
2
  end
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Formatter
4
2
  class << self
5
3
  def output(resource_name, link, stdout: $stdout, **options)
data/lib/lslinks/link.rb CHANGED
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  class Lslinks::Link < Data.define(:url, :text)
4
2
  class << self
5
3
  def from_nokogiri_element(element)
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  class Lslinks::OptionParser < OptionParser
4
2
  class << self
5
3
  def call(argv)
@@ -14,11 +12,12 @@ class Lslinks::OptionParser < OptionParser
14
12
  parser.separator("HTTP input options:")
15
13
  parser.on("--user-agent=USER_AGENT") # from curl wget
16
14
  parser.on("--referer=REFERER") # from curl wget
17
- parser.on("--header=HEADER") # from curl wget
15
+ parser.on("-H", "--header=HEADER") # from curl wget
16
+ parser.on("--compressed", "ignore. no effect.") # from curl
18
17
  options = {
19
18
  http_headers: {},
20
19
  }
21
- rest_args = parser.order(argv, into: options)
20
+ rest_args = parser.permute(argv, into: options)
22
21
  resource_name = rest_args.shift
23
22
  if !resource_name
24
23
  $stderr.puts(parser.help)
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Parser
4
2
  class << self
5
3
  def each_link(resource_stream, **)
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Reader::File
4
2
  class << self
5
3
  def open(resource_name, **, &block)
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Reader::Http
4
2
  class << self
5
3
  DEFAULT_HTTP_HEADERS = {
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Reader::Stdin
4
2
  class << self
5
3
  def open(resource_name, stdin: $stdin, **, &block)
@@ -1,5 +1,3 @@
1
- require "lslinks"
2
-
3
1
  module Lslinks::Reader
4
2
  class << self
5
3
  def open(resource_name, **options, &block)
@@ -0,0 +1,3 @@
1
+ module Lslinks
2
+ VERSION = "0.2.0"
3
+ end
data/lib/lslinks.rb CHANGED
@@ -6,8 +6,6 @@ require "uri"
6
6
  require "nokogiri"
7
7
 
8
8
  module Lslinks
9
- VERSION = "0.1.0"
10
-
11
9
  class << self
12
10
  def debug?
13
11
  return "1" == ENV["LSLINKS_DEBUG"]
@@ -15,7 +13,7 @@ module Lslinks
15
13
  end
16
14
  end
17
15
 
18
- Pathname(__dir__).glob("**/*.rb").map { |path|
16
+ (Pathname(__dir__).glob("**/*.rb") - [Pathname(__FILE__)]).map { |path|
19
17
  path.sub_ext("")
20
18
  }.sort.each do |path|
21
19
  require(path.relative_path_from(__dir__))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lslinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya.Nishida.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-12 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: test-unit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description:
28
42
  email:
29
43
  executables:
@@ -47,6 +61,7 @@ files:
47
61
  - lib/lslinks/reader/file.rb
48
62
  - lib/lslinks/reader/http.rb
49
63
  - lib/lslinks/reader/stdin.rb
64
+ - lib/lslinks/version.rb
50
65
  - sig/lslinks.rbs
51
66
  homepage: https://github.com/nishidayuya/lslinks
52
67
  licenses: []
@@ -61,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
76
  requirements:
62
77
  - - ">="
63
78
  - !ruby/object:Gem::Version
64
- version: 2.6.0
79
+ version: 3.2.0
65
80
  required_rubygems_version: !ruby/object:Gem::Requirement
66
81
  requirements:
67
82
  - - ">="