oggy-looksee 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,80 @@
1
+ require 'spec'
2
+ require 'mocha'
3
+ require 'looksee'
4
+
5
+ require 'set'
6
+
7
+ Spec::Runner.configure do |config|
8
+ config.mock_with :mocha
9
+ end
10
+
11
+ class Object
12
+ #
13
+ # Return this object's singleton class.
14
+ #
15
+ def singleton_class
16
+ class << self; self; end
17
+ end
18
+
19
+ #
20
+ # Return true if the given object include?-s this object.
21
+ #
22
+ def in?(object)
23
+ object.include?(self)
24
+ end
25
+ end
26
+
27
+ class String
28
+ #
29
+ # Remove a left margin delimited by '|'-characters. Useful for
30
+ # heredocs:
31
+ #
32
+ def demargin
33
+ gsub(/^ *\|/, '')
34
+ end
35
+ end
36
+
37
+ #
38
+ # Include these in example groups to add facilities to create
39
+ # temporary classes and modules, which are swept up at the end of each
40
+ # example.
41
+ #
42
+ # Call make_class('ClassName') or make_module('ModuleName') to create
43
+ # a temporary class, then access them with plain constants (ClassName,
44
+ # ModuleName).
45
+ #
46
+ module TemporaryClasses
47
+ def self.included(mod)
48
+ mod.before do
49
+ @temporary_modules = []
50
+ end
51
+
52
+ mod.after do
53
+ @temporary_modules.each do |mod|
54
+ Object.send :remove_const, mod.name
55
+ end
56
+ end
57
+ end
58
+
59
+ #
60
+ # Create a temporary class with the given name and superclass.
61
+ #
62
+ def temporary_class(name, superclass=Object, &block)
63
+ klass = Class.new(superclass)
64
+ Object.const_set(name, klass)
65
+ klass.class_eval(&block) if block
66
+ @temporary_modules << klass
67
+ klass
68
+ end
69
+
70
+ #
71
+ # Create a temporary module with the given name.
72
+ #
73
+ def temporary_module(name, &block)
74
+ mod = Module.new
75
+ Object.const_set(name, mod)
76
+ mod.class_eval(&block) if block
77
+ @temporary_modules << mod
78
+ mod
79
+ end
80
+ end
@@ -0,0 +1,13 @@
1
+ namespace :extconf do
2
+ desc "Compiles the Ruby extension"
3
+ task :compile
4
+ end
5
+
6
+ task :compile => "extconf:compile"
7
+
8
+ task :test => :compile
9
+
10
+ BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}"
11
+ $hoe.clean_globs |= ["ext/**/#{BIN}", "lib/**/#{BIN}", 'ext/**/Makefile']
12
+ $hoe.spec.require_paths = Dir['{lib,ext/*}']
13
+ $hoe.spec.extensions = FileList["ext/**/extconf.rb"].to_a
@@ -0,0 +1,43 @@
1
+ namespace :extconf do
2
+ extension = File.basename(__FILE__, '.rake')
3
+
4
+ ext = "ext/#{extension}"
5
+ ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
6
+ ext_files = FileList[
7
+ "#{ext}/*.c",
8
+ "#{ext}/*.h",
9
+ "#{ext}/*.rl",
10
+ "#{ext}/extconf.rb",
11
+ "#{ext}/Makefile",
12
+ # "lib"
13
+ ]
14
+
15
+
16
+ task :compile => extension do
17
+ if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
18
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
19
+ STDERR.puts "Gem actually failed to build. Your system is"
20
+ STDERR.puts "NOT configured properly to build looksee."
21
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
22
+ exit(1)
23
+ end
24
+ end
25
+
26
+ desc "Builds just the #{extension} extension"
27
+ task extension.to_sym => ["#{ext}/Makefile", ext_so ]
28
+
29
+ file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
30
+ Dir.chdir(ext) do ruby "extconf.rb" end
31
+ end
32
+
33
+ file ext_so => ext_files do
34
+ Dir.chdir(ext) do
35
+ sh(RUBY_PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
36
+ if !ok
37
+ require "fileutils"
38
+ FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: oggy-looksee
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - George Ogata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-05 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: newgem
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.5.1
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.7
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: mocha
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.9.5
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: hoe
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 2.3.2
54
+ version:
55
+ description: Looksee lets you examine the method lookup path of objects in ways not possible in plain ruby.
56
+ email:
57
+ - george.ogata@gmail.com
58
+ executables: []
59
+
60
+ extensions:
61
+ - ext/looksee/extconf.rb
62
+ extra_rdoc_files:
63
+ - History.txt
64
+ - Manifest.txt
65
+ files:
66
+ - .autotest
67
+ - History.txt
68
+ - Manifest.txt
69
+ - README.rdoc
70
+ - Rakefile
71
+ - ext/looksee/extconf.rb
72
+ - ext/looksee/looksee.c
73
+ - ext/looksee/node-1.9.h
74
+ - lib/looksee.rb
75
+ - lib/looksee/shortcuts.rb
76
+ - lib/looksee/version.rb
77
+ - script/console
78
+ - script/destroy
79
+ - script/generate
80
+ - spec/looksee_spec.rb
81
+ - spec/spec_helper.rb
82
+ - tasks/extconf.rake
83
+ - tasks/extconf/looksee.rake
84
+ has_rdoc: false
85
+ homepage: http://github.com/oggy/looksee
86
+ post_install_message:
87
+ rdoc_options:
88
+ - --main
89
+ - README.rdoc
90
+ require_paths:
91
+ - lib
92
+ - ext/looksee
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: "0"
98
+ version:
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: "0"
104
+ version:
105
+ requirements: []
106
+
107
+ rubyforge_project: looksee
108
+ rubygems_version: 1.2.0
109
+ signing_key:
110
+ specification_version: 3
111
+ summary: Looksee lets you examine the method lookup path of objects in ways not possible in plain ruby.
112
+ test_files: []
113
+