Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Remove unused vcs option from 'pdk new module' #192

Merged
merged 1 commit into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Generates a new module.
Usage:

```
pdk new module [--template-url=git_url] [--license=spdx_identifier] [--vcs=vcs_provider] module_name [target_dir]
pdk new module [--template-url=git_url] [--license=spdx_identifier] module_name [target_dir]
```

The `pdk new module` command accepts the following arguments and options. Arguments are optional unless otherwise specified.
Expand All @@ -111,10 +111,6 @@ Overrides the template to use for this module. If possible, please contribute yo

Specifies the license this module is written under. See https://spdx.org/licenses/ for a list of open source licenses, or use `proprietary`. Defaults to `Apache-2.0`.

#### `--vcs=vcs_provider`

Specifies the version control driver. Valid values: `git`, `none`. Default: `git`.

#### `--skip-interview`

Suppress interactive queries for initial values. All questions will use the default values.
Expand Down
3 changes: 0 additions & 3 deletions lib/pdk/cli/new/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module PDK::CLI
option nil, 'license', _('Specifies the license this module is written under. ' \
"This should be a identifier from https://spdx.org/licenses/. Common values are 'Apache-2.0', 'MIT', or 'proprietary'."), argument: :required

option nil, 'vcs', _("Specifies the version control driver. Valid values: 'git', 'none'. Default: 'git'."), argument: :required

flag nil, 'skip-interview', _('When specified, skips interactive querying of metadata.')

run do |opts, args, _cmd|
Expand All @@ -35,7 +33,6 @@ module PDK::CLI

opts[:name] = module_name
opts[:target_dir] = target_dir.nil? ? module_name : target_dir
opts[:vcs] ||= 'git'

PDK.logger.info(_('Creating new module: %{modname}') % { modname: module_name })
PDK::Generate::Module.invoke(opts)
Expand Down
18 changes: 0 additions & 18 deletions spec/unit/cli/new/module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@
end
end

context 'and the vcs option' do
let(:vcs) { 'svn' }

it 'passes the value of the vcs option to PDK::Generate::Module.invoke' do
expect(PDK::Generate::Module).to receive(:invoke).with(hash_including(vcs: vcs))
expect(logger).to receive(:info).with("Creating new module: #{module_name}")
PDK::CLI.run(['new', 'module', '--vcs', vcs, module_name])
end
end

context 'without the vcs option' do
it 'defaults the value of the vcs option to git' do
expect(PDK::Generate::Module).to receive(:invoke).with(hash_including(vcs: 'git'))
expect(logger).to receive(:info).with("Creating new module: #{module_name}")
PDK::CLI.run(['new', 'module', module_name])
end
end

context 'and the license option' do
let(:license) { 'MIT' }

Expand Down