Browse files

Go minimal, walking away from Jeweler.

  • Loading branch information...
1 parent 757ad74 commit 34fc02ccc09ac5689bb6eda21a2088d4f6f46d3b @kenn committed May 26, 2012
Showing with 27 additions and 84 deletions.
  1. +2 −4 .gitignore
  2. +2 −7 Gemfile
  3. 0 LICENSE.txt → LICENSE
  4. +4 −17 Rakefile
  5. +0 −1 VERSION
  6. +17 −53 bitwise.gemspec
  7. +2 −2 ext/bitwise/bitwise.c
  8. BIN lib/bitwise/bitwise.bundle
View
6 .gitignore
@@ -1,5 +1,3 @@
-*.gem
-*.bundle
Gemfile.lock
-pkg/*
-tmp/*
+pkg
+tmp
View
9 Gemfile
@@ -1,8 +1,3 @@
-source "http://rubygems.org"
+source 'http://rubygems.org'
-group :development do
- gem "rspec"
- gem "bundler"
- gem "jeweler"
- gem "rake-compiler"
-end
+gemspec
View
0 LICENSE.txt → LICENSE
File renamed without changes.
View
21 Rakefile
@@ -1,30 +1,17 @@
-# require "bundler/gem_tasks"
-# require 'rubygems'
-# require 'bundler'
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
+# Compile
require "rake/extensiontask"
Rake::ExtensionTask.new("bitwise") do |extension|
extension.lib_dir = "lib/bitwise"
end
+# RSpec
require 'rspec/core/rake_task'
task :default => :spec
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ["--color"]
t.fail_on_error = false
end
Rake::Task[:spec].prerequisites << :compile
-
-require 'jeweler'
-Jeweler::Tasks.new do |gem|
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
- gem.name = "bitwise"
- gem.homepage = "http://github.com/kenn/bitwise"
- gem.license = "MIT"
- gem.summary = %Q{Fast, memory efficient bitwise operations on large binary strings}
- gem.description = %Q{Fast, memory efficient bitwise operations on large binary strings}
- gem.email = "kenn.ejima@gmail.com"
- gem.authors = ["Kenn Ejima"]
- # dependencies defined in Gemfile
-end
-Jeweler::RubygemsDotOrgTasks.new
View
1 VERSION
@@ -1 +0,0 @@
-0.5.0
View
70 bitwise.gemspec
@@ -1,59 +1,23 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
-Gem::Specification.new do |s|
- s.name = "bitwise"
- s.version = "0.5.0"
+Gem::Specification.new do |gem|
+ gem.authors = ["Kenn Ejima"]
+ gem.email = ["kenn.ejima@gmail.com"]
+ gem.description = %q{Fast, memory efficient bitwise operations on large binary strings}
+ gem.summary = %q{Fast, memory efficient bitwise operations on large binary strings}
+ gem.homepage = "http://github.com/kenn/bitwise"
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Kenn Ejima"]
- s.date = "2012-02-28"
- s.description = "Fast, memory efficient bitwise operations on large binary strings"
- s.email = "kenn.ejima@gmail.com"
- s.extensions = ["ext/bitwise/extconf.rb"]
- s.extra_rdoc_files = [
- "LICENSE.txt",
- "README.md"
- ]
- s.files = [
- "Gemfile",
- "LICENSE.txt",
- "README.md",
- "Rakefile",
- "VERSION",
- "bitwise.gemspec",
- "ext/bitwise/bitwise.c",
- "ext/bitwise/extconf.rb",
- "lib/bitwise.rb",
- "spec/bitwise_spec.rb"
- ]
- s.homepage = "http://github.com/kenn/bitwise"
- s.licenses = ["MIT"]
- s.require_paths = ["lib"]
- s.rubygems_version = "1.8.15"
- s.summary = "Fast, memory efficient bitwise operations on large binary strings"
+ gem.files = `git ls-files`.split($\)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.name = "bitwise"
+ gem.require_paths = ["lib"]
+ gem.version = '0.5.0' # retrieve this value by: Gem.loaded_specs['redis-mutex'].version.to_s
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ gem.add_development_dependency "rspec"
+ gem.add_development_dependency "bundler"
+ gem.add_development_dependency "rake-compiler"
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 0"])
- s.add_development_dependency(%q<bundler>, [">= 0"])
- s.add_development_dependency(%q<jeweler>, [">= 0"])
- s.add_development_dependency(%q<rake-compiler>, [">= 0"])
- else
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<bundler>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rake-compiler>, [">= 0"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<bundler>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rake-compiler>, [">= 0"])
- end
+ # For Travis
+ gem.add_development_dependency "rake"
end
-
View
4 ext/bitwise/bitwise.c
@@ -23,7 +23,7 @@ static int COUNT_TABLE[] = {
static VALUE bw_population_count(VALUE self, VALUE str) {
int count, i;
- unsigned char *buffer = RSTRING_PTR(str);
+ unsigned char *buffer = (unsigned char *)RSTRING_PTR(str);
count = 0;
for (i = 0; i < RSTRING_LEN(str); i++) {
count += COUNT_TABLE[buffer[i]];
@@ -65,7 +65,7 @@ static VALUE bw_string_xor(VALUE self, VALUE max, VALUE min)
{
VALUE result = rb_str_new(RSTRING_PTR(max), RSTRING_LEN(max));
int i;
- int min_len = RSTRING_LEN(min);
+ long min_len = RSTRING_LEN(min);
for (i = 0; i < RSTRING_LEN(max); i++) {
RSTRING_PTR(result)[i] ^= ((i < min_len) ? RSTRING_PTR(min)[i] : 0);
}
View
BIN lib/bitwise/bitwise.bundle
Binary file not shown.

0 comments on commit 34fc02c

Please sign in to comment.