Permalink
Browse files

Updated gem manager from jeweler to Hoe

  • Loading branch information...
1 parent 4350ba7 commit 5c8d40b7e03c07a96ae647bc302eec74abfc224d @maraigue committed Jun 27, 2013
Showing with 107 additions and 252 deletions.
  1. +0 −5 .document
  2. +0 −13 Gemfile
  3. +8 −0 History.txt
  4. +0 −20 LICENSE.txt
  5. +5 −0 Manifest.txt
  6. +0 −47 README.rdoc
  7. +75 −0 README.txt
  8. +17 −73 Rakefile
  9. +0 −1 VERSION
  10. +0 −92 devnull.gemspec
  11. +1 −0 lib/devnull.rb
  12. +1 −1 spec/devnull_spec.rb
View
@@ -1,5 +0,0 @@
-lib/**/*.rb
-bin/*
--
-features/**/*.feature
-LICENSE.txt
View
@@ -1,13 +0,0 @@
-source "http://rubygems.org"
-# Add dependencies required to use your gem here.
-# Example:
-# gem "activesupport", ">= 2.3.5"
-
-# Add dependencies to develop your gem here.
-# Include everything needed to run rake, tests, features, etc.
-group :development do
- gem "rspec", ">= 2.3.0"
- gem "bundler", ">= 1.0.0"
- gem "jeweler", ">= 1.5.2"
- gem "rcov", ">= 0"
-end
View
@@ -0,0 +1,8 @@
+=== 0.1.0 / 2011-03-28
+
+* First release
+
+=== 0.1.1 / 2013-06-27
+
+* Fixed duplicated definition of DevNull#syswrite (Thanks Andrew Grimm!)
+
View
@@ -1,20 +0,0 @@
-Copyright (c) 2011 H.Hiro (Maraigue)
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,5 @@
+History.txt
+README.txt
+lib/devnull.rb
+spec/devnull_spec.rb
+spec/spec_helper.rb
View
@@ -1,47 +0,0 @@
-= devnull
-
-DevNull behaves a null file, and works like an IO object. For example:
-
- dn = DevNull.new
- dn.puts "foo" # => nil (do nothing)
- dn.gets # => nil
- dn.read # => ""
-
-The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
-
- def some_process(arg, logfile = nil)
- # You may set an IO object as 'logfile', and logs are written to the file.
-
- result = process1(arg)
- logfile.puts result if logfile
-
- result = process2(arg)
- logfile.puts result if logfile
-
- result = process3(arg)
- logfile.puts result if logfile
- end
-
-can be rewritten as follows:
-
- def some_process(arg, logfile = DevNull.new)
- logfile.puts process1(arg)
- logfile.puts process2(arg)
- logfile.puts process3(arg)
- end
-
-== Contributing to devnull
-
-* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
-* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
-* Fork the project
-* Start a feature/bugfix branch
-* Commit and push until you are happy with your contribution
-* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
-
-== Copyright
-
-Copyright (c) 2011 maraigue. See LICENSE.txt for
-further details.
-
View
@@ -0,0 +1,75 @@
+= devnull
+
+http://github.com/maraigue/devnull
+
+Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)
+
+== DESCRIPTION:
+
+DevNull behaves a null file, and works like an IO object. For example:
+
+ dn = DevNull.new
+ dn.puts "foo" # => nil (do nothing)
+ dn.gets # => nil
+ dn.read # => ""
+
+The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
+
+ def some_process(arg, logfile = nil)
+ # You may set an IO object as 'logfile', and logs are written to the file.
+
+ result = process1(arg)
+ logfile.puts result if logfile
+
+ result = process2(arg)
+ logfile.puts result if logfile
+
+ result = process3(arg)
+ logfile.puts result if logfile
+ end
+
+can be rewritten as follows:
+
+ def some_process(arg, logfile = DevNull.new)
+ logfile.puts process1(arg)
+ logfile.puts process2(arg)
+ logfile.puts process3(arg)
+ end
+
+== INSTALL:
+
+gem install devnull
+
+== DEVELOPERS:
+
+After checking out the source, run:
+
+ $ rake newb
+
+This task will install any missing dependencies, run the tests/specs,
+and generate the RDoc.
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2011 H.Hiro (Maraigue)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,80 +1,24 @@
+# -*- ruby -*-
+
require 'rubygems'
-require 'bundler'
-begin
- Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
- $stderr.puts e.message
- $stderr.puts "Run `bundle install` to install missing gems"
- exit e.status_code
-end
-require 'rake'
+require 'hoe'
-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 = "devnull"
- gem.homepage = "http://github.com/maraigue/devnull"
- gem.license = "MIT"
- gem.summary = %Q{Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)}
- gem.description = <<DESC
-DevNull behaves a null file, and works like an IO object. For example:
+# Hoe.plugin :compiler
+# Hoe.plugin :gem_prelude_sucks
+# Hoe.plugin :inline
+# Hoe.plugin :minitest
+# Hoe.plugin :racc
+# Hoe.plugin :rcov
+# Hoe.plugin :rubyforge
-dn = DevNull.new
-dn.puts "foo" # => nil (do nothing)
-dn.gets # => nil
-dn.read # => ""
+Hoe.spec 'devnull' do
+ # HEY! If you fill these out in ~/.hoe_template/Rakefile.erb then
+ # you'll never have to touch them again!
+ # (delete this comment too, of course)
-The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
+ developer('H.Hiro (maraigue)', 'main@hhiro.net')
-def some_process(arg, logfile = nil)
- # You may set an IO object as 'logfile', and logs are written to the file.
-
- result = process1(arg)
- logfile.puts result if logfile
-
- result = process2(arg)
- logfile.puts result if logfile
-
- result = process3(arg)
- logfile.puts result if logfile
+ # self.rubyforge_name = 'devnullx' # if different than 'devnull'
end
-can be rewritten as follows:
-
-def some_process(arg, logfile = DevNull.new)
- logfile.puts process1(arg)
- logfile.puts process2(arg)
- logfile.puts process3(arg)
-end
-DESC
- gem.email = "main@hhiro.net"
- gem.authors = ["H.Hiro (Maraigue)"]
- # Include your dependencies below. Runtime dependencies are required when using your gem,
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
- # gem.add_development_dependency 'rspec', '> 1.2.3'
-end
-Jeweler::RubygemsDotOrgTasks.new
-
-require 'rspec/core'
-require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec) do |spec|
- spec.pattern = FileList['spec/**/*_spec.rb']
-end
-
-RSpec::Core::RakeTask.new(:rcov) do |spec|
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
-
-task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "devnull #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
+# vim: syntax=ruby
View
@@ -1 +0,0 @@
-0.1.0
View
@@ -1,92 +0,0 @@
-# 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 = %q{devnull}
- s.version = "0.1.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["H.Hiro (Maraigue)"]
- s.date = %q{2011-03-28}
- s.description = %q{DevNull behaves a null file, and works like an IO object. For example:
-
-dn = DevNull.new
-dn.puts "foo" # => nil (do nothing)
-dn.gets # => nil
-dn.read # => ""
-
-The library may be a good solution if you would like to switch whether an input/output file is needed. For example:
-
-def some_process(arg, logfile = nil)
- # You may set an IO object as 'logfile', and logs are written to the file.
-
- result = process1(arg)
- logfile.puts result if logfile
-
- result = process2(arg)
- logfile.puts result if logfile
-
- result = process3(arg)
- logfile.puts result if logfile
-end
-
-can be rewritten as follows:
-
-def some_process(arg, logfile = DevNull.new)
- logfile.puts process1(arg)
- logfile.puts process2(arg)
- logfile.puts process3(arg)
-end
-}
- s.email = %q{main@hhiro.net}
- s.extra_rdoc_files = [
- "LICENSE.txt",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".rspec",
- "Gemfile",
- "LICENSE.txt",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "devnull.gemspec",
- "lib/devnull.rb",
- "spec/devnull_spec.rb",
- "spec/spec_helper.rb"
- ]
- s.homepage = %q{http://github.com/maraigue/devnull}
- s.licenses = ["MIT"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows)}
- s.test_files = [
- "spec/devnull_spec.rb",
- "spec/spec_helper.rb"
- ]
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 2.3.0"])
- s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
- s.add_development_dependency(%q<rcov>, [">= 0"])
- else
- s.add_dependency(%q<rspec>, [">= 2.3.0"])
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_dependency(%q<jeweler>, [">= 1.5.2"])
- s.add_dependency(%q<rcov>, [">= 0"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 2.3.0"])
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
- s.add_dependency(%q<jeweler>, [">= 1.5.2"])
- s.add_dependency(%q<rcov>, [">= 0"])
- end
-end
-
View
@@ -32,6 +32,7 @@
# end</pre>
require "enumerator"
+VERSION = "0.1.1"
class DevNull
def initialize
@@ -53,7 +53,7 @@
it "should return an Enumerator for Devnull##{method_name}" do
# First, check whether the method returns an Enumerator.
enum = eval("@null.#{method_name}")
- enum.should be_instance_of(Enumerable::Enumerator)
+ enum.should be_instance_of(Enumerator)
# Then, check whether the Enumerator is empty.
lambda{ enum.each{ raise RuntimeError } }.should_not raise_error
lambda{ eval("@null.#{method_name} { raise RuntimeError }") }.should_not raise_error

2 comments on commit 5c8d40b

@paddor
paddor commented on 5c8d40b Oct 31, 2014

Just something I saw while browing your library: You really shouldn't have the VERSION constant in the root namespace. It should be DevNull::VERSION. Just saying. :)

@maraigue
Owner

@paddor Thanks for advice. Got very late, but now I fixed it. 128cb43

Please sign in to comment.