| Module | Raven |
| In: |
lib/raven.rb
lib/raven/deps_tasks.rb lib/raven/java_tasks.rb lib/raven/repo_builder.rb lib/raven/search_install.rb |
| CP_SEP | = | PLATFORM['mswin'] ? ';' : ':' |
| DIR_EXCL | = | ['..', '.'] |
# File lib/raven/repo_builder.rb, line 290
290: def self.create_gemspec(artifact)
291: spec = Gem::Specification.new do |s|
292: s.platform = Gem::Platform::JAVA
293: s.summary = "Raven wrapped library #{artifact.artifactId} from project #{artifact.groupId}."
294: s.name = "#{artifact.groupId}-#{artifact.artifactId}"
295: s.version = artifact.versionId
296: s.requirements << 'none'
297: s.require_path = 'ext'
298: s.autorequire = 'rake'
299: s.files = Dir.glob("{ext}/**/*")
300: end
301: end
# File lib/raven/repo_builder.rb, line 283
283: def self.dir_each(path)
284: Dir.foreach(path) do |elmt|
285: next if DIR_EXCL.include?(elmt)
286: yield(elmt)
287: end
288: end
# File lib/raven/repo_builder.rb, line 146
146: def self.install_remote_gem(artifact, http, base_url, overwrite=true)
147: gemname = "#{artifact.groupId}-#{artifact.artifactId}-#{artifact.versionId}-java.gem"
148: if !File.exist?(gemname) || overwrite
149: Raven.with(artifact, 'ext', http, base_url) do
150: # The fileset is computed when gemspec is created, file must be there
151: gemspec = Raven.create_gemspec(artifact)
152: Gem::Builder.new(gemspec).build
153: end
154: end
155: gemname
156: end
# File lib/raven/repo_builder.rb, line 158
158: def self.with(artifact, subdir, http, base_url)
159: response = http.get(base_url + artifact.path, nil)
160: file = File.new(subdir + "/#{artifact.artifactId}-#{artifact.versionId}.jar", 'wb')
161: file.write(response.body)
162: file.close
163: yield
164: File.delete(subdir + "/#{artifact.artifactId}-#{artifact.versionId}.jar")
165: end