js_dependency 0.3.1 → 0.3.2

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: 105b4f97bf9e521b3665eaa4b1b3ffb28210cc9a3c5937eacf9e37720df78d09
4
- data.tar.gz: 020eca2f41c6e7f63ac8f1bd91e7b0191e2496d5e28b62edabca74e58aa85251
3
+ metadata.gz: 2bcea60e75e368a74db588a569dcc71dac789988395940b9ae2ec8f8be965cef
4
+ data.tar.gz: 3760510a51085c9842eaf0a2b49989c3c400b130bde282d6150f4d986c38c36b
5
5
  SHA512:
6
- metadata.gz: 4274c3354a8ddc358036c5a7246e5fa905947b4760417350ed28c57a02dd10a9fd4e77535c0fe2fdbe91ac4237d5f9a35d7acfc6f23257cb2201078f4608342f
7
- data.tar.gz: 135352e118f7d89dd0c024be73ed3671ec075272d4d51f8138fe5a954d5f3e115782b559dcd3be67ebec380af3dbc95d2cf073fc3ede700e0fca4c3bee6d2cf2
6
+ metadata.gz: ba4acdf96d74072a3e439647bdd5817f622d11393961127af5ee88d112a53c4d4231a31bf2a08129dc889cc59bf69e7057e0074554d3572cf9396457dc98e2cd
7
+ data.tar.gz: 285681ef4ebea7f2eb9a6cb8214316d0f7899bc275723bcf35be8bde33c2ae5824f3ba0be7e64d163fc3120971073f7c6bbe19bfc265eff0c44722ee2fd7d018
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-07-24 23:16:43 UTC using RuboCop version 1.31.2.
3
+ # on 2022-07-25 14:50:54 UTC using RuboCop version 1.31.2.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -9,7 +9,7 @@
9
9
  # Offense count: 7
10
10
  # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
- Max: 40
12
+ Max: 41
13
13
 
14
14
  # Offense count: 5
15
15
  # Configuration parameters: IgnoredMethods.
@@ -31,18 +31,12 @@ Metrics/ParameterLists:
31
31
  Metrics/PerceivedComplexity:
32
32
  Max: 17
33
33
 
34
- # Offense count: 1
35
- # This cop supports safe autocorrection (--autocorrect).
36
- Style/IfUnlessModifier:
37
- Exclude:
38
- - 'lib/js_dependency/index_creator.rb'
39
-
40
34
  # Offense count: 1
41
35
  Style/MultilineBlockChain:
42
36
  Exclude:
43
37
  - 'lib/js_dependency/mermaid/root.rb'
44
38
 
45
- # Offense count: 6
39
+ # Offense count: 7
46
40
  # This cop supports safe autocorrection (--autocorrect).
47
41
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
48
42
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.2] - 2022-07-26
4
+
5
+ - Multiple excludes option for CLI.
6
+
3
7
  ## [0.3.1] - 2022-07-25
4
8
 
5
9
  - Multiple target paths for JsDependency.export and export_mermaid CLI.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- js_dependency (0.3.1)
4
+ js_dependency (0.3.2)
5
5
  pathname
6
6
  thor
7
7
  yaml
data/README.md CHANGED
@@ -61,6 +61,12 @@ js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1
61
61
  js_dependency -s ./src -t ./src/App.vue ./src/components/Sub.vue -o ./mermaid.txt -c 2 -p 2 -n 1
62
62
  ```
63
63
 
64
+ ##### Exclude path which iclude exclude words `-e` from output
65
+
66
+ ```shell
67
+ js_dependency -s ./src -t ./src/App.vue -o ./mermaid.txt -c 2 -p 2 -n 1 -e excludeWord1 excludeWord2
68
+ ```
69
+
64
70
  #### Export parents components list
65
71
 
66
72
  ```shell
@@ -9,12 +9,12 @@ module JsDependency
9
9
 
10
10
  desc "export_mermaid", "Output mermaid flowchart string."
11
11
  option :src_path, type: :string, aliases: "-s", desc: "Root folder."
12
- option :target_path, type: :array, aliases: "-t", desc: "Target file that you want to analyze."
12
+ option :target_paths, type: :array, aliases: "-t", desc: "Target file that you want to analyze."
13
13
  option :output_path, type: :string, aliases: "-o", desc: "Output file path"
14
14
  option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
15
15
  option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
16
16
  option :name_level, type: :numeric, aliases: "-n", desc: "Output name level"
17
- option :exclude, type: :string, aliases: "-e", desc: "Exclude the word that is included in the path"
17
+ option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
18
18
 
19
19
  def export_mermaid
20
20
  pathname = Pathname.new(".js_dependency.yml")
@@ -22,14 +22,14 @@ module JsDependency
22
22
  args = YAML.safe_load(pathname.read) if pathname.exist?
23
23
 
24
24
  src_path = options[:src_path] || args["src_path"]
25
- target_paths = options[:target_path] || (args["target_path"].is_a?(String) ? [args["target_path"]] : args["target_path"])
25
+ target_paths = options[:target_paths] || (args["target_path"].is_a?(String) ? [args["target_path"]] : args["target_path"])
26
26
  child_analyze_level = options[:child_analyze_level] || args["child_analyze_level"] || 2
27
27
  parent_analyze_level = options[:parent_analyze_level] || args["parent_analyze_level"] || 2
28
28
  output_path = options[:output_path] || args["output_path"] || nil
29
29
  alias_paths = args["alias_paths"] || nil
30
30
  name_level = options[:name_level] || args["name_level"] || 1
31
- excludes = if options[:exclude]
32
- [options[:exclude]]
31
+ excludes = if options[:excludes].length.positive?
32
+ options[:excludes]
33
33
  elsif args["excludes"]
34
34
  args["excludes"]
35
35
  end
@@ -53,7 +53,7 @@ module JsDependency
53
53
  option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
54
54
  option :output_path, type: :string, aliases: "-o", desc: "Output file path"
55
55
  option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
56
- option :exclude, type: :string, aliases: "-e", desc: "Exclude the word that is included in the path"
56
+ option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
57
57
 
58
58
  def parents
59
59
  pathname = Pathname.new(".js_dependency.yml")
@@ -65,8 +65,8 @@ module JsDependency
65
65
  parent_analyze_level = options[:parent_analyze_level] || args["parent_analyze_level"] || 1
66
66
  output_path = options[:output_path] || args["output_path"] || nil
67
67
  alias_paths = args["alias_paths"] || nil
68
- excludes = if options[:exclude]
69
- [options[:exclude]]
68
+ excludes = if options[:excludes].length.positive?
69
+ options[:excludes]
70
70
  elsif args["excludes"]
71
71
  args["excludes"]
72
72
  end
@@ -88,7 +88,7 @@ module JsDependency
88
88
  option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
89
89
  option :output_path, type: :string, aliases: "-o", desc: "Output file path"
90
90
  option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
91
- option :exclude, type: :string, aliases: "-e", desc: "Exclude the word that is included in the path"
91
+ option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
92
92
 
93
93
  def children
94
94
  pathname = Pathname.new(".js_dependency.yml")
@@ -100,8 +100,8 @@ module JsDependency
100
100
  child_analyze_level = options[:child_analyze_level] || args["child_analyze_level"] || 1
101
101
  output_path = options[:output_path] || args["output_path"] || nil
102
102
  alias_paths = args["alias_paths"] || nil
103
- excludes = if options[:exclude]
104
- [options[:exclude]]
103
+ excludes = if options[:excludes].length.positive?
104
+ options[:excludes]
105
105
  elsif args["excludes"]
106
106
  args["excludes"]
107
107
  end
@@ -47,9 +47,7 @@ module JsDependency
47
47
  import_pathnames = import_pathnames_from(component_pathname, alias_paths)
48
48
 
49
49
  obj[component_pathname.to_s] = import_pathnames.map(&:to_s)
50
- if component_pathname.basename.to_s == "index.js"
51
- obj[component_pathname.dirname.to_s] = import_pathnames.map(&:to_s)
52
- end
50
+ obj[component_pathname.dirname.to_s] = import_pathnames.map(&:to_s) if component_pathname.basename.to_s == "index.js"
53
51
  end
54
52
  end
55
53
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsDependency
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_dependency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - junara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-24 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pathname