Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated repository structure

Using Travic CI
  • Loading branch information...
commit d875236cfa59cc70840b8e4a4eda52860b6341e4 1 parent 747b391
Paul Engel authored
View
7 .travis.yml
@@ -0,0 +1,7 @@
+language: ruby
+rvm:
+ - 1.9.3
+ - 1.9.2
+ - jruby-19mode
+ - 1.8.7
+ - ree
View
17 Gemfile
@@ -1,3 +1,18 @@
source "http://rubygems.org"
-gemspec
+gemspec
+
+group :gem_default do
+ gem "unextendable", :path => "."
+end
+
+group :gem_development do
+ gem "pry"
+end
+
+group :gem_test do
+ gem "minitest"
+ gem "mocha"
+ gem "pry"
+ gem "rake"
+end
View
2  MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Paul Engel
+Copyright (c) 2012 Paul Engel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
2  README.textile
@@ -1,4 +1,4 @@
-h1. Unextendable
+h1. Unextendable "!https://secure.travis-ci.org/archan937/unextendable.png!":http://travis-ci.org/archan937/unextendable
A small gem making unextending extended module methods within object instances possible
View
15 Rakefile
@@ -1,10 +1,9 @@
-require "bundler"
-Bundler::GemHelper.install_tasks
-
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
require "rake/testtask"
-Rake::TestTask.new(:test) do |test|
- test.pattern = "test/**/*_test.rb"
- test.verbose = true
-end
-task :default => :test
+task :default => :test
+
+Rake::TestTask.new do |test|
+ test.pattern = "test/**/test_*.rb"
+end
View
3  lib/core_ext.rb
@@ -0,0 +1,3 @@
+Dir["#{File.dirname(__FILE__)}/core_ext/*.rb"].sort.each do |path|
+ require path
+end
View
0  lib/unextendable/kernel.rb → lib/core_ext/kernel.rb
File renamed without changes
View
0  lib/unextendable/module.rb → lib/core_ext/module.rb
File renamed without changes
View
0  lib/unextendable/object.rb → lib/core_ext/object.rb
File renamed without changes
View
6 lib/unextendable.rb
@@ -1,4 +1,2 @@
-require File.expand_path("../unextendable/module" , __FILE__)
-require File.expand_path("../unextendable/kernel" , __FILE__)
-require File.expand_path("../unextendable/object" , __FILE__)
-require File.expand_path("../unextendable/version", __FILE__)
+require "core_ext"
+require "unextendable/version"
View
36 script/console
@@ -1,2 +1,36 @@
#!/usr/bin/env ruby
-system "irb -r ./lib/unextendable.rb -r ./script/definitions.rb"
+require "rubygems"
+require "bundler"
+
+Bundler.require :gem_default, :gem_development
+
+puts "Loading Unextendable development environment (#{Unextendable::VERSION})"
+puts "Defining classes ..."
+puts "[0] pry(main)> @c = C.new; @c.title = \"Mr.\""
+
+module A
+ def name
+ "A"
+ end
+end
+
+module U
+ unextendable
+ def name
+ "U"
+ end
+end
+
+class C
+ attr_accessor :title
+ def salutation
+ [title, name].reject{|x| x.nil? || x.empty?}.join " "
+ end
+ def name
+ "C"
+ end
+end
+
+@c = C.new
+@c.title = "Mr."
+Pry.start
View
25 script/definitions.rb
@@ -1,25 +0,0 @@
-module A
- def name
- "A"
- end
-end
-
-module U
- unextendable
- def name
- "U"
- end
-end
-
-class C
- attr_accessor :title
- def salutation
- [title, name].reject{|x| x.nil? || x.empty?}.join " "
- end
- def name
- "C"
- end
-end
-
-@c = C.new
-@c.title = "Mr."
View
52 test/blank_object_test.rb
@@ -1,52 +0,0 @@
-require File.expand_path("../test_helper", __FILE__)
-
-class BlankObjectTest < Test::Unit::TestCase
-
- # ==================================================================================================================================
- # A BlankObject class is considered not to have meta_class and unextend defined, but does respond to extend (e.g. Liquid::Strainer)
- # See also: http://rubydoc.info/gems/liquid/2.3.0/Liquid/Strainer
- # ==================================================================================================================================
-
- context "A blank object instance" do
- setup do
- module Hi
- unextendable
- def say_hi
- "Hi!"
- end
- end
- class BlankObject
- def meta_class
- raise NoMethodError
- end
- def unextend
- raise NoMethodError
- end
- def respond_to?(symbol, include_private = false)
- return false if %w(meta_class unextend).include? symbol.to_s
- super
- end
- end
- end
-
- should "have extend defined" do
- assert BlankObject.new.extend(Hi)
- end
-
- should "not have meta_class and unextend defined" do
- assert_raises NoMethodError do
- BlankObject.new.meta_class
- end
- assert_raises NoMethodError do
- BlankObject.new.unextend
- end
- end
-
- should "be extendable" do
- b = BlankObject.new
- b.extend Hi
- assert_equal "Hi!", b.say_hi
- end
- end
-
-end
View
41 test/module_test.rb
@@ -1,41 +0,0 @@
-require File.expand_path("../test_helper", __FILE__)
-
-class ModuleTest < Test::Unit::TestCase
-
- context "A module" do
- setup do
- module A
- end
- end
-
- should "be able to be marked as unextendable" do
- assert A.respond_to?(:unextendable)
- end
-
- should "respond to :unextendable?" do
- assert A.respond_to?(:unextendable?)
- end
-
- context "which is not unextendable" do
- should "return false when asked to be unextendable" do
- assert !A.unextendable?
- end
- end
-
- context "which is unextendable" do
- setup do
- module U
- unextendable
- def name
- "U"
- end
- end
- end
-
- should "return true when asked to be unextendable" do
- assert U.unextendable?
- end
- end
- end
-
-end
View
307 test/object_test.rb
@@ -1,307 +0,0 @@
-require File.expand_path("../test_helper", __FILE__)
-
-class ObjectTest < Test::Unit::TestCase
-
- context "An object instance" do
- setup do
- module A
- def name
- "A"
- end
- end
- class C
- attr_accessor :title
- def salutation
- [title, name].reject{|x| x.nil? || x.empty?}.join " "
- end
- def name
- "C"
- end
- private
- def id
- "C"
- end
- end
- @c = C.new
- @c.title = "Mr."
- end
-
- should "respond to meta_class and extended_modules" do
- assert @c.respond_to?(:meta_class)
- assert @c.meta_class.respond_to?(:extended_modules)
- end
-
- context "when extending modules" do
- should "check whether a module is unextendable or not" do
- module B; end
-
- A.expects(:unextendable?).twice
- B.expects(:unextendable?)
-
- @c.extend A
- @c.extend A, B
-
- assert @c.meta_class.included_modules.include?(A)
- assert @c.meta_class.included_modules.include?(B)
- end
-
- context "which are not unextendable" do
- should "behave as normal when the module is not unextendable" do
- A.expects(:wrap_unextendable_module).never
- @c.extend A
- assert @c.meta_class.included_modules.include?(A)
- assert @c.meta_class.extended_modules.include?(A)
- end
-
- should "behave as expected" do
- assert_equal "Mr. C", @c.salutation
-
- @c.extend A
- assert_equal "Mr. A", @c.salutation
-
- @c.unextend
- assert_equal "Mr. A", @c.salutation
-
- @d = C.new
- @d.title = "Mr."
- assert_equal "Mr. C", @d.salutation
-
- @d.extend A
- assert_equal "Mr. A", @d.salutation
-
- @d.unextend A
- assert_equal "Mr. A", @d.salutation
- end
- end
-
- context "which are unextendable" do
- setup do
- module B
- unextendable
- public
- def id
- "B"
- end
- end
-
- module U
- unextendable
- def name
- "U"
- end
- def foo
- "bar"
- end
- private
- def id
- "U"
- end
- end
- end
-
- should "respond to a non-extended instance method after extending" do
- assert @c.respond_to?(:salutation)
- @c.extend U
- assert @c.respond_to?(:salutation)
- end
-
- should "call wrap_unextendable_module" do
- @c.expects(:wrap_unextendable_module)
- @c.extend A, U
- end
-
- should "call wrap_unextendable_method" do
- @c.expects(:wrap_unextendable_method).times(3)
- @c.extend U
- end
-
- should "add nil value as method proc when not responding to module method name" do
- @c.extend U
- assert_equal 1, @c.meta_class.method_procs.select{|k, v| v.nil?}.size
- assert_equal 2, @c.meta_class.method_procs.select{|k, v| v.class == Proc}.size
- end
-
- should "add the module to extended_modules" do
- assert @c.meta_class.extended_modules.empty?
- @c.extend U
- assert @c.meta_class.extended_modules.include?(U)
- end
-
- should "add method proc to method_procs" do
- assert @c.meta_class.send(:method_procs).empty?
- @c.extend U
- assert_equal 3, @c.meta_class.send(:method_procs).size
- end
-
- context "when calling an unextendable method" do
- should "call call_unextendable_method" do
- @c.extend U
- @c.expects(:call_unextendable_method).with(:name)
- @c.name
- end
-
- should "call method_for" do
- method = @c.meta_class.instance_method(:name).bind(@c)
- @c.extend U
- @c.expects(:method_for).with(:name).returns(method)
- @c.name
- end
-
- should "match the expected method" do
- assert_equal @c.method(:name), @c.send(:method_for, :name)
- @c.extend U
- assert_equal U.instance_method(:name).bind(@c), @c.send(:method_for, :name)
- end
-
- should "return the expected value" do
- assert_equal "Mr. C", @c.salutation
- @c.extend U
- assert_equal "Mr. U", @c.salutation
-
- @d = C.new
- assert_equal "C", @d.salutation
- @d.extend U
- assert_equal "U", @d.salutation
- end
- end
-
- context "when unextending the module afterwards" do
- should "remove the module from extended_modules" do
- exception = assert_raises(NoMethodError) do
- @c.id
- end
- assert_equal "private method `id' called for", exception.message[0..29]
- assert_equal "C", @c.send(:id)
-
- @c.extend U
- assert @c.meta_class.extended_modules.include?(U)
- assert_equal "private method `id' called for", exception.message[0..29]
- assert_equal "U", @c.send(:id)
-
- @c.extend B
- assert_equal "B", @c.send(:id)
-
- @c.unextend
- assert !@c.meta_class.extended_modules.include?(U)
- assert_equal "private method `id' called for", exception.message[0..29]
- assert_equal "C", @c.send(:id)
- end
-
- should "remove the module but when passed a block only when it passes" do
- assert_equal "Mr. C", @c.salutation
-
- @c.extend U
- assert_equal "Mr. U", @c.salutation
-
- @c.unextend do |mod|
- mod != U
- end
- assert_equal "Mr. U", @c.salutation
-
- @c.unextend do |mod|
- mod == U
- end
- assert_equal "Mr. C", @c.salutation
- end
-
- context "when calling an unextendable method" do
- should "match the expected method" do
- assert_equal @c.method(:name), @c.send(:method_for, :name)
-
- @c.extend U
- assert_equal U.instance_method(:name).bind(@c), @c.send(:method_for, :name)
-
- @c.unextend U
- assert_equal Proc, @c.send(:method_for, :name).class
- end
-
- should "behave as expected" do
- assert_equal "Mr. C", @c.salutation
- @c.title = "Dr."
- assert_equal "Dr. C", @c.salutation
-
- assert !@c.respond_to?(:foo)
- assert_raise NoMethodError do
- @c.foo
- end
-
- @c.extend U
- assert_equal "Dr. U", @c.salutation
- @c.title = "Sir"
- assert_equal "Sir U", @c.salutation
-
- assert @c.respond_to?(:salutation)
- assert @c.respond_to?(:foo)
- assert_nothing_raised NoMethodError do
- @c.foo
- end
- assert_equal "bar", @c.foo
-
- @c.unextend U
- assert_equal "Sir C", @c.salutation
- @c.title = ""
- assert_equal "C", @c.salutation
-
- assert @c.respond_to?(:salutation)
- assert !@c.respond_to?(:foo)
- assert_raise NoMethodError do
- @c.foo
- end
-
- @c.extend U
- assert_equal "U", @c.salutation
- @c.title = "Ms."
- assert_equal "Ms. U", @c.salutation
-
- @c.unextend
- assert_equal "Ms. C", @c.salutation
-
- module D
- unextendable
- def name
- "D"
- end
- end
-
- @c.extend D
- assert_equal "Ms. D", @c.salutation
-
- @c.extend U
- assert_equal "Ms. U", @c.salutation
-
- @c.extend D
- assert_equal "Ms. D", @c.salutation
-
- @c.unextend
- assert_equal "Ms. C", @c.salutation
-
- @c.extend A
- assert_equal "Ms. A", @c.salutation
-
- @c.unextend
- assert_equal "Ms. A", @c.salutation
-
- @c.extend D
- assert_equal "Ms. D", @c.salutation
-
- @c.unextend
- assert_equal "Ms. A", @c.salutation
-
- @c.extend U
- @c.unextend do |mod|
- mod != U
- end
- assert_equal "Ms. U", @c.salutation
-
- @c.unextend do |mod|
- mod == U
- end
- assert_equal "Ms. A", @c.salutation
- end
- end
- end
- end
- end
- end
-
-end
View
12 test/test_helper.rb
@@ -1,7 +1,7 @@
-$:.unshift File.expand_path("../../lib", __FILE__)
-
require "rubygems"
-require "test/unit"
-require "shoulda"
-require "mocha"
-require "unextendable"
+require "bundler"
+
+require "minitest/unit"
+require "minitest/autorun"
+
+Bundler.require :gem_default, :gem_test
View
54 test/unit/test_blank_object.rb
@@ -0,0 +1,54 @@
+require File.expand_path("../../test_helper", __FILE__)
+
+module Unit
+ class TestBlankObject < MiniTest::Unit::TestCase
+
+ # ==================================================================================================================================
+ # A BlankObject class is considered not to have meta_class and unextend defined, but does respond to extend (e.g. Liquid::Strainer)
+ # See also: http://rubydoc.info/gems/liquid/2.3.0/Liquid/Strainer
+ # ==================================================================================================================================
+
+ describe "A blank object instance" do
+ before do
+ module Hi
+ unextendable
+ def say_hi
+ "Hi!"
+ end
+ end
+ class BlankObject
+ def meta_class
+ raise NoMethodError
+ end
+ def unextend
+ raise NoMethodError
+ end
+ def respond_to?(symbol, include_private = false)
+ return false if %w(meta_class unextend).include? symbol.to_s
+ super
+ end
+ end
+ end
+
+ it "should have extend defined" do
+ assert BlankObject.new.extend(Hi)
+ end
+
+ it "should not have meta_class and unextend defined" do
+ assert_raises NoMethodError do
+ BlankObject.new.meta_class
+ end
+ assert_raises NoMethodError do
+ BlankObject.new.unextend
+ end
+ end
+
+ it "should be extendable" do
+ b = BlankObject.new
+ b.extend Hi
+ assert_equal "Hi!", b.say_hi
+ end
+ end
+
+ end
+end
View
43 test/unit/test_module.rb
@@ -0,0 +1,43 @@
+require File.expand_path("../../test_helper", __FILE__)
+
+module Unit
+ class TestModule < MiniTest::Unit::TestCase
+
+ describe "A module" do
+ before do
+ module A
+ end
+ end
+
+ it "should be able to be marked as unextendable" do
+ assert A.respond_to?(:unextendable)
+ end
+
+ it "should respond to :unextendable?" do
+ assert A.respond_to?(:unextendable?)
+ end
+
+ describe "which is not unextendable" do
+ it "should return false when asked to be unextendable" do
+ assert !A.unextendable?
+ end
+ end
+
+ describe "which is unextendable" do
+ before do
+ module U
+ unextendable
+ def name
+ "U"
+ end
+ end
+ end
+
+ it "should return true when asked to be unextendable" do
+ assert U.unextendable?
+ end
+ end
+ end
+
+ end
+end
View
307 test/unit/test_object.rb
@@ -0,0 +1,307 @@
+require File.expand_path("../../test_helper", __FILE__)
+
+module Unit
+ class TestObject < MiniTest::Unit::TestCase
+
+ describe "An object instance" do
+ before do
+ module A
+ def name
+ "A"
+ end
+ end
+ class C
+ attr_accessor :title
+ def salutation
+ [title, name].reject{|x| x.nil? || x.empty?}.join " "
+ end
+ def name
+ "C"
+ end
+ private
+ def id
+ "C"
+ end
+ end
+ @c = C.new
+ @c.title = "Mr."
+ end
+
+ it "should respond to meta_class and extended_modules" do
+ assert @c.respond_to?(:meta_class)
+ assert @c.meta_class.respond_to?(:extended_modules)
+ end
+
+ describe "when extending modules" do
+ it "should check whether a module is unextendable or not" do
+ module B; end
+
+ A.expects(:unextendable?).twice
+ B.expects(:unextendable?)
+
+ @c.extend A
+ @c.extend A, B
+
+ assert @c.meta_class.included_modules.include?(A)
+ assert @c.meta_class.included_modules.include?(B)
+ end
+
+ describe "which are not unextendable" do
+ it "should behave as normal when the module is not unextendable" do
+ A.expects(:wrap_unextendable_module).never
+ @c.extend A
+ assert @c.meta_class.included_modules.include?(A)
+ assert @c.meta_class.extended_modules.include?(A)
+ end
+
+ it "should behave as expected" do
+ assert_equal "Mr. C", @c.salutation
+
+ @c.extend A
+ assert_equal "Mr. A", @c.salutation
+
+ @c.unextend
+ assert_equal "Mr. A", @c.salutation
+
+ @d = C.new
+ @d.title = "Mr."
+ assert_equal "Mr. C", @d.salutation
+
+ @d.extend A
+ assert_equal "Mr. A", @d.salutation
+
+ @d.unextend A
+ assert_equal "Mr. A", @d.salutation
+ end
+ end
+
+ describe "which are unextendable" do
+ before do
+ module B
+ unextendable
+ public
+ def id
+ "B"
+ end
+ end
+
+ module U
+ unextendable
+ def name
+ "U"
+ end
+ def foo
+ "bar"
+ end
+ private
+ def id
+ "U"
+ end
+ end
+ end
+
+ it "should respond to a non-extended instance method after extending" do
+ assert @c.respond_to?(:salutation)
+ @c.extend U
+ assert @c.respond_to?(:salutation)
+ end
+
+ it "should call wrap_unextendable_module" do
+ @c.expects(:wrap_unextendable_module)
+ @c.extend A, U
+ end
+
+ it "should call wrap_unextendable_method" do
+ @c.expects(:wrap_unextendable_method).times(3)
+ @c.extend U
+ end
+
+ it "should add nil value as method proc when not responding to module method name" do
+ @c.extend U
+ assert_equal 1, @c.meta_class.method_procs.select{|k, v| v.nil?}.size
+ assert_equal 2, @c.meta_class.method_procs.select{|k, v| v.class == Proc}.size
+ end
+
+ it "should add the module to extended_modules" do
+ assert @c.meta_class.extended_modules.empty?
+ @c.extend U
+ assert @c.meta_class.extended_modules.include?(U)
+ end
+
+ it "should add method proc to method_procs" do
+ assert @c.meta_class.send(:method_procs).empty?
+ @c.extend U
+ assert_equal 3, @c.meta_class.send(:method_procs).size
+ end
+
+ describe "when calling an unextendable method" do
+ it "should call call_unextendable_method" do
+ @c.extend U
+ @c.expects(:call_unextendable_method).with(:name)
+ @c.name
+ end
+
+ it "should call method_for" do
+ method = @c.meta_class.instance_method(:name).bind(@c)
+ @c.extend U
+ @c.expects(:method_for).with(:name).returns(method)
+ @c.name
+ end
+
+ it "should match the expected method" do
+ assert_equal @c.method(:name), @c.send(:method_for, :name)
+ @c.extend U
+ assert_equal U.instance_method(:name).bind(@c), @c.send(:method_for, :name)
+ end
+
+ it "should return the expected value" do
+ assert_equal "Mr. C", @c.salutation
+ @c.extend U
+ assert_equal "Mr. U", @c.salutation
+
+ @d = C.new
+ assert_equal "C", @d.salutation
+ @d.extend U
+ assert_equal "U", @d.salutation
+ end
+ end
+
+ describe "when unextending the module afterwards" do
+ it "should remove the module from extended_modules" do
+ exception = assert_raises(NoMethodError) do
+ @c.id
+ end
+ assert_equal "private method `id' called for", exception.message[0..29]
+ assert_equal "C", @c.send(:id)
+
+ @c.extend U
+ assert @c.meta_class.extended_modules.include?(U)
+ assert_equal "private method `id' called for", exception.message[0..29]
+ assert_equal "U", @c.send(:id)
+
+ @c.extend B
+ assert_equal "B", @c.send(:id)
+
+ @c.unextend
+ assert !@c.meta_class.extended_modules.include?(U)
+ assert_equal "private method `id' called for", exception.message[0..29]
+ assert_equal "C", @c.send(:id)
+ end
+
+ it "should remove the module but when passed a block only when it passes" do
+ assert_equal "Mr. C", @c.salutation
+
+ @c.extend U
+ assert_equal "Mr. U", @c.salutation
+
+ @c.unextend do |mod|
+ mod != U
+ end
+ assert_equal "Mr. U", @c.salutation
+
+ @c.unextend do |mod|
+ mod == U
+ end
+ assert_equal "Mr. C", @c.salutation
+ end
+
+ describe "when calling an unextendable method" do
+ it "should match the expected method" do
+ assert_equal @c.method(:name), @c.send(:method_for, :name)
+
+ @c.extend U
+ assert_equal U.instance_method(:name).bind(@c), @c.send(:method_for, :name)
+
+ @c.unextend U
+ assert_equal Proc, @c.send(:method_for, :name).class
+ end
+
+ it "should behave as expected" do
+ assert_equal "Mr. C", @c.salutation
+ @c.title = "Dr."
+ assert_equal "Dr. C", @c.salutation
+
+ assert !@c.respond_to?(:foo)
+ assert_raises NoMethodError do
+ @c.foo
+ end
+
+ @c.extend U
+ assert_equal "Dr. U", @c.salutation
+ @c.title = "Sir"
+ assert_equal "Sir U", @c.salutation
+
+ assert @c.respond_to?(:salutation)
+ assert @c.respond_to?(:foo)
+ @c.foo
+ assert_equal "bar", @c.foo
+
+ @c.unextend U
+ assert_equal "Sir C", @c.salutation
+ @c.title = ""
+ assert_equal "C", @c.salutation
+
+ assert @c.respond_to?(:salutation)
+ assert !@c.respond_to?(:foo)
+ assert_raises NoMethodError do
+ @c.foo
+ end
+
+ @c.extend U
+ assert_equal "U", @c.salutation
+ @c.title = "Ms."
+ assert_equal "Ms. U", @c.salutation
+
+ @c.unextend
+ assert_equal "Ms. C", @c.salutation
+
+ module D
+ unextendable
+ def name
+ "D"
+ end
+ end
+
+ @c.extend D
+ assert_equal "Ms. D", @c.salutation
+
+ @c.extend U
+ assert_equal "Ms. U", @c.salutation
+
+ @c.extend D
+ assert_equal "Ms. D", @c.salutation
+
+ @c.unextend
+ assert_equal "Ms. C", @c.salutation
+
+ @c.extend A
+ assert_equal "Ms. A", @c.salutation
+
+ @c.unextend
+ assert_equal "Ms. A", @c.salutation
+
+ @c.extend D
+ assert_equal "Ms. D", @c.salutation
+
+ @c.unextend
+ assert_equal "Ms. A", @c.salutation
+
+ @c.extend U
+ @c.unextend do |mod|
+ mod != U
+ end
+ assert_equal "Ms. U", @c.salutation
+
+ @c.unextend do |mod|
+ mod == U
+ end
+ assert_equal "Ms. A", @c.salutation
+ end
+ end
+ end
+ end
+ end
+ end
+
+ end
+end
View
33 unextendable.gemspec
@@ -1,24 +1,19 @@
# -*- encoding: utf-8 -*-
+
$:.push File.expand_path("../lib", __FILE__)
require "unextendable/version"
-Gem::Specification.new do |s|
- s.name = "unextendable"
- s.version = Unextendable::VERSION
- s.platform = Gem::Platform::RUBY
- s.authors = ["Paul Engel"]
- s.email = ["paul.engel@holder.nl"]
- s.homepage = "https://github.com/archan937/unextendable"
- s.summary = %q{A small gem making unextending extended module methods within object instances possible}
- s.description = %q{Unextendable originated from the thought of being able to implement the State pattern within object instances using modules. In other words: I wanted object instances to behave dependent on their state using modules. I really want to use modules because they are commonly used to define a set of methods which you can extend within an object instance. Unfortunately, you cannot just unexclude a module. So after searching the web for solutions, I came across Mixology, evil-ruby and StatePattern. But they slightly did not fit the picture. So after doing some research, I came up with Unextendable.}
-
- s.rubyforge_project = "unextendable"
-
- 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"]
+Gem::Specification.new do |gem|
+ gem.authors = ["Paul Engel"]
+ gem.email = ["paul.engel@holder.nl"]
+ gem.summary = %q{A small gem making unextending extended module methods within object instances possible}
+ gem.description = %q{Unextendable originated from the thought of being able to implement the State pattern within object instances using modules. In other words: I wanted object instances to behave dependent on their state using modules. I really want to use modules because they are commonly used to define a set of methods which you can extend within an object instance. Unfortunately, you cannot just unexclude a module. So after searching the web for solutions, I came across Mixology, evil-ruby and StatePattern. But they slightly did not fit the picture. So after doing some research, I came up with Unextendable.}
+ gem.homepage = "https://github.com/archan937/unextendable"
- s.add_development_dependency "shoulda"
- s.add_development_dependency "mocha"
-end
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.name = "unextendable"
+ gem.require_paths = ["lib"]
+ gem.version = Unextendable::VERSION
+end
Please sign in to comment.
Something went wrong with that request. Please try again.