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: c0af21277c071e1a8a262b1872ba817a9252a27d
4
- data.tar.gz: a09c3a12397fb0a5604f20af8d40aa4d341ea93b
3
+ metadata.gz: 372d284ffbe4bf0d557b8f6d358ecb8be274f582
4
+ data.tar.gz: dae11a40a994b4fb5a68643be55668f612c796ae
5
5
  SHA512:
6
- metadata.gz: e6e9933bd901323e6618fffa51813f841870db2c1d087d2a9153684493e1397fa748cafc078aa127fc9d51485210326ce254711fd58434bf888dc30c0e171863
7
- data.tar.gz: 8d8eb2a4979ce98a3b49253cc9d871250e904aca0c4d2f5b7501c9933083069bc94825caafa9b3e0cb9eb91a498850c1d150b343fbf868c4f05660407ffbde4b
6
+ metadata.gz: f8461f93e317466fd59eb7faf8e20ca6802564acf9df566e41ffafac824456979dc146dffaae3a192bd572afb1e94e9923c7a89d7accdc1510755267ac216d81
7
+ data.tar.gz: 0f2f8bcba120406376da046a7486daf4df82eb52d3eb50b3efedc6de38353cf8013ca8f29be951a4b05052aeac3fe627c77efe3c503fdab57524012af28c8e36
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ test/version_tmp
12
12
  tmp
13
13
  manifest.json
14
14
  Gemfile.lock
15
+ /maestro-test-plugin-X.Y.Z.zip
@@ -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 = File.open(@pom_path)
110
- doc = Nokogiri::XML(pom.read)
111
- pom.close
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
@@ -1,7 +1,7 @@
1
1
  module Maestro
2
2
  module Plugin
3
3
  module RakeTasks
4
- VERSION = '1.0.9'
4
+ VERSION = '1.0.10'
5
5
  end
6
6
  end
7
7
  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
@@ -7,6 +7,8 @@
7
7
  <version>X.Y.Z</version>
8
8
  <name>maestro-test-plugin</name>
9
9
  <packaging>pom</packaging>
10
+ <description>a description</description>
11
+ <url>http://acme.com</url>
10
12
 
11
13
 
12
14
  </project>
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.9
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-09-25 00:00:00.000000000 Z
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