naether 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/lib/naether.rb CHANGED
@@ -12,7 +12,7 @@ class Naether
12
12
 
13
13
  # Naether jar path will default to packaged in the gem
14
14
  JAR_LIB = "#{File.dirname(__FILE__)}/.."
15
- JAR_PATH = "#{JAR_LIB}/naether-0.5.1.jar" #XXX: hardcoded, should be based on VERSION file
15
+ JAR_PATH = "#{JAR_LIB}/naether-0.5.2.jar" #XXX: hardcoded, should be based on VERSION file
16
16
 
17
17
  class << self
18
18
 
@@ -208,26 +208,13 @@ class Naether
208
208
  @resolver.deployArtifact(@instance)
209
209
  end
210
210
 
211
- # Install artifact to local repo
212
- def install_artifact( notation, file_path, opts = {} )
213
- if Naether.platform == 'java'
214
- @instance = com.slackworks.naether.deploy.DeployArtifact.new
215
- else
216
- deployArtifactClass = Rjb::import('com.slackworks.naether.deploy.DeployArtifact')
217
- @instance = deployArtifactClass.new
218
- end
219
-
220
- @instance.setNotation( notation )
221
- @instance.setFilePath( file_path )
222
- if opts[:pom_path]
223
- @instance.setPomPath( opts[:pom_path] )
224
- end
225
-
226
- @resolver.installArtifact(@instance)
211
+ # Install artifact or pom to local repo, must specify pom_path and/or jar_path
212
+ def install( notation, pom_path =nil, jar_path = nil )
213
+ @resolver.install(notation, pom_path, jar_path)
227
214
  end
228
215
 
229
216
  def load_pom( file_path )
230
- @project_instance = Naether::Java.create_maven_project( file_path )
217
+ @project_instance = Naether::Java.create("com.slackworks.naether.maven.Project", file_path )
231
218
  end
232
219
 
233
220
  def pom_dependencies( file_path=nil, scopes = nil)
@@ -264,7 +251,7 @@ class Naether
264
251
  #
265
252
  # loads all resolved dependencies into pom
266
253
  def write_pom( notation, file_path )
267
- @project_instance = Naether::Java.create_maven_project
254
+ @project_instance = Naether::Java.create("com.slackworks.naether.maven.Project")
268
255
  @project_instance.setProjectNotation( notation )
269
256
 
270
257
  dependencies().each do |notation|
@@ -160,7 +160,7 @@ class Naether
160
160
  jar = jars.select { |x| x =~ /#{name}/ }
161
161
  if jar.size > 0
162
162
  jar = jar[0]
163
- @naether.install_artifact( dep, jar )
163
+ @naether.install( dep, nil, jar )
164
164
  else
165
165
  puts "Could not find jar for #{dep}"
166
166
  end
data/lib/naether/java.rb CHANGED
@@ -45,19 +45,14 @@ class Naether
45
45
  end
46
46
  end
47
47
 
48
- def self.create_maven_project(path = nil)
49
- projectClass = nil
48
+ def self.create( java_class, *args )
50
49
  if Naether.platform == 'java'
51
- projectClass = com.slackworks.naether.maven.Project
50
+ java_class = eval(java_class)
52
51
  else
53
- projectClass = Rjb::import('com.slackworks.naether.maven.Project')
52
+ java_class = Rjb::import(java_class)
54
53
  end
55
54
 
56
- unless path.nil?
57
- projectClass.new( path )
58
- else
59
- projectClass.new
60
- end
55
+ java_class.new( *args )
61
56
  end
62
57
 
63
58
  def self.convert_to_ruby_array( java_array, to_string = false )
@@ -126,7 +121,7 @@ class Naether
126
121
  end
127
122
 
128
123
  def load_jars(jars)
129
- loaded_jars = []
124
+ loadable_jars = []
130
125
  unless jars.is_a?( Array )
131
126
  jars = [jars]
132
127
  end
@@ -134,16 +129,16 @@ class Naether
134
129
  jars.each do |jar|
135
130
  expanded_jar = File.expand_path(jar)
136
131
  if !@loaded_jars.include? expanded_jar
137
- loaded_jars << expanded_jar
132
+ loadable_jars << expanded_jar
138
133
  @loaded_jars << expanded_jar
139
134
  end
140
135
  end
141
136
 
142
- unless loaded_jars.empty?
143
- Rjb::add_jar( loaded_jars )
137
+ unless loadable_jars.empty?
138
+ Rjb::add_jar( loadable_jars )
144
139
  end
145
140
 
146
- loaded_jars
141
+ loadable_jars
147
142
  end
148
143
  end
149
144
  end
data/naether-0.5.2.jar ADDED
Binary file
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <groupId>com.slackworks</groupId>
6
6
  <artifactId>naether</artifactId>
7
- <version>0.5.1</version>
7
+ <version>0.5.2</version>
8
8
  <packaging>jar</packaging>
9
9
  <name>naether</name>
10
10
  <url>https://github.com/mguymon/naether</url>
@@ -125,27 +125,28 @@
125
125
  </dependencies>
126
126
 
127
127
  <build>
128
- <plugins>
129
- <plugin>
130
- <groupId>org.apache.maven.plugins</groupId>
131
- <artifactId>maven-dependency-plugin</artifactId>
132
- <executions>
133
- <execution>
134
- <id>copy-dependencies</id>
135
- <phase>package</phase>
136
- <goals>
137
- <goal>copy-dependencies</goal>
138
- </goals>
139
- <configuration>
140
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
141
- <overWriteReleases>false</overWriteReleases>
142
- <overWriteSnapshots>false</overWriteSnapshots>
143
- <overWriteIfNewer>true</overWriteIfNewer>
144
- </configuration>
145
- </execution>
146
- </executions>
147
- </plugin>
148
- </plugins>
128
+
129
+ <plugins>
130
+ <plugin>
131
+ <groupId>org.apache.maven.plugins</groupId>
132
+ <artifactId>maven-dependency-plugin</artifactId>
133
+ <executions>
134
+ <execution>
135
+ <id>copy-dependencies</id>
136
+ <phase>package</phase>
137
+ <goals>
138
+ <goal>copy-dependencies</goal>
139
+ </goals>
140
+ <configuration>
141
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
142
+ <overWriteReleases>false</overWriteReleases>
143
+ <overWriteSnapshots>false</overWriteSnapshots>
144
+ <overWriteIfNewer>true</overWriteIfNewer>
145
+ </configuration>
146
+ </execution>
147
+ </executions>
148
+ </plugin>
149
+ </plugins>
149
150
  </build>
150
151
 
151
152
  <reporting>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Guymon
@@ -15,27 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-21 00:00:00 -05:00
19
- default_executable:
18
+ date: 2011-12-08 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
21
  requirement: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
26
24
  - - "="
27
25
  - !ruby/object:Gem::Version
28
- hash: 29
26
+ hash: 21
29
27
  segments:
30
28
  - 1
31
29
  - 3
32
- - 3
33
- version: 1.3.3
34
- name: rjb
30
+ - 7
31
+ version: 1.3.7
35
32
  version_requirements: *id001
33
+ name: rjb
36
34
  prerelease: false
35
+ type: :runtime
37
36
  - !ruby/object:Gem::Dependency
38
- type: :development
39
37
  requirement: &id002 !ruby/object:Gem::Requirement
40
38
  none: false
41
39
  requirements:
@@ -47,11 +45,11 @@ dependencies:
47
45
  - 1
48
46
  - 0
49
47
  version: 2.1.0
50
- name: rspec
51
48
  version_requirements: *id002
49
+ name: rspec
52
50
  prerelease: false
53
- - !ruby/object:Gem::Dependency
54
51
  type: :development
52
+ - !ruby/object:Gem::Dependency
55
53
  requirement: &id003 !ruby/object:Gem::Requirement
56
54
  none: false
57
55
  requirements:
@@ -63,11 +61,11 @@ dependencies:
63
61
  - 0
64
62
  - 0
65
63
  version: 1.0.0
66
- name: bundler
67
64
  version_requirements: *id003
65
+ name: bundler
68
66
  prerelease: false
69
- - !ruby/object:Gem::Dependency
70
67
  type: :development
68
+ - !ruby/object:Gem::Dependency
71
69
  requirement: &id004 !ruby/object:Gem::Requirement
72
70
  none: false
73
71
  requirements:
@@ -79,9 +77,10 @@ dependencies:
79
77
  - 5
80
78
  - 2
81
79
  version: 1.5.2
82
- name: jeweler
83
80
  version_requirements: *id004
81
+ name: jeweler
84
82
  prerelease: false
83
+ type: :development
85
84
  description: Java dependency resolver using Maven's Aether
86
85
  email: michael.guymon@gmail.com
87
86
  executables: []
@@ -99,9 +98,8 @@ files:
99
98
  - lib/naether.rb
100
99
  - lib/naether/bootstrap.rb
101
100
  - lib/naether/java.rb
102
- - naether-0.5.1.jar
101
+ - naether-0.5.2.jar
103
102
  - pom.xml
104
- has_rdoc: true
105
103
  homepage: http://github.com/mguymon/naether
106
104
  licenses:
107
105
  - Apache
@@ -131,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
129
  requirements: []
132
130
 
133
131
  rubyforge_project: naether
134
- rubygems_version: 1.6.2
132
+ rubygems_version: 1.8.10
135
133
  signing_key:
136
134
  specification_version: 3
137
135
  summary: Java dependency resolver using Maven's Aether
data/naether-0.5.1.jar DELETED
Binary file