ruby_npm 0.1.0.pre.3 → 0.1.0.pre.5

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: 237ebd0f181a703bb4eab351730cebbda23dcb98925fa807b07e34d35e2f3252
4
- data.tar.gz: c27b634150d240bb86034e7c69a582b00426f9e7d1aae732a1464293711dea40
3
+ metadata.gz: ce491bb0461af039ab87e58c633f81038fa896566366305b7f03b3b86f0f5d04
4
+ data.tar.gz: 30395ff9775bd4152c6732faf64537416785923fc8fe3d9162a4e508a99cec43
5
5
  SHA512:
6
- metadata.gz: 70d379c15bc4163adccdeb05fd083a57ce80808ae4d73da8025bf70ffe219e425d6d0747c52b88db2d765c72b6346451f03860c721d15d9aded0c2fc43167428
7
- data.tar.gz: b142252fd0bcdc4a5608352d265302c2f75975e8e116a6b7997d493c9e4df4821b6d342295392a9cf3241c1e54e18ce47d0ed53b03f92651355a174b58ec82c2
6
+ metadata.gz: 3282e0ab171c6f3989a23ea776426b3f8d10c7f9680935ca7597de7a801b52f226e922c31e545810aa54112405ed55cfab9c9ee844412889acd9764c87ff6bf8
7
+ data.tar.gz: 13a971beafa8bf2384c508412f24a4b4b90dbe16df3e839a67e5b405329eb616c67dfd9ecf620d323d85b546f85964c786d1856b5aac8efda6840c7d119b7ad1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_npm (0.1.0.pre.3)
4
+ ruby_npm (0.1.0.pre.5)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -13,50 +13,31 @@ module RubyNPM
13
13
  # @!visibility private
14
14
  # rubocop:disable Metrics/MethodLength
15
15
  def options
16
- %w[
17
- --audit
18
- --bin-links
19
- --color
20
- --dry-run
21
- --force
22
- --foreground-scripts
23
- --fund
24
- --global
25
- --global-style
26
- --ignore-scripts
27
- --include
28
- --include-workspace-root
29
- --install-links
30
- --install-strategy
31
- --legacy-bundling
32
- --loglevel
33
- --logs-dir
34
- --logs-max
35
- --omit
36
- --package-lock
37
- --package-lock-only
38
- --production
39
- --quiet
40
- --save
41
- --save-bundle
42
- --save-dev
43
- --save-exact
44
- --save-optional
45
- --save-peer
46
- --save-prod
47
- --script-shell
48
- --silent
49
- --strict-peer-deps
50
- --tag
51
- --verbose
52
- --workspace
53
- --workspaces
54
- ] + super
16
+ super +
17
+ Options::Sets::WORKSPACE_OPTIONS +
18
+ Options::Sets::LOGGING_OPTIONS +
19
+ Options::Sets::GLOBAL_OPTIONS +
20
+ Options::Sets::DEPENDENCY_OPTIONS +
21
+ %w[
22
+ --audit
23
+ --bin-links
24
+ --fund
25
+ --global
26
+ --global-style
27
+ --install-links
28
+ --install-strategy
29
+ --json
30
+ --legacy-bundling
31
+ --package-lock
32
+ --package-lock-only
33
+ --strict-peer-deps
34
+ --tag
35
+ ]
55
36
  end
56
37
  # rubocop:enable Metrics/MethodLength
57
38
 
58
39
  def arguments(parameters)
59
- [parameters[:packages]]
40
+ [parameters[:package_specs]]
60
41
  end
61
42
  end
62
43
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyNPM
6
+ module Commands
7
+ class Publish < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[publish]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ Options::Sets::WORKSPACE_OPTIONS +
17
+ Options::Sets::LOGGING_OPTIONS +
18
+ Options::Sets::GLOBAL_OPTIONS +
19
+ %w[
20
+ --access
21
+ --json
22
+ --otp
23
+ --tag
24
+ ]
25
+ end
26
+
27
+ def arguments(parameters)
28
+ [parameters[:package_spec]]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -11,28 +11,17 @@ module RubyNPM
11
11
  end
12
12
 
13
13
  # @!visibility private
14
- # rubocop:disable Metrics/MethodLength
15
14
  def options
16
- %w[
17
- --color
18
- --foreground-scripts
19
- --if-present
20
- --ignore-scripts
21
- --include-workspace-root
22
- --json
23
- --loglevel
24
- --logs-dir
25
- --logs-max
26
- --parseable
27
- --quiet
28
- --script-shell
29
- --silent
30
- --verbose
31
- --workspace
32
- --workspaces
33
- ] + super
15
+ super +
16
+ Options::Sets::WORKSPACE_OPTIONS +
17
+ Options::Sets::LOGGING_OPTIONS +
18
+ Options::Sets::GLOBAL_OPTIONS +
19
+ %w[
20
+ --if-present
21
+ --json
22
+ --parseable
23
+ ]
34
24
  end
35
- # rubocop:enable Metrics/MethodLength
36
25
 
37
26
  def arguments(parameters)
38
27
  script_arguments =
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'commands/install'
4
+ require_relative 'commands/publish'
4
5
  require_relative 'commands/run_script'
5
6
 
6
7
  module RubyNPM
@@ -1,12 +1,77 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyNPM
4
+ # rubocop:disable Metrics/ModuleLength
4
5
  module Options
5
- DEFINITIONS = [
6
- # concrete definitions
7
- [
8
- workspaces
9
- ],
6
+ WORKSPACE_DEFINITIONS = [
7
+ workspaces,
8
+ definition(
9
+ name: '--workspace',
10
+ option_type: :standard,
11
+ value_type: :string
12
+ ),
13
+ definition(
14
+ name: '--include-workspace-root',
15
+ option_type: :standard,
16
+ value_type: :boolean
17
+ )
18
+ ].freeze
19
+
20
+ LOGGING_DEFINITIONS = [
21
+ # string options
22
+ %w[
23
+ --loglevel
24
+ --logs-dir
25
+ --logs-max
26
+ ].map do |o|
27
+ definition(
28
+ name: o, option_type: :standard, value_type: :string
29
+ )
30
+ end,
31
+
32
+ # flag options
33
+ %w[
34
+ --quiet
35
+ --silent
36
+ --verbose
37
+ ].map do |o|
38
+ definition(name: o, option_type: :flag, value_type: :boolean)
39
+ end
40
+ ].flatten.freeze
41
+
42
+ GLOBAL_DEFINITIONS = [
43
+ # string options
44
+ %w[
45
+ --color
46
+ --script-shell
47
+ ].map do |o|
48
+ definition(
49
+ name: o, option_type: :standard, value_type: :string
50
+ )
51
+ end,
52
+
53
+ # boolean options
54
+ %w[
55
+ --dry-run
56
+ --force
57
+ --foreground-scripts
58
+ --ignore-scripts
59
+ ].map do |o|
60
+ definition(
61
+ name: o, option_type: :standard, value_type: :boolean
62
+ )
63
+ end
64
+ ].flatten.freeze
65
+
66
+ DEPENDENCY_DEFINITIONS = [
67
+ # string options
68
+ %w[
69
+ --save-prefix
70
+ ].map do |o|
71
+ definition(
72
+ name: o, option_type: :standard, value_type: :string
73
+ )
74
+ end,
10
75
 
11
76
  # string repeatable options
12
77
  {
@@ -20,58 +85,59 @@ module RubyNPM
20
85
  )
21
86
  end,
22
87
 
88
+ # boolean options
89
+ %w[
90
+ --save
91
+ --save-bundle
92
+ --save-dev
93
+ --save-exact
94
+ --save-optional
95
+ --save-peer
96
+ --save-prod
97
+ ].map do |o|
98
+ definition(
99
+ name: o, option_type: :standard, value_type: :boolean
100
+ )
101
+ end
102
+ ].flatten.freeze
103
+
104
+ OUTPUT_DEFINITIONS = [
105
+ # boolean options
106
+ %w[
107
+ --json
108
+ ].map do |o|
109
+ definition(
110
+ name: o, option_type: :standard, value_type: :boolean
111
+ )
112
+ end
113
+ ].flatten.freeze
114
+
115
+ OTHER_DEFINITIONS = [
23
116
  # string options
24
117
  %w[
25
- --color
118
+ --access
26
119
  --install-strategy
27
- --loglevel
28
- --logs-dir
29
- --logs-max
30
- --script-shell
120
+ --otp
31
121
  --tag
32
- --workspace
33
122
  ].map do |o|
34
123
  definition(
35
124
  name: o, option_type: :standard, value_type: :string
36
125
  )
37
126
  end,
38
127
 
39
- # flag options
40
- %w[
41
- --quiet
42
- --silent
43
- --verbose
44
- ].map do |o|
45
- definition(name: o, option_type: :flag, value_type: :boolean)
46
- end,
47
-
48
128
  # boolean options
49
129
  %w[
50
130
  --audit
51
131
  --bin-links
52
- --dry-run
53
- --force
54
- --foreground-scripts
55
132
  --fund
56
133
  --global
57
134
  --global-style
58
135
  --if-present
59
- --ignore-scripts
60
- --include-workspace-root
61
136
  --install-links
62
- --json
63
137
  --legacy-bundling
64
138
  --package-lock
65
139
  --package-lock-only
66
140
  --parseable
67
- --production
68
- --save
69
- --save-bundle
70
- --save-dev
71
- --save-exact
72
- --save-optional
73
- --save-peer
74
- --save-prod
75
141
  --strict-peer-deps
76
142
  ].map do |o|
77
143
  definition(
@@ -79,5 +145,15 @@ module RubyNPM
79
145
  )
80
146
  end
81
147
  ].flatten.freeze
148
+
149
+ DEFINITIONS = (
150
+ WORKSPACE_DEFINITIONS +
151
+ LOGGING_DEFINITIONS +
152
+ GLOBAL_DEFINITIONS +
153
+ DEPENDENCY_DEFINITIONS +
154
+ OUTPUT_DEFINITIONS +
155
+ OTHER_DEFINITIONS
156
+ )
82
157
  end
158
+ # rubocop:enable Metrics/ModuleLength
83
159
  end
@@ -3,6 +3,46 @@
3
3
  module RubyNPM
4
4
  module Options
5
5
  module Sets
6
+ WORKSPACE_OPTIONS = %w[
7
+ --include-workspace-root
8
+ --workspace
9
+ --workspaces
10
+ ].freeze
11
+
12
+ LOGGING_OPTIONS = %w[
13
+ --loglevel
14
+ --logs-dir
15
+ --logs-max
16
+ --quiet
17
+ --silent
18
+ --verbose
19
+ ].freeze
20
+
21
+ GLOBAL_OPTIONS = %w[
22
+ --color
23
+ --dry-run
24
+ --force
25
+ --foreground-scripts
26
+ --ignore-scripts
27
+ --script-shell
28
+ ].freeze
29
+
30
+ DEPENDENCY_OPTIONS = %w[
31
+ --include
32
+ --omit
33
+ --save
34
+ --save-bundle
35
+ --save-dev
36
+ --save-exact
37
+ --save-optional
38
+ --save-peer
39
+ --save-prefix
40
+ --save-prod
41
+ ].freeze
42
+
43
+ OUTPUT_OPTIONS = %w[
44
+ --json
45
+ ].freeze
6
46
  end
7
47
  end
8
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyNPM
4
- VERSION = '0.1.0.pre.3'
4
+ VERSION = '0.1.0.pre.5'
5
5
  end
data/lib/ruby_npm.rb CHANGED
@@ -26,6 +26,16 @@ module RubyNPM
26
26
  parameters, invocation_options)
27
27
  end
28
28
 
29
+ def publish(parameters = {}, invocation_options = {})
30
+ exec(RubyNPM::Commands::Publish,
31
+ parameters, invocation_options)
32
+ end
33
+
34
+ def run_script(parameters = {}, invocation_options = {})
35
+ exec(RubyNPM::Commands::RunScript,
36
+ parameters, invocation_options)
37
+ end
38
+
29
39
  private
30
40
 
31
41
  def exec(command_class, parameters, invocation_options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_npm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.3
4
+ version: 0.1.0.pre.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: immutable-struct
@@ -295,6 +295,7 @@ files:
295
295
  - lib/ruby_npm/commands.rb
296
296
  - lib/ruby_npm/commands/base.rb
297
297
  - lib/ruby_npm/commands/install.rb
298
+ - lib/ruby_npm/commands/publish.rb
298
299
  - lib/ruby_npm/commands/run_script.rb
299
300
  - lib/ruby_npm/errors.rb
300
301
  - lib/ruby_npm/errors/execution_error.rb