ffi 0.6.3-java → 1.0.0-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (4) hide show
  1. data/Rakefile +2 -7
  2. data/tasks/setup.rb +2 -1
  3. data/tasks/setup.rb.orig +292 -0
  4. metadata +32 -8
data/Rakefile CHANGED
@@ -1,9 +1,4 @@
1
- begin
2
- require 'bones'
3
- Bones.setup
4
- rescue LoadError
5
- load 'tasks/setup.rb'
6
- end
1
+ load 'tasks/setup.rb'
7
2
 
8
3
  task :default => 'gem:repackage'
9
4
 
@@ -11,7 +6,7 @@ PROJ.name = 'ffi'
11
6
  PROJ.authors = "JRuby Project"
12
7
  PROJ.email = "ruby-ffi@groups.google.com"
13
8
  PROJ.url = "http://wiki.github.com/ffi/ffi"
14
- PROJ.version = "0.6.3"
9
+ PROJ.version = "1.0.0"
15
10
  PROJ.rubyforge.name = 'ffi'
16
11
  PROJ.svn.path = 'ffi'
17
12
  PROJ.summary = "A Ruby foreign function interface"
@@ -163,7 +163,8 @@ HAVE_GIT = (Dir.entries(Dir.pwd).include?('.git') and
163
163
  # Add bones as a development dependency
164
164
  #
165
165
  if HAVE_BONES
166
- PROJ.gem.development_dependencies << ['bones', ">= #{Bones::VERSION}"]
166
+ bones_version = defined?(Bones::VERSION) ? Bones::VERSION : Bones.version
167
+ PROJ.gem.development_dependencies << ['bones', ">= #{bones_version}"]
167
168
  end
168
169
 
169
170
  # Reads a file at +path+ and spits out an array of the +paragraphs+
@@ -0,0 +1,292 @@
1
+
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'rake/clean'
5
+ require 'fileutils'
6
+ require 'ostruct'
7
+ require 'find'
8
+
9
+ class OpenStruct; undef :gem if defined? :gem; end
10
+
11
+ # TODO: make my own openstruct type object that includes descriptions
12
+ # TODO: use the descriptions to output help on the available bones options
13
+
14
+ PROJ = OpenStruct.new(
15
+ # Project Defaults
16
+ :name => nil,
17
+ :summary => nil,
18
+ :description => nil,
19
+ :changes => nil,
20
+ :authors => nil,
21
+ :email => nil,
22
+ :url => "\000",
23
+ :version => ENV['VERSION'] || '0.0.0',
24
+ :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
25
+ :release_name => ENV['RELEASE'],
26
+
27
+ # System Defaults
28
+ :ruby_opts => %w(-w),
29
+ :libs => [],
30
+ :history_file => 'History.txt',
31
+ :readme_file => 'README.txt',
32
+ :ignore_file => '.bnsignore',
33
+
34
+ # Announce
35
+ :ann => OpenStruct.new(
36
+ :file => 'announcement.txt',
37
+ :text => nil,
38
+ :paragraphs => [],
39
+ :email => {
40
+ :from => nil,
41
+ :to => %w(ruby-talk@ruby-lang.org),
42
+ :server => 'localhost',
43
+ :port => 25,
44
+ :domain => ENV['HOSTNAME'],
45
+ :acct => nil,
46
+ :passwd => nil,
47
+ :authtype => :plain
48
+ }
49
+ ),
50
+
51
+ # Gem Packaging
52
+ :gem => OpenStruct.new(
53
+ :dependencies => [],
54
+ :development_dependencies => [],
55
+ :executables => nil,
56
+ :extensions => FileList['ext/**/extconf.rb'],
57
+ :files => nil,
58
+ :need_tar => true,
59
+ :need_zip => false,
60
+ :extras => {}
61
+ ),
62
+
63
+ # File Annotations
64
+ :notes => OpenStruct.new(
65
+ :exclude => %w(^tasks/setup\.rb$),
66
+ :extensions => %w(.txt .rb .erb .rdoc) << '',
67
+ :tags => %w(FIXME OPTIMIZE TODO)
68
+ ),
69
+
70
+ # Rcov
71
+ :rcov => OpenStruct.new(
72
+ :dir => 'coverage',
73
+ :opts => %w[--sort coverage -T],
74
+ :threshold => 90.0,
75
+ :threshold_exact => false
76
+ ),
77
+
78
+ # Rdoc
79
+ :rdoc => OpenStruct.new(
80
+ :opts => [],
81
+ :include => %w(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$),
82
+ :exclude => %w(extconf\.rb$),
83
+ :main => nil,
84
+ :dir => 'doc',
85
+ :remote_dir => nil
86
+ ),
87
+
88
+ # Rubyforge
89
+ :rubyforge => OpenStruct.new(
90
+ :name => "\000"
91
+ ),
92
+
93
+ # Rspec
94
+ :spec => OpenStruct.new(
95
+ :files => FileList['spec/**/*_spec.rb'],
96
+ :opts => []
97
+ ),
98
+
99
+ # Subversion Repository
100
+ :svn => OpenStruct.new(
101
+ :root => nil,
102
+ :path => '',
103
+ :trunk => 'trunk',
104
+ :tags => 'tags',
105
+ :branches => 'branches'
106
+ ),
107
+
108
+ # Test::Unit
109
+ :test => OpenStruct.new(
110
+ :files => FileList['test/**/test_*.rb'],
111
+ :file => 'test/all.rb',
112
+ :opts => []
113
+ )
114
+ )
115
+
116
+ # Load the other rake files in the tasks folder
117
+ tasks_dir = File.expand_path(File.dirname(__FILE__))
118
+ post_load_fn = File.join(tasks_dir, 'post_load.rake')
119
+ rakefiles = Dir.glob(File.join(tasks_dir, '*.rake')).sort
120
+ rakefiles.unshift(rakefiles.delete(post_load_fn)).compact!
121
+ import(*rakefiles)
122
+
123
+ # Setup the project libraries
124
+ %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
125
+
126
+ # Setup some constants
127
+ DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
128
+
129
+ def quiet( &block )
130
+ io = [STDOUT.dup, STDERR.dup]
131
+ STDOUT.reopen DEV_NULL
132
+ STDERR.reopen DEV_NULL
133
+ block.call
134
+ ensure
135
+ STDOUT.reopen io.first
136
+ STDERR.reopen io.last
137
+ $stdout, $stderr = STDOUT, STDERR
138
+ end
139
+
140
+ DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
141
+ else 'diff' end unless defined? DIFF
142
+
143
+ SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
144
+ else '' end unless defined? SUDO
145
+
146
+ RCOV = "#{RUBY} -S rcov"
147
+ RDOC = "#{RUBY} -S rdoc"
148
+ GEM = "#{RUBY} -S gem"
149
+
150
+ %w(rcov spec/rake/spectask rubyforge bones facets/ansicode zentest).each do |lib|
151
+ begin
152
+ require lib
153
+ Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
154
+ rescue LoadError
155
+ Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
156
+ end
157
+ end
158
+ HAVE_SVN = (Dir.entries(Dir.pwd).include?('.svn') and
159
+ system("svn --version 2>&1 > #{DEV_NULL}"))
160
+ HAVE_GIT = (Dir.entries(Dir.pwd).include?('.git') and
161
+ system("git --version 2>&1 > #{DEV_NULL}"))
162
+
163
+ # Add bones as a development dependency
164
+ #
165
+ if HAVE_BONES
166
+ PROJ.gem.development_dependencies << ['bones', ">= #{Bones::VERSION}"]
167
+ end
168
+
169
+ # Reads a file at +path+ and spits out an array of the +paragraphs+
170
+ # specified.
171
+ #
172
+ # changes = paragraphs_of('History.txt', 0..1).join("\n\n")
173
+ # summary, *description = paragraphs_of('README.txt', 3, 3..8)
174
+ #
175
+ def paragraphs_of( path, *paragraphs )
176
+ title = String === paragraphs.first ? paragraphs.shift : nil
177
+ ary = File.read(path).delete("\r").split(/\n\n+/)
178
+
179
+ result = if title
180
+ tmp, matching = [], false
181
+ rgxp = %r/^=+\s*#{Regexp.escape(title)}/i
182
+ paragraphs << (0..-1) if paragraphs.empty?
183
+
184
+ ary.each do |val|
185
+ if val =~ rgxp
186
+ break if matching
187
+ matching = true
188
+ rgxp = %r/^=+/i
189
+ elsif matching
190
+ tmp << val
191
+ end
192
+ end
193
+ tmp
194
+ else ary end
195
+
196
+ result.values_at(*paragraphs)
197
+ end
198
+
199
+ # Adds the given gem _name_ to the current project's dependency list. An
200
+ # optional gem _version_ can be given. If omitted, the newest gem version
201
+ # will be used.
202
+ #
203
+ def depend_on( name, version = nil )
204
+ spec = Gem.source_index.find_name(name).last
205
+ version = spec.version.to_s if version.nil? and !spec.nil?
206
+
207
+ PROJ.gem.dependencies << case version
208
+ when nil; [name]
209
+ when %r/^\d/; [name, ">= #{version}"]
210
+ else [name, version] end
211
+ end
212
+
213
+ # Adds the given arguments to the include path if they are not already there
214
+ #
215
+ def ensure_in_path( *args )
216
+ args.each do |path|
217
+ path = File.expand_path(path)
218
+ $:.unshift(path) if test(?d, path) and not $:.include?(path)
219
+ end
220
+ end
221
+
222
+ # Find a rake task using the task name and remove any description text. This
223
+ # will prevent the task from being displayed in the list of available tasks.
224
+ #
225
+ def remove_desc_for_task( names )
226
+ Array(names).each do |task_name|
227
+ task = Rake.application.tasks.find {|t| t.name == task_name}
228
+ next if task.nil?
229
+ task.instance_variable_set :@comment, nil
230
+ end
231
+ end
232
+
233
+ # Change working directories to _dir_, call the _block_ of code, and then
234
+ # change back to the original working directory (the current directory when
235
+ # this method was called).
236
+ #
237
+ def in_directory( dir, &block )
238
+ curdir = pwd
239
+ begin
240
+ cd dir
241
+ return block.call
242
+ ensure
243
+ cd curdir
244
+ end
245
+ end
246
+
247
+ # Scans the current working directory and creates a list of files that are
248
+ # candidates to be in the manifest.
249
+ #
250
+ def manifest
251
+ files = []
252
+ exclude = PROJ.exclude.dup
253
+ comment = %r/^\s*#/
254
+
255
+ # process the ignore file and add the items there to the exclude list
256
+ if test(?f, PROJ.ignore_file)
257
+ ary = []
258
+ File.readlines(PROJ.ignore_file).each do |line|
259
+ next if line =~ comment
260
+ line.chomp!
261
+ line.strip!
262
+ next if line.nil? or line.empty?
263
+
264
+ glob = line =~ %r/\*\./ ? File.join('**', line) : line
265
+ Dir.glob(glob).each {|fn| ary << "^#{Regexp.escape(fn)}"}
266
+ end
267
+ exclude.concat ary
268
+ end
269
+
270
+ # generate a regular expression from the exclude list
271
+ exclude = Regexp.new(exclude.join('|'))
272
+
273
+ Find.find '.' do |path|
274
+ path.sub! %r/^(\.\/|\/)/o, ''
275
+ next unless test ?f, path
276
+ next if path =~ exclude
277
+ files << path
278
+ end
279
+ files.sort!
280
+ end
281
+
282
+ # We need a "valid" method thtat determines if a string is suitable for use
283
+ # in the gem specification.
284
+ #
285
+ class Object
286
+ def valid?
287
+ return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
288
+ return false
289
+ end
290
+ end
291
+
292
+ # EOF
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
5
10
  platform: java
6
11
  authors:
7
12
  - JRuby Project
@@ -9,10 +14,24 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-03-10 00:00:00 +10:00
17
+ date: 2010-11-30 00:00:00 +10:00
13
18
  default_executable:
14
- dependencies: []
15
-
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bones
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 3
30
+ - 4
31
+ - 7
32
+ version: 3.4.7
33
+ type: :development
34
+ version_requirements: *id001
16
35
  description: ""
17
36
  email: ruby-ffi@groups.google.com
18
37
  executables: []
@@ -36,11 +55,12 @@ files:
36
55
  - tasks/rdoc.rake
37
56
  - tasks/rubyforge.rake
38
57
  - tasks/setup.rb
58
+ - tasks/setup.rb.orig
39
59
  - tasks/spec.rake
40
60
  - tasks/svn.rake
41
61
  - tasks/test.rake
42
62
  - tasks/zentest.rake
43
- has_rdoc: false
63
+ has_rdoc: true
44
64
  homepage: http://wiki.github.com/ffi/ffi
45
65
  licenses: []
46
66
 
@@ -51,21 +71,25 @@ rdoc_options:
51
71
  require_paths:
52
72
  - lib
53
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
+ none: false
54
75
  requirements:
55
76
  - - ">="
56
77
  - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
57
80
  version: "0"
58
- version:
59
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
60
83
  requirements:
61
84
  - - ">="
62
85
  - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
63
88
  version: "0"
64
- version:
65
89
  requirements: []
66
90
 
67
91
  rubyforge_project: ffi
68
- rubygems_version: 1.3.5
92
+ rubygems_version: 1.3.7
69
93
  signing_key:
70
94
  specification_version: 3
71
95
  summary: A Ruby foreign function interface