ruckus 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.6.0
@@ -1,22 +1,27 @@
1
1
  class Object
2
- module ObjectExtensions
3
- # Every object has a "singleton" class, which you can think
4
- # of as the class (ie, 1.metaclass =~ Fixnum) --- but that you
5
- # can modify and extend without fucking up the actual class.
2
+ module ObjectExtensions
3
+ # Every object has a "singleton" class, which you can think
4
+ # of as the class (ie, 1.metaclass =~ Fixnum) --- but that you
5
+ # can modify and extend without fucking up the actual class.
6
6
 
7
- def metaclass; class << self; self; end; end
8
- def meta_eval(&blk) metaclass.instance_eval &blk; end
9
- def meta_def(name, &blk) meta_eval { define_method name, &blk }; end
10
- def try(meth, *args); send(meth, *args) if respond_to? meth; end
7
+ def metaclass; class << self; self; end; end
8
+ def meta_eval(&blk) metaclass.instance_eval &blk; end
9
+ def meta_def(name, &blk) meta_eval { define_method name, &blk }; end
10
+ def try(meth, *args); send(meth, *args) if respond_to? meth; end
11
11
 
12
- def through(meth, *args)
13
- if respond_to? meth
14
- send(meth, *args)
15
- else
16
- self
17
- end
18
- end
12
+ def through(meth, *args)
13
+ if respond_to? meth
14
+ send(meth, *args)
15
+ else
16
+ self
17
+ end
19
18
  end
20
- include ObjectExtensions
19
+
20
+ def tap
21
+ yield(self)
22
+ self
23
+ end if !(Object.instance_methods.include? :tap)
24
+ end
25
+ include ObjectExtensions
21
26
  end
22
27
 
@@ -46,7 +46,7 @@ module Ruckus
46
46
  # What's our native endianness? :big or :little
47
47
  #
48
48
  def self.endian?
49
- @endianness ||= ([1].pack("I")[0] == 1 ? :little : :big)
49
+ @endianness ||= ([1].pack("I") == "\x01\x00\x00\x00" ? :little : :big)
50
50
  end
51
51
 
52
52
  # Is this endianness native?
@@ -226,6 +226,10 @@ module Ruckus
226
226
  @value.send meth, *args, &block
227
227
  end
228
228
 
229
+ def respond_to?(symbol, include_priv = false)
230
+ !!(super(symbol, include_priv) || @value.respond_to?(symbol, include_priv))
231
+ end
232
+
229
233
  # Traverse all the way to the root of the tree
230
234
  #
231
235
  def root(p = self, &block)
@@ -256,8 +256,8 @@ module Ruckus
256
256
  @value.each {|f| yield f.name, f}
257
257
  end
258
258
 
259
- def respond_to?(meth)
260
- !!(self.class.structure_field_names.include?(meth) || self.find_tag(meth))
259
+ def respond_to?(symbol, include_priv = false)
260
+ !!(super(symbol, include_priv) || @value.respond_to?(symbol, include_priv) || self.class.structure_field_names.include?(symbol) || self.find_tag(symbol))
261
261
  end
262
262
  end
263
263
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruckus}
8
- s.version = "0.5.6"
8
+ s.version = "0.6.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tduehr", "tqbf"]
12
- s.date = %q{2010-04-21}
12
+ s.date = %q{2010-04-28}
13
13
  s.description = %q{Ruckus: A DOM-Inspired Ruby Smart Fuzzer}
14
14
  s.email = %q{td@matasano.com}
15
15
  s.extra_rdoc_files = [
@@ -10,7 +10,6 @@ class TestMutator < Test::Unit::TestCase
10
10
  def test_mutator
11
11
  tm = TestMutation.new
12
12
  mut_int = tm.mfield.permute
13
- pp mut_int
14
13
  mfield, field2 = tm.to_s.unpack("NN")
15
14
  assert_equal(mut_int, mfield)
16
15
  assert_equal(mut_int, tm.mfield.value.to_i)
@@ -15,5 +15,6 @@ class TestRespondTo < Test::Unit::TestCase
15
15
  assert(trc.respond_to?(:tagged_element))
16
16
  assert(trc.respond_to?(:tagged))
17
17
  assert(!trc.respond_to?(:not_a_value))
18
+ assert(trc.respond_to?(:respond_to?))
18
19
  end
19
20
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
7
  - 6
9
- version: 0.5.6
8
+ - 0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - tduehr
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-21 00:00:00 -05:00
18
+ date: 2010-04-28 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency