Code Monkey home page Code Monkey logo

looksee's Issues

Add support for truffleruby.

excellent truffler on his toword 1.0.0 way. (1.0.0 RC6 soon), it now support mysql2 pg, nokogiri etc, i think maybe it is the time have a try in little ruby production project.,

i want to know weather it is possible to worked with Looksee.

Thanks

Ruby 2.3 Support

Hi oggy,

looksee does not work for the new 2.3:

$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
$ gem install looksee
Building native extensions.  This could take a while...
ERROR:  Error installing looksee:
    ERROR: Failed to build gem native extension.

    current directory: /home/dan/.rvm/gems/ruby-2.3.0/gems/looksee-3.1.0/ext
/home/dan/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20151230-10586-1sk6yy2.rb extconf.rb
creating Makefile

current directory: /home/dan/.rvm/gems/ruby-2.3.0/gems/looksee-3.1.0/ext
make "DESTDIR=" clean

current directory: /home/dan/.rvm/gems/ruby-2.3.0/gems/looksee-3.1.0/ext
make "DESTDIR="
compiling mri/mri.c
In file included from mri/2.2.0/method.h:14:0,
                 from mri/mri.c:4:
mri/2.2.0/internal.h: In function ‘RCLASS_M_TBL_INIT’:
mri/2.2.0/internal.h:483:43: error: ‘struct RClassDeprecated’ has no member named ‘m_tbl_wrapper’
 #define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
                                           ^
mri/2.2.0/internal.h:497:5: note: in expansion of macro ‘RCLASS_M_TBL_WRAPPER’
     RCLASS_M_TBL_WRAPPER(c) = wrapper;
     ^
mri/2.2.0/internal.h: In function ‘RCLASS_SUPER’:
mri/2.2.0/internal.h:504:25: error: ‘struct RClassDeprecated’ has no member named ‘super’
     return RCLASS(klass)->super;
                         ^
In file included from /home/dan/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby.h:33:0,
                 from mri/mri.c:1:
mri/2.2.0/internal.h: In function ‘RCLASS_SET_SUPER’:
mri/2.2.0/internal.h:514:39: error: ‘struct RClassDeprecated’ has no member named ‘super’
     RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
                                       ^
/home/dan/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/ruby.h:1475:75: note: in definition of macro ‘RB_OBJ_WRITE’
 #define RB_OBJ_WRITE(a, slot, b)       rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)
                                                                           ^
In file included from mri/2.2.0/method.h:14:0,
                 from mri/mri.c:4:
mri/mri.c: In function ‘internal_instance_methods’:
mri/2.2.0/internal.h:483:43: error: ‘struct RClassDeprecated’ has no member named ‘m_tbl_wrapper’
 #define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
                                           ^
mri/2.2.0/internal.h:484:26: note: in expansion of macro ‘RCLASS_M_TBL_WRAPPER’
 #define RCLASS_M_TBL(c) (RCLASS_M_TBL_WRAPPER(c) ? RCLASS_M_TBL_WRAPPER(c)->tbl : 0)
                          ^
mri/mri.c:154:32: note: in expansion of macro ‘RCLASS_M_TBL’
   Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_matching, (st_data_t)&arg);
                                ^
mri/2.2.0/internal.h:483:43: error: ‘struct RClassDeprecated’ has no member named ‘m_tbl_wrapper’
 #define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
                                           ^
mri/2.2.0/internal.h:484:52: note: in expansion of macro ‘RCLASS_M_TBL_WRAPPER’
 #define RCLASS_M_TBL(c) (RCLASS_M_TBL_WRAPPER(c) ? RCLASS_M_TBL_WRAPPER(c)->tbl : 0)
                                                    ^
mri/mri.c:154:32: note: in expansion of macro ‘RCLASS_M_TBL’
   Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_matching, (st_data_t)&arg);
                                ^
mri/mri.c: In function ‘Looksee_internal_undefined_instance_methods’:
mri/2.2.0/internal.h:483:43: error: ‘struct RClassDeprecated’ has no member named ‘m_tbl_wrapper’
 #define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
                                           ^
mri/2.2.0/internal.h:484:26: note: in expansion of macro ‘RCLASS_M_TBL_WRAPPER’
 #define RCLASS_M_TBL(c) (RCLASS_M_TBL_WRAPPER(c) ? RCLASS_M_TBL_WRAPPER(c)->tbl : 0)
                          ^
mri/mri.c:188:32: note: in expansion of macro ‘RCLASS_M_TBL’
   Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_undefined, (st_data_t)&names);
                                ^
mri/2.2.0/internal.h:483:43: error: ‘struct RClassDeprecated’ has no member named ‘m_tbl_wrapper’
 #define RCLASS_M_TBL_WRAPPER(c) (RCLASS(c)->m_tbl_wrapper)
                                           ^
mri/2.2.0/internal.h:484:52: note: in expansion of macro ‘RCLASS_M_TBL_WRAPPER’
 #define RCLASS_M_TBL(c) (RCLASS_M_TBL_WRAPPER(c) ? RCLASS_M_TBL_WRAPPER(c)->tbl : 0)
                                                    ^
mri/mri.c:188:32: note: in expansion of macro ‘RCLASS_M_TBL’
   Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_undefined, (st_data_t)&names);
                                ^
mri/mri.c: In function ‘Looksee_singleton_instance’:
mri/2.2.0/internal.h:480:33: error: ‘struct RClassDeprecated’ has no member named ‘ptr’
 #define RCLASS_EXT(c) (RCLASS(c)->ptr)
                                 ^
mri/2.2.0/internal.h:481:27: note: in expansion of macro ‘RCLASS_EXT’
 #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
                           ^
mri/mri.c:208:38: note: in expansion of macro ‘RCLASS_IV_TBL’
     if (!Looksee_method_table_lookup(RCLASS_IV_TBL(singleton_class), rb_intern("__attached__"), (st_data_t *)&object))
                                      ^
mri/2.2.0/internal.h: In function ‘RCLASS_SUPER’:
mri/2.2.0/internal.h:505:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Makefile:238: recipe for target 'mri.o' failed
make: *** [mri.o] Error 1

make failed, exit code 2

(2.0.0) gem installation fails on Ruby 2.1.0

$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]

$ gem install looksee -v 2.0.0
Building native extensions.  This could take a while...
ERROR:  Error installing looksee:
    ERROR: Failed to build gem native extension.

    /Users/howaboutwe/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mri/mri.c
In file included from mri/mri.c:4:
In file included from mri/2.1.0/method.h:14:
mri/2.1.0/internal.h:209:22: error: expected ')'
nlz_int128(uint128_t x)
                     ^
mri/2.1.0/internal.h:209:11: note: to match this '('
nlz_int128(uint128_t x)
          ^
mri/2.1.0/internal.h:211:5: error: redefinition of '__int128'
    uint128_t y;
    ^
/Users/howaboutwe/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/x86_64-darwin12.0/ruby/config.h:164:28: note: instantiated from:
#define uint128_t unsigned __int128
                           ^
mri/2.1.0/internal.h:209:12: note: previous definition is here
nlz_int128(uint128_t x)
           ^
/Users/howaboutwe/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/x86_64-darwin12.0/ruby/config.h:164:28: note: instantiated from:
#define uint128_t unsigned __int128
                           ^
In file included from mri/mri.c:4:
In file included from mri/2.1.0/method.h:14:
mri/2.1.0/internal.h:211:14: error: expected ';' at end of declaration
    uint128_t y;
             ^
             ;
mri/2.1.0/internal.h:213:5: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
    ^
mri/2.1.0/internal.h:213:9: error: use of undeclared identifier 'x'
    y = x >> 64; if (y) {n -= 64; x = y;}
        ^
mri/2.1.0/internal.h:213:22: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
                     ^
mri/2.1.0/internal.h:213:35: error: use of undeclared identifier 'x'
    y = x >> 64; if (y) {n -= 64; x = y;}
                                  ^
mri/2.1.0/internal.h:213:39: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
                                      ^
mri/2.1.0/internal.h:214:5: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
    ^
mri/2.1.0/internal.h:214:9: error: use of undeclared identifier 'x'
    y = x >> 32; if (y) {n -= 32; x = y;}
        ^
mri/2.1.0/internal.h:214:22: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
                     ^
mri/2.1.0/internal.h:214:35: error: use of undeclared identifier 'x'
    y = x >> 32; if (y) {n -= 32; x = y;}
                                  ^
mri/2.1.0/internal.h:214:39: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
                                      ^
mri/2.1.0/internal.h:215:5: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
    ^
mri/2.1.0/internal.h:215:9: error: use of undeclared identifier 'x'
    y = x >> 16; if (y) {n -= 16; x = y;}
        ^
mri/2.1.0/internal.h:215:22: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
                     ^
mri/2.1.0/internal.h:215:35: error: use of undeclared identifier 'x'
    y = x >> 16; if (y) {n -= 16; x = y;}
                                  ^
mri/2.1.0/internal.h:215:39: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
                                      ^
mri/2.1.0/internal.h:216:5: error: use of undeclared identifier 'y'
    y = x >>  8; if (y) {n -=  8; x = y;}
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [mri.o] Error 1

make failed, exit code 2

(Object doesn't support #inspect)

Can not looksee ActiveRecord instance objects anymore after upgrading to rails 4.1.0. It was working fine with 4.1.0rc. I have not added any new gems to the project but some of outdated gems are updated in the process.

AnyClass.ls works fine. AnyClass.new.ls returns empty printing out (Object doesn't support #inspect).

require-ing in irbrc shows warning "can't alias ls from irb_ls"

When one requires this gem in the irbrc file, you get a warning on irb startup, from ruby 2.7 onwards (tested in 2.7.1 and 3.0.0):

% irb -f -r'looksee'
irb: warn: can't alias ls from irb_ls.
irb(main):001:0>

If you require the gem after irb has finished loading, there is no issue.

% irb -f
irb(main):001:0> require 'looksee'
=> true
irb(main):002:0>

Main difference seems to be the result of show_source 'ls' (in REPL). For the startup (and command line) case it shows Looksee, otherwise irb/extend-command.rb.

Warning goes away if one adds Looksee.rename :_ls to irbrc ... but considering this happens for a straightforward installation, it seems like that should not be necessary. Would be great if require-ing looksee in irbrc and during REPL would behave the same way.

Probably relevant:

on ruby-1.9.3-preview1 looksee won't work

Hi,

I got this error: looksee-1.0.2/lib/looksee/mri.so: undefined symbol: RCLASS_M_TBL

also this on startup of the rails console: looksee-1.0.2/lib/looksee/adapter.rb:6: Use RbConfig instead of obsolete and deprecated Config.

Looksee[] and ls method is not work in ActiveRecord instance.

When in rails console, ls and Looksee[] seem like not work on ActiveRecord instance in some case.

pry):0> user.ls
SystemStackError: stack level too deep
from /home/zw963/.rvm/gems/ruby-2.1.1@neil-rails-app/gems/pry-0.10.0/lib/pry/pry_instance.rb:353
(pry):0> Looksee[user]
(pry) output error: #<NoMethodError: undefined method `is_a?' for #<#<Module:0x00000002e66430>:0x00000002e65c88>>

but, in this situation, I can use user.methods to return user all methods.

Invalid gemspec created when installing looksee 1.0.3

Gemspec created when installing looksee 1.0.3: https://gist.github.com/1207464
The YAML objects present in the conditional block from line 21 to 37 are not valid.
This causes any call to the 'gem' command to throw the following error:
Invalid gemspec in [/PATH/TO/GEMS/ruby-1.8.7-p302/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7fb59006c528> 0.3.0"]

Environment:
ruby: 1.8.7-p302
rubygems: 1.5.3

[req] Find out where a object is defined?

Looksee is amazing. If you're busy–just tell me where to add this feature, and I'll be happy to dig around and try my luck :).

It's so great for digging up the unbearable. One thing I'd like to request–or maybe there's already a way?–is for me to figure out where a class was defined. Generally I can just #ls and pick a method from the, or do stuff.edit 'initialize'. It'd be really helpful to be able to do something.edit true or something.edit :defined etc.

Thank you for making Looksee. It's a real boon for devops data trolls like me.

Installing On Mac OSX Lion

Building native extensions. This could take a while...
ERROR: Error installing looksee:
ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb

creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mri/mri.c
In file included from mri/2.1.0/method.h:14,
from mri/mri.c:4:
mri/2.1.0/internal.h:209: error: expected ‘;’, ‘,’ or ‘)’ before ‘x’
make: *** [mri.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.2@malibu/gems/looksee-2.1.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.2@malibu/extensions/x86_64-darwin-13/2.1.0-static/looksee-2.1.1/gem_make.out

I tried all the suggestions in a previous issue (upgraded xcode to 4.6). Here is gcc:

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

I tried uninstall reinstalling ruby after updating xcode but still no go.

Not working with ruby 2.2

Can not compile

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/pavel/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150102-39460-aki2aj.rb extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mri/mri.c
In file included from mri/mri.c:4:
In file included from mri/2.1.0/method.h:14:
mri/2.1.0/internal.h:561:32: error: incomplete definition of type 'struct RFloat'
    return ((struct RFloat *)v)->float_value;
           ~~~~~~~~~~~~~~~~~~~~^
mri/2.1.0/internal.h:561:21: note: forward declaration of 'struct RFloat'
    return ((struct RFloat *)v)->float_value;
                    ^
1 error generated.
make: *** [mri.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/pavel/.rvm/gems/ruby-2.2.0/gems/looksee-2.1.1 for inspection.
Results logged to /Users/pavel/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-13/2.2.0-static/looksee-2.1.1/gem_make.out
An error occurred while installing looksee (2.1.1), and Bundler cannot continue.
Make sure that `gem install looksee -v '2.1.1'` succeeds before bundling.

Looksee missing some methods of a sequel record object.

Following is a reproduceable one file ruby script to reproduce this.

#!/usr/bin/env ruby

begin
  require "bundler/inline"
rescue LoadError => e
  $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
  raise e
end

gemfile(true) do
  source "https://rubygems.org"
  gem 'sequel'
  gem 'sqlite3'
  gem 'looksee'
end

require 'fileutils'
require 'looksee'

if File.exist?('test.db')
  FileUtils.rm('test.db')
end

DB_URL = 'sqlite://test.db'
DB = Sequel.connect(DB_URL)
DB.extension :pagination

DB.create_table(:tests, :ignore_index_errors=>true) do
  primary_key :id
  String :name, :text=>true
end

class Test < Sequel::Model
end

Test.create(name: 'name1')
Test.create(name: 'name2')

test = Test.dataset.paginate(1, 1)

p Looksee[test, /page/]
puts '-'*100
puts test.methods.grep /page/

When run above code, looksee will output result like this:

image

as you can see, following method all defined on test.

current_page
current_page_record_range
current_page_record_count
page_count
page_size
last_page?
first_page?
page_range
next_page
prev_page
paged_each
each_page

But, Looksee only can see several of them.

Sequel::Dataset
  paged_each
Sequel::DatasetPagination
  each_page

this issue may caused by roda plugins system, anyway, here have a blog maybe help on this.

Thank you.

Invalid gemspec file

similar to this issue:
rubygems/bundler#1235

bundler version: 1.0.18
rake version: 0.9.2
ruby version: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

stdout:
Installing looksee (1.0.3) with native extensions Invalid gemspec in [/home/bordicon/.rvm/gems/ruby-1.8.7-p352@indinero_ey_test/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["#YAML::Syck::DefaultKey:0x7fd385ef6220 0.3.0"]

Looksee 4.0 not worked for 2.2

It work well with Ruby 2.3.0

But when switch back to 2.2, with previous compiled version so files
But update rb files to newest version, it seem like not work.

Using /home/zw963/.rvm/gems/ruby-2.2.4

 ╭─ 01:32  zw963  ~/Dropbox/common/ruby   (2bfddff) master *$% u+10  ruby-2.2.4
 ╰─ $ pry
(pry):0> "hello".ls /case/
=> #<Looksee::Inspector:0x100d95c>
(pry):0> 

Doesn't install on Win32

First it couldn't find cl.exe, and when I installed it with VC++ Express Edition, I got this:

D:\my_dir>gem install looksee
Building native extensions.  This could take a while...
ERROR:  Error installing looksee:
        ERROR: Failed to build gem native extension.

c:/app/ruby/bin/ruby.exe extconf.rb
creating Makefile

nmake

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -nologo -I. -Ic:/app/ruby/lib/ruby/1.8/i386-mswin32 -Ic:/app/ruby/lib
/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -DRUBY_VERSION=186 -c -Tclooksee
.c
cl : Command line warning D9035 : option 'Og-' has been deprecated and will be r
emoved in a future release
cl : Command line warning D9002 : ignoring unknown option '-G6'
looksee.c
c:\app\ruby\lib\ruby\1.8\i386-mswin32\config.h(2) : fatal error C1189: #error :
 MSC version unmatch
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
\cl.EXE"' : return code '0x2'
Stop.

Ruby 2.6.0 support.

Ruby 2.6.0 is released yesterday.

When i try to install it, got following errors:

Fetching looksee-4.0.0.gem
Building native extensions. This could take a while...
ERROR:  Error installing looksee:
        ERROR: Failed to build gem native extension.

    current directory: /home/zw963/.rvm/gems/ruby-2.6.0@looksee/gems/looksee-4.0.0/ext
/home/zw963/.rvm/rubies/ruby-2.6.0/bin/ruby -I /home/zw963/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0 -r ./siteconf20181226-5090-146ozzi.rb extconf.rb
creating Makefile

current directory: /home/zw963/.rvm/gems/ruby-2.6.0@looksee/gems/looksee-4.0.0/ext
make "DESTDIR=" clean

current directory: /home/zw963/.rvm/gems/ruby-2.6.0@looksee/gems/looksee-4.0.0/ext
make "DESTDIR="
compiling mri/mri.c
In file included from mri/2.3.0/internal.h:16:0,
                 from mri/2.3.0/method.h:14,
                 from mri/mri.c:7:
/home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby/encoding.h:16:2: error: #error "Include this file before internal.h"
 #error "Include this file before internal.h"
  ^~~~~
In file included from mri/2.3.0/internal.h:17:0,
                 from mri/2.3.0/method.h:14,
                 from mri/mri.c:7:
/home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby/io.h:16:2: error: #error "Include this file before internal.h"
 #error "Include this file before internal.h"
  ^~~~~
In file included from mri/2.3.0/method.h:14:0,
                 from mri/mri.c:7:
mri/2.3.0/internal.h:48:0: warning: "WARN_UNUSED_RESULT" redefined
 #define WARN_UNUSED_RESULT(x) x __attribute__((warn_unused_result))
 
In file included from /home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby/ruby.h:24:0,
                 from /home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby.h:33,
                 from mri/mri.c:1:
/home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/x86_64-linux/ruby/config.h:149:0: note: this is the location of the previous definition
 #define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x

In file included from mri/2.3.0/method.h:14:0,
                 from mri/mri.c:7:
mri/2.3.0/internal.h:70:0: warning: "GCC_VERSION_SINCE" redefined
 #define GCC_VERSION_SINCE(major, minor, patchlevel) \

In file included from /home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby/ruby.h:29:0,
                 from /home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby.h:33,
                 from mri/mri.c:1:
/home/zw963/.rvm/rubies/ruby-2.6.0/include/ruby-2.6.0/ruby/defines.h:62:0: note: this is the location of the previous definition
 #  define GCC_VERSION_SINCE(major, minor, patchlevel) \

In file included from mri/2.3.0/method.h:14:0,
                 from mri/mri.c:7:
mri/2.3.0/internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
                              ^
mri/2.3.0/internal.h:84:30: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
mri/mri.c:15:12: warning: ‘add_method_if_undefined’ defined but not used [-Wunused-function]
 static int add_method_if_undefined(ID method_name, rb_method_entry_t *me, VALUE *names) {
            ^~~~~~~~~~~~~~~~~~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-cast-function-type’
make: *** [Makefile:244: mri.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/zw963/.rvm/gems/ruby-2.6.0@looksee/gems/looksee-4.0.0 for inspection.
Results logged to /home/zw963/.rvm/gems/ruby-2.6.0@looksee/extensions/x86_64-linux/2.6.0/looksee-4.0.0/gem_make.out

*** LOCAL GEMS ***

Looksee fails with instances of classes that use the equalizer gem

Let's say we have the following class that uses the equalizer gem:

require 'equalizer'

class GeoLocation
  include Equalizer.new(:latitude, :longitude)

  attr_reader :latitude, :longitude

  def initialize(latitude, longitude)
    @latitude, @longitude = latitude, longitude
  end
end

Looksee fails with objects of this class like this:

2.1.1 :001 > require 'looksee'
 => true 
2.1.1 :002 > x = GeoLocation.new(1,2)
 => #<GeoLocation latitude=1 longitude=2> 
2.1.1 :003 > x.ls
(Object doesn't support #inspect)
 =>  
2.1.1 :004 > x.inspect
 => "#<GeoLocation latitude=1 longitude=2>" 

problem in rails console

when I run lp [] in irb everything is fine, but when running the same command in rails console I get something like this:

ESC[1;37mArrayESC[0m
ESC[1;32m&ESC[0m ESC[1;32mcompact!ESC[0m ESC[1;32minclude?ESC[0m
ESC[1;32mrassocESC[0m ESC[1;32mto_aESC[0m

the ansi colors are working fine in irb but in rails console they just make a mess in way that makes it unusable!

why the newgem dependency?

$ irb
irb(main):001:0> require 'rubygems'
irb(main):002:0> require 'looksee/shortcuts'
Gem::LoadError: Could not find RubyGem newgem (>= 1.5.1)

$ sudo gem install newgem
ERROR:  Error installing newgem:
hoe requires RubyGems version >= 1.3.1 

$ sudo wajig install rubygems
rubygems is already the newest version.

I shouldn't need to update my rubygems manually just to use looksee

Bus Error when lp called on Fixnum/TrueClass/FalseClass/NilClass/Symbol instances (1.8.7, 1.9)

irb(main):001:0> lp true
/opt/local/lib/ruby/gems/1.8/gems/looksee-0.0.1/lib/looksee.rb:130: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]

This also happens for Fixnums, false, nil, and literal symbols.

This problem happens here:
VALUE Looksee_internal_class(VALUE self, VALUE object) {
return RBASIC(object)->klass;
}

Fixed here:

Will send a pull request.

Segmentation fault with Struct.ls

Following log from irb explaining problem:

$ irb
ruby-1.9.3-p0 :001 > require 'ostruct'
 => true 
ruby-1.9.3-p0 :002 > Struct.ls
/home/antage/.rvm/gems/ruby-1.9.3-p0/gems/looksee-1.0.3/lib/looksee/lookup_path.rb:88: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

-- Control frame information -----------------------------------------------
[1]    5180 segmentation fault  irb

$ uname -a
Linux desktop 3.0.0-15-generic #25-Ubuntu SMP Mon Jan 2 17:44:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Editing methods of included modules is broken

2.1.1 :008 > URI.ls.edit(:encode)
NoMethodError: undefined method `instance_method' for #<URI::Escape:0x007fcef4974e18>
    from /Users/g/.rvm/gems/ruby-2.1.1/gems/looksee-2.1.0/lib/looksee/lookup_path.rb:31:in `block in find'
    from /Users/g/.rvm/gems/ruby-2.1.1/gems/looksee-2.1.0/lib/looksee/lookup_path.rb:24:in `each'
    from /Users/g/.rvm/gems/ruby-2.1.1/gems/looksee-2.1.0/lib/looksee/lookup_path.rb:24:in `find'
    from /Users/g/.rvm/gems/ruby-2.1.1/gems/looksee-2.1.0/lib/looksee/editor.rb:16:in `edit'
    from /Users/g/.rvm/gems/ruby-2.1.1/gems/looksee-2.1.0/lib/looksee/inspector.rb:32:in `edit'
    from (irb):8
    from /Users/g/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'

Because entry.module is now an included class.

Can't install on windows.

Hello.

Trying to build on windows - no luck. Here is my error message ( running on Ruby 1.9.2 p290 on windows 7 with devkit ).

PS D:\Projects\Web\ajrintl.com\ajr> gem install looksee
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing looksee:
ERROR: Failed to build gem native extension.

    C:/ruby/Ruby192/bin/ruby.exe extconf.rb

creating Makefile

make
C:/ruby/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_mri'" > mri-i386-mingw32.def
gcc -I. -IC:/ruby/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/ruby/Ruby192/include/ruby-1.9.1/ruby/backward -I/C/ruby/Ruby192/include/ruby-1.9.1 -Imri -DRUBY_VERSION=192 -Imri/1.9.2 -O3 -g -Wextra
-Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o mri.o -c mri/mri.c
In file included from mri/mri.c:9:0:
mri/1.9.2/vm_core.h:27:26: fatal error: thread_win32.h: No such file or directory
compilation terminated.
make: *** [mri.o] Error 1

Did anyone have any luck with this? Thank you

It doesn't work on Ruby 1.9.2?

After I install looksee on Ruby 1.9.2 in my ubuntu. I got the error:

/home/samnang/.rvm/gems/ruby-1.9.2-p0/gems/looksee-0.2.1/lib/looksee.rb:237: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

-- control frame ----------
c:0033 p:---- s:0131 b:0131 l:000130 d:000130 CFUNC :internal_public_instance_methods

Thanks,
Samnang

can not use Looksee for action_mailer

Hi, I tried to see all method of ActionMailer::Base using ls, but it give you error AbstractController::ActionNotFound: The action 'ls' could not be found for ActionMailer::Base. It is related with method_missing from ruby feature. it is the method_missing of ActionMailer::Base :

      def method_missing(method_name, *args) # :nodoc:
        if action_methods.include?(method_name.to_s)
          MessageDelivery.new(self, method_name, *args)
        else
          super
        end
      end

does looksee not support for class that using method_missing? 😄
thanks.

not output correct when use with irb. (it works with pry)

Following is output.

^[[1;37m[Roda::RodaPlugins::Sprockets::Task instance]^[[0m
  ^[[1;32mbindings^[[0m                     ^[[1;32mirb_cwb^[[0m                      ^[[1;32mkill^[[0m       
  ^[[1;32mcb^[[0m                           ^[[1;32mirb_cws^[[0m                      ^[[1;32mls^[[0m         
  ^[[1;32mchws^[[0m                         ^[[1;32mirb_cwws^[[0m                     ^[[1;32mmeasure^[[0m    
  ^[[1;32mconf^[[0m                         ^[[1;32mirb_pop_binding^[[0m              ^[[1;32mpopb^[[0m       
  ^[[1;32mcontext^[[0m                      ^[[1;32mirb_popb^[[0m                     ^[[1;32mpopws^[[0m      
  ^[[1;32mcws^[[0m                          ^[[1;32mirb_popws^[[0m                    ^[[1;32mpushb^[[0m      
  ^[[1;32mcwws^[[0m                         ^[[1;32mirb_print_working_binding^[[0m    ^[[1;32mpushws^[[0m     
  ^[[1;32mexit^[[0m                         ^[[1;32mirb_print_working_workspace^[[0m  ^[[1;32mpwws^[[0m       
  ^[[1;32mfg^[[0m                           ^[[1;32mirb_push_binding^[[0m             ^[[1;32mquit^[[0m       
  ^[[1;32mhelp^[[0m                         ^[[1;32mirb_pushb^[[0m                    ^[[1;32mshow_source^[[0m
  ^[[1;32mirb_bindings^[[0m                 ^[[1;32mirb_pushws^[[0m                   ^[[1;32msource^[[0m     
  ^[[1;32mirb_cb^[[0m                       ^[[1;32mirb_pwb^[[0m                      ^[[1;32mwhereami^[[0m   
  ^[[1;32mirb_change_binding^[[0m           ^[[1;32mirb_pwws^[[0m                     ^[[1;32mworkspaces^[[0m 
  ^[[1;32mirb_chws^[[0m                     ^[[1;32mirb_quit^[[0m                   
  ^[[1;32mirb_current_working_binding^[[0m  ^[[1;32mjobs^[[0m    

I consider this is not same reason as https://github.com/oggy/looksee#ansi-escapes, because outout not same, and when i set export LESS='-R' instead, still get same result.

But ls works quite well with pry, test it on ruby 2.7.1 and ruby 3.0.2

Thank you.

Looksee for Wirble's Tab Completion

Wirble has method tab completion, but it's a flat list. I wonder if Looksee could hook into that and become a better tab completion?

Pagination would be nice too.

Broken with ruby 2.1.0

Installing looksee (1.1.0) 
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/pavel/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mri/mri.c
mri/mri.c:173:32: error: no member named 'm_tbl' in 'struct RClass'
  Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_matching, (st_data_t)&arg);
                               ^~~~~~~~~~~~~~~~~~~
mri/2.0.0/internal.h:40:37: note: expanded from macro 'RCLASS_M_TBL'
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
                         ~~~~~~~~~  ^
mri/mri.c:207:32: error: no member named 'm_tbl' in 'struct RClass'
  Looksee_method_table_foreach(RCLASS_M_TBL(klass), add_method_if_undefined, (st_data_t)&names);
                               ^~~~~~~~~~~~~~~~~~~
mri/2.0.0/internal.h:40:37: note: expanded from macro 'RCLASS_M_TBL'
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
                         ~~~~~~~~~  ^
2 errors generated.
make: *** [mri.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/pavel/.rvm/gems/ruby-2.1.0/gems/looksee-1.1.0 for inspection.
Results logged to /Users/pavel/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-13/2.1.0/looksee-1.1.0/gem_make.out

An error occurred while installing looksee (1.1.0), and Bundler cannot continue.
Make sure that `gem install looksee -v '1.1.0'` succeeds before bundling.

Compatibility problem with ActiveAdmin gem

When used alongwith ActiveAdmin gem, the Edit views (of entities registered in admin) always raise this error:


Unknown action

AbstractController::ActionNotFound


( My setup : Rails 3.1.3 , Ruby 1.9.3 , rbEnv )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.