ntasks 0.0.1.alpha → 0.1.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.travis.yml +11 -4
- data/lib/ntasks.rb +8 -8
- data/lib/ntasks/cmd.rb +9 -9
- data/lib/ntasks/tasks/nuget/install/nuget_install.rb +15 -15
- data/lib/ntasks/tasks/nuget/install/nuget_install_config.rb +4 -4
- data/lib/ntasks/tasks/nuget/install/nuget_install_task.rb +21 -21
- data/lib/ntasks/tasks/nuget/nuget_base_config.rb +8 -8
- data/lib/ntasks/tasks/nuget/nuget_base_task.rb +12 -12
- data/lib/ntasks/tasks/nuget/pack/nuget_pack.rb +16 -16
- data/lib/ntasks/tasks/nuget/pack/nuget_pack_config.rb +5 -5
- data/lib/ntasks/tasks/nuget/pack/nuget_pack_task.rb +26 -26
- data/lib/ntasks/version.rb +3 -3
- data/ntasks.gemspec +3 -2
- data/spec/spec_helper.rb +7 -7
- data/spec/support/nuget_base_config_spec.rb +22 -22
- data/spec/tasks/nuget/nuget_install_task_spec.rb +39 -39
- data/spec/tasks/nuget/nuget_pack_task_spec.rb +64 -64
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGI1ZWI4ZWUwMjFlMmQ1OWFiMzFiMGNlYWVmZmQxZTM1YjZhNDIwMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGI3N2Q2ZjNjNWY5MGU4NDMwMDMxY2VmZDdhYmFmNGU3N2M3MzUyMQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDYyNmNiNzg0NjU4NDE1NzViZDYxYTUyYWNkMWM3YmRhNTVjMTIyOTE1OTdj
|
10
|
+
MGU3Njk2NjE1ZjdmNWNjNTkyNWZmMDYyM2NlNWZkMWU1NTI3OWRmOWYxY2U0
|
11
|
+
ODI1YzZmOTFmNTE3OTMxMzU5ZGVkYWYzNjIxMmNiYjFiNDI3Nzg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTBjNDQ5ZDExNmJlNGM5ODAzN2RhNDk2NWQ5ZGU4ZmUyMTE1ZjUzYjI0Y2Nj
|
14
|
+
Y2RkMjc0M2Q3YjJjYmNmZTUyZTZlYWY1ZGYxNDA0OGFjMDVkOWJmMDUxZTQz
|
15
|
+
YTJlOWJiZDYzYzhhMDRmOWE0Y2Q1MjQyOTNiNTRjMjg5N2IwODY=
|
data/.travis.yml
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
|
4
|
-
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
deploy:
|
6
|
+
provider: rubygems
|
7
|
+
api_key:
|
8
|
+
secure: e1oxpGDHsRybug+o4k5gzmmRsVICDHP+Q9N9l1TYUTVv9RxA3Z7xnxucie3gVUUXMv7aWXaOWF/n0zlulnVNZUcMhUZYChRPNK+awJwfQhjyKigeg1rnxsqam0i9w1xgKRIJKl3h289Jel1JDVX/Ltrd/ENG/8nt1dWMP3V3ev4=
|
9
|
+
gem: ntasks
|
10
|
+
on:
|
11
|
+
repo: StefanoGermani/ntasks
|
data/lib/ntasks.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'ntasks/version'
|
2
|
-
require 'ntasks/tasks/nuget/pack/nuget_pack'
|
3
|
-
require 'ntasks/tasks/nuget/install/nuget_install'
|
4
|
-
|
5
|
-
module NTasks
|
6
|
-
|
7
|
-
end
|
8
|
-
|
1
|
+
require 'ntasks/version'
|
2
|
+
require 'ntasks/tasks/nuget/pack/nuget_pack'
|
3
|
+
require 'ntasks/tasks/nuget/install/nuget_install'
|
4
|
+
|
5
|
+
module NTasks
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
9
|
self.extend NTasks::Nuget
|
data/lib/ntasks/cmd.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
class Cmd
|
2
|
-
|
3
|
-
def self.find_files(files)
|
4
|
-
FileList[files]
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.execute(command)
|
8
|
-
system command
|
9
|
-
end
|
1
|
+
class Cmd
|
2
|
+
|
3
|
+
def self.find_files(files)
|
4
|
+
FileList[files]
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.execute(command)
|
8
|
+
system command
|
9
|
+
end
|
10
10
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
require 'ntasks/tasks/nuget/install/nuget_install_config'
|
2
|
-
require 'ntasks/tasks/nuget/install/nuget_install_task'
|
3
|
-
|
4
|
-
module NTasks::Nuget
|
5
|
-
def nuget_install(*args, &block)
|
6
|
-
Rake::Task.define_task args do
|
7
|
-
config = NugetInstallConfig.new
|
8
|
-
|
9
|
-
yield config
|
10
|
-
|
11
|
-
NugetInstallTask.new(config).execute
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
1
|
+
require 'ntasks/tasks/nuget/install/nuget_install_config'
|
2
|
+
require 'ntasks/tasks/nuget/install/nuget_install_task'
|
3
|
+
|
4
|
+
module NTasks::Nuget
|
5
|
+
def nuget_install(*args, &block)
|
6
|
+
Rake::Task.define_task args do
|
7
|
+
config = NugetInstallConfig.new
|
8
|
+
|
9
|
+
yield config
|
10
|
+
|
11
|
+
NugetInstallTask.new(config).execute
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'ntasks/tasks/nuget/nuget_base_config'
|
2
|
-
|
3
|
-
class NugetInstallConfig < NugetBaseConfig
|
4
|
-
attr_accessor :package
|
1
|
+
require 'ntasks/tasks/nuget/nuget_base_config'
|
2
|
+
|
3
|
+
class NugetInstallConfig < NugetBaseConfig
|
4
|
+
attr_accessor :package
|
5
5
|
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
require 'ntasks/tasks/nuget/nuget_base_task'
|
2
|
-
|
3
|
-
class NugetInstallTask < NugetBaseTask
|
4
|
-
|
5
|
-
def initialize(config)
|
6
|
-
super
|
7
|
-
raise ArgumentError, 'package not defined' if config.package.nil? || config.package.empty?
|
8
|
-
@config = config
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
Cmd.execute "#{@config.exe} install #{@config.package} #{options}"
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def options
|
18
|
-
options = super
|
19
|
-
|
20
|
-
options
|
21
|
-
end
|
1
|
+
require 'ntasks/tasks/nuget/nuget_base_task'
|
2
|
+
|
3
|
+
class NugetInstallTask < NugetBaseTask
|
4
|
+
|
5
|
+
def initialize(config)
|
6
|
+
super
|
7
|
+
raise ArgumentError, 'package not defined' if config.package.nil? || config.package.empty?
|
8
|
+
@config = config
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
Cmd.execute "#{@config.exe} install #{@config.package} #{options}"
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def options
|
18
|
+
options = super
|
19
|
+
|
20
|
+
options
|
21
|
+
end
|
22
22
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class NugetBaseConfig
|
2
|
-
|
3
|
-
attr_accessor :exe
|
4
|
-
attr_accessor :source
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
|
1
|
+
class NugetBaseConfig
|
2
|
+
|
3
|
+
attr_accessor :exe
|
4
|
+
attr_accessor :source
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
|
@@ -1,12 +1,12 @@
|
|
1
|
-
class NugetBaseTask
|
2
|
-
def initialize(config)
|
3
|
-
raise ArgumentError, 'exe not defined' if config.exe.nil? || config.exe.empty?
|
4
|
-
end
|
5
|
-
|
6
|
-
def options
|
7
|
-
options = ''
|
8
|
-
options << "-Source #{@config.source} " unless @config.source.nil? || @config.source.empty?
|
9
|
-
|
10
|
-
options
|
11
|
-
end
|
12
|
-
end
|
1
|
+
class NugetBaseTask
|
2
|
+
def initialize(config)
|
3
|
+
raise ArgumentError, 'exe not defined' if config.exe.nil? || config.exe.empty?
|
4
|
+
end
|
5
|
+
|
6
|
+
def options
|
7
|
+
options = ''
|
8
|
+
options << "-Source #{@config.source} " unless @config.source.nil? || @config.source.empty?
|
9
|
+
|
10
|
+
options
|
11
|
+
end
|
12
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'ntasks/tasks/nuget/pack/nuget_pack_task'
|
3
|
-
require 'ntasks/tasks/nuget/pack/nuget_pack_config'
|
4
|
-
|
5
|
-
module NTasks::Nuget
|
6
|
-
|
7
|
-
def nuget_pack(*args, &block)
|
8
|
-
Rake::Task.define_task args do
|
9
|
-
config = NugetPackConfig.new
|
10
|
-
|
11
|
-
yield config
|
12
|
-
|
13
|
-
NugetPackTask.new(config).execute
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
1
|
+
require 'rake'
|
2
|
+
require 'ntasks/tasks/nuget/pack/nuget_pack_task'
|
3
|
+
require 'ntasks/tasks/nuget/pack/nuget_pack_config'
|
4
|
+
|
5
|
+
module NTasks::Nuget
|
6
|
+
|
7
|
+
def nuget_pack(*args, &block)
|
8
|
+
Rake::Task.define_task args do
|
9
|
+
config = NugetPackConfig.new
|
10
|
+
|
11
|
+
yield config
|
12
|
+
|
13
|
+
NugetPackTask.new(config).execute
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
17
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'ntasks/tasks/nuget/nuget_base_config'
|
2
|
-
|
3
|
-
class NugetPackConfig < NugetBaseConfig
|
4
|
-
attr_accessor :files
|
5
|
-
attr_accessor :version
|
1
|
+
require 'ntasks/tasks/nuget/nuget_base_config'
|
2
|
+
|
3
|
+
class NugetPackConfig < NugetBaseConfig
|
4
|
+
attr_accessor :files
|
5
|
+
attr_accessor :version
|
6
6
|
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
require 'ntasks/tasks/nuget/nuget_base_task'
|
2
|
-
|
3
|
-
class NugetPackTask < NugetBaseTask
|
4
|
-
def initialize(config)
|
5
|
-
super
|
6
|
-
|
7
|
-
raise ArgumentError, 'files not defined' if config.files.nil? || config.files.empty?
|
8
|
-
@config = config
|
9
|
-
end
|
10
|
-
|
11
|
-
def execute
|
12
|
-
files = Cmd.find_files @config.files
|
13
|
-
|
14
|
-
files.each do |file|
|
15
|
-
Cmd.execute("#{@config.exe} pack #{file} #{options}")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def options
|
22
|
-
options = super
|
23
|
-
options << "-Version #{@config.version} " unless @config.version.nil? || @config.version.empty?
|
24
|
-
|
25
|
-
options
|
26
|
-
end
|
1
|
+
require 'ntasks/tasks/nuget/nuget_base_task'
|
2
|
+
|
3
|
+
class NugetPackTask < NugetBaseTask
|
4
|
+
def initialize(config)
|
5
|
+
super
|
6
|
+
|
7
|
+
raise ArgumentError, 'files not defined' if config.files.nil? || config.files.empty?
|
8
|
+
@config = config
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
files = Cmd.find_files @config.files
|
13
|
+
|
14
|
+
files.each do |file|
|
15
|
+
Cmd.execute("#{@config.exe} pack #{file} #{options}")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def options
|
22
|
+
options = super
|
23
|
+
options << "-Version #{@config.version} " unless @config.version.nil? || @config.version.empty?
|
24
|
+
|
25
|
+
options
|
26
|
+
end
|
27
27
|
end
|
data/lib/ntasks/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module NTasks
|
2
|
-
VERSION = '0.
|
3
|
-
end
|
1
|
+
module NTasks
|
2
|
+
VERSION = '0.1.0'
|
3
|
+
end
|
data/ntasks.gemspec
CHANGED
@@ -6,6 +6,7 @@ require 'ntasks/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'ntasks'
|
8
8
|
spec.version = NTasks::VERSION
|
9
|
+
spec.version = "#{spec.version}.alpha#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
|
9
10
|
spec.authors = ['Stefano Germani']
|
10
11
|
spec.summary = 'Rake tasks for .NET'
|
11
12
|
#spec.description = %q{TODO: Write a longer description. Optional.}
|
@@ -18,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
18
19
|
spec.require_paths = ['lib']
|
19
20
|
|
20
21
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
21
|
-
spec.add_development_dependency 'rspec', '~> 3.0
|
22
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
22
23
|
|
23
|
-
spec.add_dependency 'rake', '
|
24
|
+
spec.add_dependency 'rake', '~> 10' # this gem builds on rake
|
24
25
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
Bundler.setup
|
3
|
-
|
4
|
-
Dir['./spec/support/**/*.rb'].each {|f| require f}
|
5
|
-
|
6
|
-
RSpec.configure do |config|
|
7
|
-
# some (optional) config here
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
Dir['./spec/support/**/*.rb'].each {|f| require f}
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
# some (optional) config here
|
8
8
|
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
shared_examples 'nuget exe nil or empty' do
|
4
|
-
|
5
|
-
context 'when exe property is nil' do
|
6
|
-
it 'raises an error' do
|
7
|
-
expect { subject }.to raise_error ArgumentError
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'when exe property is empty' do
|
12
|
-
before { config.exe = '' }
|
13
|
-
it 'raises an error' do
|
14
|
-
expect { subject }.to raise_error ArgumentError
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
shared_examples 'source property' do
|
21
|
-
|
22
|
-
end
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
shared_examples 'nuget exe nil or empty' do
|
4
|
+
|
5
|
+
context 'when exe property is nil' do
|
6
|
+
it 'raises an error' do
|
7
|
+
expect { subject }.to raise_error ArgumentError
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'when exe property is empty' do
|
12
|
+
before { config.exe = '' }
|
13
|
+
it 'raises an error' do
|
14
|
+
expect { subject }.to raise_error ArgumentError
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
shared_examples 'source property' do
|
21
|
+
|
22
|
+
end
|
@@ -1,40 +1,40 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
require 'ntasks'
|
4
|
-
require 'ntasks/cmd'
|
5
|
-
|
6
|
-
include NTasks::Nuget
|
7
|
-
|
8
|
-
describe NugetInstallTask do
|
9
|
-
|
10
|
-
let(:config) { NugetInstallConfig.new }
|
11
|
-
subject { NugetInstallTask.new(config) }
|
12
|
-
|
13
|
-
include_examples 'nuget exe nil or empty'
|
14
|
-
|
15
|
-
context 'when exe property is valid' do
|
16
|
-
before { config.exe = 'test.exe' }
|
17
|
-
|
18
|
-
context 'and package property is nil' do
|
19
|
-
it 'raises an error' do
|
20
|
-
expect { subject }.to raise_error ArgumentError
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context 'and package property is empty' do
|
25
|
-
before { config.exe = '' }
|
26
|
-
it 'raises an error' do
|
27
|
-
expect { subject }.to raise_error ArgumentError
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'and package property is valid' do
|
32
|
-
before { config.package = 'package' }
|
33
|
-
|
34
|
-
it 'execute the correct command' do
|
35
|
-
expect(Cmd).to receive(:execute).with('test.exe install package ')
|
36
|
-
subject.execute
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
require 'ntasks'
|
4
|
+
require 'ntasks/cmd'
|
5
|
+
|
6
|
+
include NTasks::Nuget
|
7
|
+
|
8
|
+
describe NugetInstallTask do
|
9
|
+
|
10
|
+
let(:config) { NugetInstallConfig.new }
|
11
|
+
subject { NugetInstallTask.new(config) }
|
12
|
+
|
13
|
+
include_examples 'nuget exe nil or empty'
|
14
|
+
|
15
|
+
context 'when exe property is valid' do
|
16
|
+
before { config.exe = 'test.exe' }
|
17
|
+
|
18
|
+
context 'and package property is nil' do
|
19
|
+
it 'raises an error' do
|
20
|
+
expect { subject }.to raise_error ArgumentError
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'and package property is empty' do
|
25
|
+
before { config.exe = '' }
|
26
|
+
it 'raises an error' do
|
27
|
+
expect { subject }.to raise_error ArgumentError
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'and package property is valid' do
|
32
|
+
before { config.package = 'package' }
|
33
|
+
|
34
|
+
it 'execute the correct command' do
|
35
|
+
expect(Cmd).to receive(:execute).with('test.exe install package ')
|
36
|
+
subject.execute
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
40
|
end
|
@@ -1,64 +1,64 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'ntasks'
|
3
|
-
require 'ntasks/cmd'
|
4
|
-
|
5
|
-
include NTasks::Nuget
|
6
|
-
|
7
|
-
describe NugetPackTask do
|
8
|
-
|
9
|
-
let(:config) { NugetPackConfig.new }
|
10
|
-
subject { NugetPackTask.new(config) }
|
11
|
-
|
12
|
-
include_examples 'nuget exe nil or empty'
|
13
|
-
|
14
|
-
context 'when exe property is valid' do
|
15
|
-
before { config.exe = 'test.exe' }
|
16
|
-
|
17
|
-
context 'and files property is nil' do
|
18
|
-
it 'raises an error' do
|
19
|
-
expect { subject }.to raise_error ArgumentError
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'and files property is empty' do
|
24
|
-
before { config.files = '' }
|
25
|
-
it 'raises an error' do
|
26
|
-
expect { subject }.to raise_error ArgumentError
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'and files property is valid' do
|
31
|
-
before do
|
32
|
-
config.files = 'file'
|
33
|
-
allow(Cmd).to receive(:find_files) { ['file'] }
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'instance a task' do
|
37
|
-
expect(subject).to be_an_instance_of NugetPackTask
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'execute the correct command' do
|
41
|
-
expect(Cmd).to receive(:execute).with('test.exe pack file ')
|
42
|
-
subject.execute
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'when setting source property' do
|
46
|
-
before { config.source = 'source' }
|
47
|
-
|
48
|
-
it 'execute the correct command' do
|
49
|
-
expect(Cmd).to receive(:execute).with('test.exe pack file -Source source ')
|
50
|
-
subject.execute
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
context 'when setting version property' do
|
55
|
-
before { config.version = 'version' }
|
56
|
-
|
57
|
-
it 'execute the correct command' do
|
58
|
-
expect(Cmd).to receive(:execute).with('test.exe pack file -Version version ')
|
59
|
-
subject.execute
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
1
|
+
require 'rspec'
|
2
|
+
require 'ntasks'
|
3
|
+
require 'ntasks/cmd'
|
4
|
+
|
5
|
+
include NTasks::Nuget
|
6
|
+
|
7
|
+
describe NugetPackTask do
|
8
|
+
|
9
|
+
let(:config) { NugetPackConfig.new }
|
10
|
+
subject { NugetPackTask.new(config) }
|
11
|
+
|
12
|
+
include_examples 'nuget exe nil or empty'
|
13
|
+
|
14
|
+
context 'when exe property is valid' do
|
15
|
+
before { config.exe = 'test.exe' }
|
16
|
+
|
17
|
+
context 'and files property is nil' do
|
18
|
+
it 'raises an error' do
|
19
|
+
expect { subject }.to raise_error ArgumentError
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'and files property is empty' do
|
24
|
+
before { config.files = '' }
|
25
|
+
it 'raises an error' do
|
26
|
+
expect { subject }.to raise_error ArgumentError
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'and files property is valid' do
|
31
|
+
before do
|
32
|
+
config.files = 'file'
|
33
|
+
allow(Cmd).to receive(:find_files) { ['file'] }
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'instance a task' do
|
37
|
+
expect(subject).to be_an_instance_of NugetPackTask
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'execute the correct command' do
|
41
|
+
expect(Cmd).to receive(:execute).with('test.exe pack file ')
|
42
|
+
subject.execute
|
43
|
+
end
|
44
|
+
|
45
|
+
context 'when setting source property' do
|
46
|
+
before { config.source = 'source' }
|
47
|
+
|
48
|
+
it 'execute the correct command' do
|
49
|
+
expect(Cmd).to receive(:execute).with('test.exe pack file -Source source ')
|
50
|
+
subject.execute
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'when setting version property' do
|
55
|
+
before { config.version = 'version' }
|
56
|
+
|
57
|
+
it 'execute the correct command' do
|
58
|
+
expect(Cmd).to receive(:execute).with('test.exe pack file -Version version ')
|
59
|
+
subject.execute
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ntasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.1.0.alpha4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Germani
|
@@ -14,42 +14,42 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0
|
33
|
+
version: '3.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '10'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10'
|
55
55
|
description:
|
@@ -58,8 +58,8 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
-
-
|
62
|
-
-
|
61
|
+
- .gitignore
|
62
|
+
- .travis.yml
|
63
63
|
- Gemfile
|
64
64
|
- LICENSE.txt
|
65
65
|
- README.md
|
@@ -90,17 +90,17 @@ require_paths:
|
|
90
90
|
- lib
|
91
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ! '>='
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- -
|
98
|
+
- - ! '>'
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: 1.3.1
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.0
|
103
|
+
rubygems_version: 2.3.0
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Rake tasks for .NET
|