maestro-plugin-rake-tasks 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maestro-plugin-rake-tasks (1.0.1)
4
+ maestro-plugin-rake-tasks (1.0.2)
5
5
  git
6
6
  json (>= 1.4.6)
7
7
  nokogiri
@@ -131,7 +131,12 @@ module Maestro
131
131
  # update the version number in the manifest file.
132
132
  def update_manifest
133
133
  manifest = JSON.parse(IO.read(@manifest_template_path))
134
- manifest.each { |m| m['version'] = @version }
134
+ if manifest.instance_of? Array
135
+ manifest.each { |m| m['version'] = @version }
136
+ else
137
+ manifest['version'] = @version
138
+ end
139
+
135
140
  File.open('manifest.json','w'){ |f| f.write(JSON.pretty_generate(manifest)) }
136
141
  end
137
142
 
@@ -1,7 +1,7 @@
1
1
  module Maestro
2
2
  module Plugin
3
3
  module RakeTasks
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -57,7 +57,7 @@ describe Maestro::Plugin::RakeTasks::PackageTask do
57
57
 
58
58
  end
59
59
 
60
- it 'should create an updated manifest file' do
60
+ it 'should create an updated manifest file for multi-tasks manifests' do
61
61
  @task.stub(:git_version!)
62
62
  @task.stub(:create_zip_file)
63
63
  @task.run_task true
@@ -69,6 +69,19 @@ describe Maestro::Plugin::RakeTasks::PackageTask do
69
69
 
70
70
  end
71
71
 
72
+ it 'should create an updated manifest file for single-task manifests' do
73
+ @task.stub(:git_version!)
74
+ @task.stub(:create_zip_file)
75
+ @task.manifest_template_path=File.dirname(__FILE__) + '/../../../manifest-single-task.template.json'
76
+ @task.run_task true
77
+
78
+ manifest_path = File.dirname(__FILE__) + '/../../../../manifest.json'
79
+ File.exists?(manifest_path).should be_true
80
+ manifest = JSON.parse(IO.read(manifest_path))
81
+ manifest['version'].should == 'X.Y.Z'
82
+
83
+ end
84
+
72
85
  it 'should name the zip file based on the plugin_name and version' do
73
86
  @task.stub(:git_version!)
74
87
  @task.stub(:update_manifest)
@@ -0,0 +1,9 @@
1
+ {
2
+ "name" : "test",
3
+ "description" : "test manifest",
4
+ "license" : "Apache 2.0",
5
+ "author": "Author",
6
+ "version": "updated at build time",
7
+ "class": "SomeClass",
8
+ "type":"ruby"
9
+ }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: maestro-plugin-rake-tasks
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Etienne Pelletier
@@ -112,6 +112,7 @@ files:
112
112
  - lib/maestro/plugin/rake_tasks/version.rb
113
113
  - maestro-plugin-rake-tasks.gemspec
114
114
  - spec/maestro/plugin/rake_tasks/package_task_spec.rb
115
+ - spec/manifest-single-task.template.json
115
116
  - spec/manifest.template.json
116
117
  - spec/pom.xml
117
118
  - spec/spec_helper.rb
@@ -150,6 +151,7 @@ specification_version: 3
150
151
  summary: A collection of Rake tasks used to package Maetro Ruby plugins
151
152
  test_files:
152
153
  - spec/maestro/plugin/rake_tasks/package_task_spec.rb
154
+ - spec/manifest-single-task.template.json
153
155
  - spec/manifest.template.json
154
156
  - spec/pom.xml
155
157
  - spec/spec_helper.rb