ffi-k8055 0.5.0

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.
@@ -0,0 +1,27 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ if HAVE_BONES
4
+
5
+ desc "Enumerate all annotations"
6
+ task :notes do |t|
7
+ id = if t.application.top_level_tasks.length > 1
8
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
9
+ end
10
+ Bones::AnnotationExtractor.enumerate(PROJ, PROJ.notes.tags.join('|'), id, :tag => true)
11
+ end
12
+
13
+ namespace :notes do
14
+ PROJ.notes.tags.each do |tag|
15
+ desc "Enumerate all #{tag} annotations"
16
+ task tag.downcase.to_sym do |t|
17
+ id = if t.application.top_level_tasks.length > 1
18
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
19
+ end
20
+ Bones::AnnotationExtractor.enumerate(PROJ, tag, id)
21
+ end
22
+ end
23
+ end
24
+
25
+ end # if HAVE_BONES
26
+
27
+ # EOF
@@ -0,0 +1,35 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ # This file does not define any rake tasks. It is used to load some project
4
+ # settings if they are not defined by the user.
5
+
6
+ PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
7
+ "^#{Regexp.escape(PROJ.ignore_file)}$",
8
+ "^#{Regexp.escape(PROJ.rdoc.dir)}/",
9
+ "^#{Regexp.escape(PROJ.rcov.dir)}/"]
10
+
11
+ flatten_arrays = lambda do |this,os|
12
+ os.instance_variable_get(:@table).each do |key,val|
13
+ next if key == :dependencies \
14
+ or key == :development_dependencies
15
+ case val
16
+ when Array; val.flatten!
17
+ when OpenStruct; this.call(this,val)
18
+ end
19
+ end
20
+ end
21
+ flatten_arrays.call(flatten_arrays,PROJ)
22
+
23
+ PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
24
+
25
+ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
26
+
27
+ PROJ.summary ||= PROJ.description.split('.').first
28
+
29
+ PROJ.gem.files ||= manifest
30
+
31
+ PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
32
+
33
+ PROJ.rdoc.main ||= PROJ.readme_file
34
+
35
+ # EOF
@@ -0,0 +1,46 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ require 'rake/rdoctask'
4
+
5
+ namespace :doc do
6
+ desc 'Generate RDoc documentation'
7
+ Rake::RDocTask.new do |rd|
8
+ rdoc = PROJ.rdoc
9
+ rd.main = rdoc.main
10
+ rd.rdoc_dir = rdoc.dir
11
+
12
+ incl = Regexp.new(rdoc.include.join('|'))
13
+ excl = Regexp.new(rdoc.exclude.join('|'))
14
+ files = PROJ.gem.files.find_all do |fn|
15
+ case fn
16
+ when excl; false
17
+ when incl; true
18
+ else false end
19
+ end
20
+ rd.rdoc_files.push(*files)
21
+ title = "#{PROJ.name}-#{PROJ.version} Documentation"
22
+ rf_name = PROJ.rubyforge.name
23
+ title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != title
24
+ rd.options << "-t #{title}"
25
+ rd.options.concat(rdoc.opts)
26
+ end
27
+
28
+ desc 'Generate ri locally for testing'
29
+ task :ri => :clobber_ri do
30
+ sh "#{RDOC} --ri -o ri ."
31
+ end
32
+
33
+ task :clobber_ri do
34
+ rm_r 'ri' rescue nil
35
+ end
36
+ end # namespace :doc
37
+
38
+ desc 'Alias to doc:rdoc'
39
+ task :doc => 'doc:rdoc'
40
+
41
+ desc 'Remove all build products'
42
+ task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
43
+
44
+ remove_desc_for_task %w(doc:clobber_rdoc)
45
+
46
+ # EOF
@@ -0,0 +1,54 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ if PROJ.rubyforge.name.valid? && HAVE_RUBYFORGE
4
+
5
+ require 'rubyforge'
6
+ require 'rake/contrib/sshpublisher'
7
+
8
+ namespace :gem do
9
+ desc 'Package and upload to RubyForge'
10
+ task :release => [:clobber, 'gem'] do |t|
11
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
12
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
13
+ pkg = "pkg/#{PROJ.gem._spec.full_name}"
14
+
15
+ if $DEBUG then
16
+ puts "release_id = rf.add_release #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, #{PROJ.version.inspect}, \"#{pkg}.tgz\""
17
+ puts "rf.add_file #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, release_id, \"#{pkg}.gem\""
18
+ end
19
+
20
+ rf = RubyForge.new
21
+ rf.configure rescue nil
22
+ puts 'Logging in'
23
+ rf.login
24
+
25
+ c = rf.userconfig
26
+ c['release_notes'] = PROJ.description if PROJ.description
27
+ c['release_changes'] = PROJ.changes if PROJ.changes
28
+ c['preformatted'] = true
29
+
30
+ files = Dir.glob("#{pkg}*.*")
31
+
32
+ puts "Releasing #{PROJ.name} v. #{PROJ.version}"
33
+ rf.add_release PROJ.rubyforge.name, PROJ.name, PROJ.version, *files
34
+ end
35
+ end # namespace :gem
36
+
37
+
38
+ namespace :doc do
39
+ desc "Publish RDoc to RubyForge"
40
+ task :release => %w(doc:clobber_rdoc doc:rdoc) do
41
+ config = YAML.load(File.read(File.expand_path('~/.rubyforge/user-config.yml')))
42
+
43
+ host = "#{config['username']}@rubyforge.org"
44
+ remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge.name}/"
45
+ remote_dir << PROJ.rdoc.remote_dir if PROJ.rdoc.remote_dir
46
+ local_dir = PROJ.rdoc.dir
47
+
48
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
49
+ end
50
+ end # namespace :doc
51
+
52
+ end # if HAVE_RUBYFORGE
53
+
54
+ # EOF
@@ -0,0 +1,129 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ require 'rubygems'
4
+ require 'rake'
5
+ require 'rake/clean'
6
+ require 'ostruct'
7
+
8
+ class OpenStruct; undef :gem; end
9
+
10
+ # TODO: make my own openstruct type object that includes descriptions
11
+ # TODO: use the descriptions to output help on the available bones options
12
+
13
+ PROJ = OpenStruct.new(
14
+ # Project Defaults
15
+ :name => nil,
16
+ :summary => nil,
17
+ :description => nil,
18
+ :changes => nil,
19
+ :authors => nil,
20
+ :email => nil,
21
+ :url => "\000",
22
+ :version => ENV['VERSION'] || '0.0.0',
23
+ :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
24
+ :release_name => ENV['RELEASE'],
25
+
26
+ # System Defaults
27
+ :ruby_opts => %w(-w),
28
+ :libs => [],
29
+ :history_file => 'Changelog',
30
+ :readme_file => 'README.rdoc',
31
+ :ignore_file => '.bnsignore',
32
+
33
+ # Announce
34
+ :ann => OpenStruct.new(
35
+ :file => 'announcement.txt',
36
+ :text => nil,
37
+ :paragraphs => [],
38
+ :email => {
39
+ :from => nil,
40
+ :to => %w(ruby-talk@ruby-lang.org),
41
+ :server => 'localhost',
42
+ :port => 25,
43
+ :domain => ENV['HOSTNAME'],
44
+ :acct => nil,
45
+ :passwd => nil,
46
+ :authtype => :plain,
47
+ :tls => true,
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 -x lib/rcov],
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
+ load './tasks/constants.rb'
127
+ load './tasks/helpers.rb'
128
+
129
+ # EOF
@@ -0,0 +1,44 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ #if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
4
+ require 'rspec/core/rake_task'
5
+ #
6
+ namespace :spec do
7
+
8
+ desc 'Run all specs with basic output'
9
+ RSpec::Core::RakeTask.new(:run) do |t,args|
10
+ t.ruby_opts = PROJ.ruby_opts
11
+ t.rspec_opts = PROJ.spec.opts
12
+ t.pattern = ENV['pattern'] if ENV['pattern']
13
+ end
14
+
15
+ desc 'Run all specs with text output'
16
+ RSpec::Core::RakeTask.new(:doc) do |t|
17
+ t.ruby_opts = PROJ.ruby_opts
18
+ t.rspec_opts = PROJ.spec.opts + ['-fs' ]
19
+ t.pattern = ENV['pattern'] if ENV['pattern']
20
+ end
21
+
22
+ desc 'Run all specs with html output'
23
+ RSpec::Core::RakeTask.new(:html) do |t|
24
+ t.ruby_opts = PROJ.ruby_opts
25
+ t.rspec_opts = PROJ.spec.opts + ['-fh' ]
26
+ t.pattern = ENV['pattern'] if ENV['pattern']
27
+ end
28
+
29
+ if HAVE_RCOV
30
+ desc 'Run all specs with RCov'
31
+ RSpec::Core::RakeTask.new(:rcov) do |t|
32
+ t.ruby_opts = PROJ.ruby_opts
33
+ t.rspec_opts = PROJ.spec.opts
34
+ t.rcov = true
35
+ t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
36
+ end
37
+ end
38
+
39
+ end # namespace :spec
40
+
41
+ desc 'Alias to spec:run'
42
+ task :spec => 'spec:run'
43
+
44
+ # EOF
@@ -0,0 +1,48 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ if HAVE_SVN
4
+
5
+ unless PROJ.svn.root
6
+ info = %x/svn info ./
7
+ m = %r/^Repository Root:\s+(.*)$/.match(info)
8
+ PROJ.svn.root = (m.nil? ? '' : m[1])
9
+ end
10
+ PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
11
+
12
+ namespace :svn do
13
+
14
+ # A prerequisites task that all other tasks depend upon
15
+ task :prereqs
16
+
17
+ desc 'Show tags from the SVN repository'
18
+ task :show_tags => 'svn:prereqs' do |t|
19
+ tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
20
+ tags.gsub!(%r/\/$/, '')
21
+ tags = tags.split("\n").sort {|a,b| b <=> a}
22
+ puts tags
23
+ end
24
+
25
+ desc 'Create a new tag in the SVN repository'
26
+ task :create_tag => 'svn:prereqs' do |t|
27
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
28
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
29
+
30
+ svn = PROJ.svn
31
+ trunk = File.join(svn.root, svn.trunk)
32
+ tag = "%s-%s" % [PROJ.name, PROJ.version]
33
+ tag = File.join(svn.root, svn.tags, tag)
34
+ msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
35
+
36
+ puts "Creating SVN tag '#{tag}'"
37
+ unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
38
+ abort "Tag creation failed"
39
+ end
40
+ end
41
+
42
+ end # namespace :svn
43
+
44
+ task 'gem:release' => 'svn:create_tag'
45
+
46
+ end # if PROJ.svn.path
47
+
48
+ # EOF
@@ -0,0 +1,41 @@
1
+ # -*- coding: UTF-8 -*-
2
+ #
3
+ if test(?e, PROJ.test.file) or not PROJ.test.files.to_a.empty?
4
+ require 'rake/testtask'
5
+
6
+ namespace :test do
7
+
8
+ Rake::TestTask.new(:run) do |t|
9
+ t.libs = PROJ.libs
10
+ t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
11
+ else PROJ.test.files end
12
+ t.ruby_opts += PROJ.ruby_opts
13
+ t.ruby_opts += PROJ.test.opts
14
+ end
15
+
16
+ if HAVE_RCOV
17
+ desc 'Run rcov on the unit tests'
18
+ task :rcov => :clobber_rcov do
19
+ opts = PROJ.rcov.opts.dup << '-o' << PROJ.rcov.dir
20
+ opts = opts.join(' ')
21
+ files = if test(?f, PROJ.test.file) then [PROJ.test.file]
22
+ else PROJ.test.files end
23
+ files = files.join(' ')
24
+ sh "#{RCOV} #{files} #{opts}"
25
+ end
26
+
27
+ task :clobber_rcov do
28
+ rm_r 'coverage' rescue nil
29
+ end
30
+ end
31
+
32
+ end # namespace :test
33
+
34
+ desc 'Alias to test:run'
35
+ task :test => 'test:run'
36
+
37
+ task :clobber => 'test:clobber_rcov' if HAVE_RCOV
38
+
39
+ end
40
+
41
+ # EOF
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ffi-k8055
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.5.0
6
+ platform: ruby
7
+ authors:
8
+ - "J\xC3\xA9r\xC3\xA9my Zurcher"
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-06 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ffi
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.0.2
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: rake
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.8.7
35
+ type: :development
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: bones
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 3.7.0
46
+ type: :development
47
+ version_requirements: *id003
48
+ description: |-
49
+ A ruby-ffi binding to libk8055, an open source library to access Velleman's k8055 USB board.
50
+ This is part of k8055[https://github.com/jeremyz/k8055]
51
+ email: jeremy@asynk.ch
52
+ executables: []
53
+
54
+ extensions: []
55
+
56
+ extra_rdoc_files:
57
+ - README.rdoc
58
+ files:
59
+ - Changelog
60
+ - MIT-LICENSE
61
+ - README.rdoc
62
+ - Rakefile
63
+ - lib/k8055.rb
64
+ - spec/k8055_spec.rb
65
+ - tasks/ann.rake
66
+ - tasks/constants.rb
67
+ - tasks/ffi.rake
68
+ - tasks/gem.rake
69
+ - tasks/git.rake
70
+ - tasks/helpers.rb
71
+ - tasks/notes.rake
72
+ - tasks/post_load.rake
73
+ - tasks/rdoc.rake
74
+ - tasks/rubyforge.rake
75
+ - tasks/setup.rb
76
+ - tasks/spec.rake
77
+ - tasks/svn.rake
78
+ - tasks/test.rake
79
+ homepage: https://github.com/jeremyz/k8055
80
+ licenses: []
81
+
82
+ post_install_message:
83
+ rdoc_options:
84
+ - -x
85
+ - ext
86
+ - --main
87
+ - README.rdoc
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: "0"
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: "0"
102
+ requirements: []
103
+
104
+ rubyforge_project: none
105
+ rubygems_version: 1.8.4
106
+ signing_key:
107
+ specification_version: 3
108
+ summary: A ruby-ffi binding to libk8055, an open source library to access Velleman's k8055 USB board
109
+ test_files: []
110
+