maestro-plugin-rake-tasks 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 372d284ffbe4bf0d557b8f6d358ecb8be274f582
|
4
|
+
data.tar.gz: dae11a40a994b4fb5a68643be55668f612c796ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8461f93e317466fd59eb7faf8e20ca6802564acf9df566e41ffafac824456979dc146dffaae3a192bd572afb1e94e9923c7a89d7accdc1510755267ac216d81
|
7
|
+
data.tar.gz: 0f2f8bcba120406376da046a7486daf4df82eb52d3eb50b3efedc6de38353cf8013ca8f29be951a4b05052aeac3fe627c77efe3c503fdab57524012af28c8e36
|
data/.gitignore
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'maestro/plugin/rake_tasks/version'
|
2
|
+
require 'maestro/plugin/rake_tasks/pom'
|
2
3
|
require 'rake'
|
3
4
|
require 'rake/tasklib'
|
4
5
|
require 'zip'
|
5
6
|
require 'git'
|
6
|
-
require 'nokogiri'
|
7
7
|
require 'json'
|
8
8
|
|
9
9
|
|
@@ -106,11 +106,9 @@ module Maestro
|
|
106
106
|
private
|
107
107
|
|
108
108
|
def parse_pom
|
109
|
-
pom =
|
110
|
-
|
111
|
-
pom.
|
112
|
-
@plugin_name ||= doc.at_xpath('/xmlns:project/xmlns:artifactId').text
|
113
|
-
@version ||= doc.at_xpath('/xmlns:project/xmlns:version').text
|
109
|
+
pom = Pom.new(@pom_path)
|
110
|
+
@plugin_name ||= pom.artifact_id
|
111
|
+
@version ||= pom.version
|
114
112
|
end
|
115
113
|
|
116
114
|
def git_version
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module Maestro
|
4
|
+
module Plugin
|
5
|
+
module RakeTasks
|
6
|
+
class Pom
|
7
|
+
|
8
|
+
def initialize(pom_path = "pom.xml")
|
9
|
+
pom = File.open(pom_path)
|
10
|
+
@doc = Nokogiri::XML(pom.read)
|
11
|
+
pom.close
|
12
|
+
end
|
13
|
+
|
14
|
+
def [](id)
|
15
|
+
xpath(@doc, id)
|
16
|
+
end
|
17
|
+
|
18
|
+
def artifact_id
|
19
|
+
@artifact_id ||= self[:artifactId]
|
20
|
+
end
|
21
|
+
|
22
|
+
def version
|
23
|
+
@version ||= self[:version]
|
24
|
+
end
|
25
|
+
|
26
|
+
def description
|
27
|
+
@description ||= self[:description]
|
28
|
+
end
|
29
|
+
|
30
|
+
def url
|
31
|
+
@url ||= self[:url]
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def xpath(doc, attribute)
|
37
|
+
item = doc.at_xpath("/xmlns:project/xmlns:#{attribute}")
|
38
|
+
item.nil? ? nil : item.text
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Maestro::Plugin::RakeTasks::Pom do
|
4
|
+
|
5
|
+
let(:pom) { File.expand_path("../../../../pom.xml", __FILE__) }
|
6
|
+
let(:subject) { Maestro::Plugin::RakeTasks::Pom.new(pom) }
|
7
|
+
|
8
|
+
its(:artifact_id) { should eq("maestro-test-plugin") }
|
9
|
+
its(:version) { should eq("X.Y.Z") }
|
10
|
+
its(:description) { should eq("a description") }
|
11
|
+
its(:url) { should eq("http://acme.com") }
|
12
|
+
|
13
|
+
it { subject[:artifactId].should eq("maestro-test-plugin") }
|
14
|
+
it { subject[:version].should eq("X.Y.Z") }
|
15
|
+
it { subject[:description].should eq("a description") }
|
16
|
+
it { subject[:url].should eq("http://acme.com") }
|
17
|
+
|
18
|
+
end
|
data/spec/pom.xml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maestro-plugin-rake-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Etienne Pelletier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -153,9 +153,11 @@ files:
|
|
153
153
|
- lib/maestro/plugin/rake_tasks.rb
|
154
154
|
- lib/maestro/plugin/rake_tasks/bundle_task.rb
|
155
155
|
- lib/maestro/plugin/rake_tasks/package_task.rb
|
156
|
+
- lib/maestro/plugin/rake_tasks/pom.rb
|
156
157
|
- lib/maestro/plugin/rake_tasks/version.rb
|
157
158
|
- maestro-plugin-rake-tasks.gemspec
|
158
159
|
- spec/maestro/plugin/rake_tasks/package_task_spec.rb
|
160
|
+
- spec/maestro/plugin/rake_tasks/pom_spec.rb
|
159
161
|
- spec/manifest-multi-task.template.json
|
160
162
|
- spec/manifest-single-task.template.json
|
161
163
|
- spec/manifest.template.json
|
@@ -189,6 +191,7 @@ test_files:
|
|
189
191
|
- features/package.feature
|
190
192
|
- features/support/env.rb
|
191
193
|
- spec/maestro/plugin/rake_tasks/package_task_spec.rb
|
194
|
+
- spec/maestro/plugin/rake_tasks/pom_spec.rb
|
192
195
|
- spec/manifest-multi-task.template.json
|
193
196
|
- spec/manifest-single-task.template.json
|
194
197
|
- spec/manifest.template.json
|