Skip to content

Commit

Permalink
introduces bundler, removes jeweler
Browse files Browse the repository at this point in the history
converts to bundler generate gem
  • Loading branch information
thomasjachmann committed May 28, 2011
1 parent b81aec7 commit 87c7b10
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 141 deletions.
3 changes: 0 additions & 3 deletions .document

This file was deleted.

6 changes: 4 additions & 2 deletions .gitignore
@@ -1,2 +1,4 @@
rdoc *.gem
pkg .bundle
Gemfile.lock
pkg/*
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in launchpad.gemspec
gemspec
51 changes: 1 addition & 50 deletions Rakefile
@@ -1,28 +1,4 @@
require 'rubygems' require 'bundler/gem_tasks'
require 'rake'

require File.join(File.dirname(__FILE__), 'lib', 'launchpad', 'version')

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = 'launchpad'
gem.summary = 'A gem for accessing novation\'s launchpad programmatically and easily.'
gem.description = 'This gem provides an interface to access novation\'s launchpad programmatically. LEDs can be lighted and button presses can be evaluated using launchpad\'s MIDI input/output.'
gem.email = 'self@thomasjachmann.com'
gem.homepage = 'http://github.com/thomasjachmann/launchpad'
gem.version = Launchpad::VERSION
gem.authors = ['Thomas Jachmann']
gem.has_rdoc = true
gem.add_dependency('portmidi', '>= 0.0.6')
gem.add_development_dependency('shoulda', '>= 0')
gem.add_development_dependency('mocha')
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts 'Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler'
end


require 'rake/testtask' require 'rake/testtask'
Rake::TestTask.new(:test) do |test| Rake::TestTask.new(:test) do |test|
Expand All @@ -31,29 +7,4 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true test.verbose = true
end end


begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort 'RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov'
end
end

task :test => :check_dependencies

task :default => :test task :default => :test

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "launchpad #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
97 changes: 21 additions & 76 deletions launchpad.gemspec
@@ -1,83 +1,28 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "launchpad/version"


Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{launchpad} s.name = "launchpad"
s.version = "0.2.2" s.version = Launchpad::VERSION

s.authors = ["Thomas Jachmann"]
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.email = ["self@thomasjachmann.com"]
s.authors = ["Thomas Jachmann"] s.homepage = "https://github.com/thomasjachmann/launchpad"
s.date = %q{2010-02-24} s.summary = %q{A gem for accessing novation's launchpad programmatically and easily.}
s.description = %q{This gem provides an interface to access novation's launchpad programmatically. LEDs can be lighted and button presses can be evaluated using launchpad's MIDI input/output.} s.description = %q{This gem provides an interface to access novation's launchpad programmatically. LEDs can be lighted and button presses can be evaluated using launchpad's MIDI input/output.}
s.email = %q{tom.j@gmx.net}
s.extra_rdoc_files = [
"LICENSE",
"README.rdoc"
]
s.files = [
".document",
".gitignore",
"LICENSE",
"README.rdoc",
"Rakefile",
"examples/color_picker.rb",
"examples/colors.rb",
"examples/doodle.rb",
"examples/double_buffering.rb",
"examples/drawing_board.rb",
"examples/feedback.rb",
"examples/reset.rb",
"examples/setup.rb",
"experiments/wandering_dot.rb",
"launchpad.gemspec",
"lib/launchpad.rb",
"lib/launchpad/device.rb",
"lib/launchpad/errors.rb",
"lib/launchpad/interaction.rb",
"lib/launchpad/midi_codes.rb",
"lib/launchpad/version.rb",
"test/helper.rb",
"test/test_device.rb",
"test/test_interaction.rb"
]
s.homepage = %q{http://github.com/thomasjachmann/launchpad}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.5}
s.summary = %q{A gem for accessing novation's launchpad programmatically and easily.}
s.test_files = [
"test/helper.rb",
"test/test_device.rb",
"test/test_interaction.rb",
"examples/color_picker.rb",
"examples/colors.rb",
"examples/doodle.rb",
"examples/double_buffering.rb",
"examples/drawing_board.rb",
"examples/feedback.rb",
"examples/reset.rb",
"examples/setup.rb"
]


if s.respond_to? :specification_version then s.rubyforge_project = "launchpad"
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3


if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then s.add_dependency "portmidi", ">= 0.0.6"
s.add_runtime_dependency(%q<portmidi>, [">= 0.0.6"]) s.add_dependency "ffi"
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"]) s.add_development_dependency "shoulda"
s.add_development_dependency(%q<mocha>, [">= 0"]) s.add_development_dependency "mocha"
else s.add_development_dependency "redgreen"
s.add_dependency(%q<portmidi>, [">= 0.0.6"])
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
end
else
s.add_dependency(%q<portmidi>, [">= 0.0.6"])
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
end
end


# s.has_rdoc = true

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
end
11 changes: 3 additions & 8 deletions test/helper.rb
@@ -1,16 +1,11 @@
require 'rubygems' require 'rubygems'
require 'bundler/setup'

require 'test/unit' require 'test/unit'
require 'shoulda' require 'shoulda'
require 'mocha' require 'mocha'
require 'redgreen' if ENV['TM_FILENAME'].nil?


begin
require 'redgreen' if ENV['TM_FILENAME'].nil?
rescue LoadError
# ignore - just for colorization
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'launchpad' require 'launchpad'


class Test::Unit::TestCase class Test::Unit::TestCase
Expand Down
4 changes: 2 additions & 2 deletions test/test_interaction.rb
Expand Up @@ -90,15 +90,15 @@ class TestInteraction < Test::Unit::TestCase
should 'start a new thread and block in blocking mode' do should 'start a new thread and block in blocking mode' do
t = Thread.new {} t = Thread.new {}
Thread.expects(:new).returns(t) Thread.expects(:new).returns(t)
t.expects(:join) t.expects(:join).twice # once from start, once from test's teardown
@interaction.start @interaction.start
end end


# this is kinda greybox tested, since I couldn't come up with another way to test thread handling [thomas, 2010-01-24] # this is kinda greybox tested, since I couldn't come up with another way to test thread handling [thomas, 2010-01-24]
should 'start a new thread and return in detached mode' do should 'start a new thread and return in detached mode' do
t = Thread.new {} t = Thread.new {}
Thread.expects(:new).returns(t) Thread.expects(:new).returns(t)
t.expects(:join).never t.expects(:join).once # once from test's teardown
@interaction.start(:detached => true) @interaction.start(:detached => true)
end end


Expand Down

0 comments on commit 87c7b10

Please sign in to comment.