by thomthom » Wed Jan 05, 2011 10:00 pm
There's a few Notepad++ Autocomplete for SketchUp API Ruby - I've been using one variant (can't remember which one.) Today I updated it to include the methods in SU8 which where missing. And I removed some redundant duplicate lines. Another change I made was remove the extra space after method names. Two reasons for that: 1. personal preference, I like to use brackets. 2. it allowed me to add argument hints to methods. NPAC.png The argument hints is a lot of work. I only did a couple for test. If anyone care to help out I'd be very happy. There appear to be something not working quite right. I'm not getting all the words in the suggestion list. For instance, it won't display "Sketchup" as a suggestion - despite it being there in the list. Fixed it!Download Revision 2 - the two of you who downloaded Revision 1. InstallCopy to C:\Program Files (x86)\Notepad++\plugins\APIs (Adapt to your Notepad++ installtion) Settings > Preferences... > Backup/Auto-Completion NPAC-Pref.png Revision 3 - 01.02.2011Rebuilt the list from scratch. Used only the classes and methods from Ruby 1.8.6 and SketchUp API. (The old file seemed to have lots of Ruby On Rails references.) Moved to BitBucket - 03.02.2011Find the ruby.xml file at the BitBucket repository: https://bitbucket.org/thomthom/notepad-sketchup-autocomplete/Direct link to ZIP: https://bitbucket.org/thomthom/notepad-sketchup-autocomplete/get/tip.zip
Please, register (free) to access all the attachments on the forums.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by dereeei » Wed Jan 05, 2011 10:28 pm
Ohh, awesome !! I had two versions, one I guess was made by Didier Bur (if I am not mistaking) and other was only for Ruby (from npp website). Thank you!
-
dereeei
-
- Posts: 564
- Joined: Tue Nov 16, 2010 1:48 pm
- Name: derei
by jason_maranto » Wed Jan 05, 2011 11:04 pm
Thank-you from me as well.
I create video tutorial series about several 2D & 3D graphics programs.
-

jason_maranto
-
- Posts: 895
- Joined: Thu Feb 04, 2010 7:57 pm
- Location: Temple Terrace, FL - USA
- Name: Jason Maranto
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: illustration, cartoons
- Level of SketchUp: Advanced
-
by Jim » Wed Jan 05, 2011 11:22 pm
I only use Npp occasionally, but can test it out - what do i do with the file and how to I activate auto-complete?
-
Jim
- Global Moderator
-
- Posts: 4126
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: NEOH
- Name: Jim
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Intermediate
-
by thomthom » Wed Jan 05, 2011 11:55 pm
Jim wrote:I only use Npp occasionally, but can test it out - what do i do with the file and how to I activate auto-complete?
Added Install info in first post.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Thu Jan 06, 2011 4:16 pm
thomthom wrote:There appear to be something not working quite right. I'm not getting all the words in the suggestion list. For instance, it won't display "Sketchup" as a suggestion - despite it being there in the list. Auto Completion Wiki"The basic character set used to recognise keywords is made of letters a-z, A-Z, 0-9 digis and the underscore. You can add more characters ... by specifying he additionalWordChars parameter in the environment." So wouldn't we need a additionalWordChars=" .:" attribute in the Environment tag, to allow space, dot and colon (in Keywords) ?? EDIT: add "=" to that list.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by thomthom » Thu Jan 06, 2011 4:30 pm
Ah - good link. I was looking for a resource like that.
Why you need dot colon in keywords? = Seem to work anyway. Space was already there.
I made this definition so getters would be "materials.current"
setters would be "materials.current ="
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by thomthom » Thu Jan 06, 2011 4:32 pm
Depending on the value of the 'ignoreCase' attribute in the 'Environment' element, the XML file has to be sorted case sensitive or case insensitive (if the attribute is absent it will default to case sensitive).
Ah! Well that explains a few things!
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Thu Jan 06, 2011 4:33 pm
thomthom wrote:Why you need dot colon in keywords? = Seem to work anyway. Space was already there.
Just wondering if it was required so that the feature can lookup things correctly.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Thu Jan 06, 2011 4:45 pm
Dan Rathbun wrote:thomthom wrote:Why you need dot colon in keywords? = Seem to work anyway. Space was already there.
Just wondering if it was required so that the feature can lookup things correctly.
More information on this link: Autocompletion, aka API, files, which says: additionalWordChar: character(s) that may be part of words and which are not a lower or upper case letter, a digit or the underscore. The value is a string with all these extra characters, in any order and without separators. The string is empty by default. EDIT .. more info from that page: Names For both call tips and autocompletion to work, keywords must be words, ie identifiers most languages would readily accept. This means that only the 26 Latin alphabet letters in either lower or upper case (no diacritics), digits and the underscore are safe to use. Additional allowed characters will work if they are not whitespace. Autocompletion may cope with spaces or blanks, call tips won't. This is a Scintilla limitation.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by tomasz » Wed Jan 12, 2011 3:19 pm
Thank you!
-
tomasz
- SU2TH & SU2KT Developer
-
- Posts: 768
- Joined: Fri Nov 16, 2007 8:46 pm
- Location: Poland
- Name: Tomasz
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by thomthom » Tue Feb 01, 2011 9:02 pm
Revision 3 - 01.02.2011 Rebuilt the list from scratch. Used only the classes and methods from Ruby 1.8.6 and SketchUp API. (The old file seemed to have lots of Ruby On Rails references.)
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Tue Feb 01, 2011 9:47 pm
I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis. Notepad++ got confused and took them to be a parameter (argument) list.
Last edited by Dan Rathbun on Tue Feb 01, 2011 9:56 pm, edited 1 time in total.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Tue Feb 01, 2011 9:55 pm
Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Examples:
Math::PI
File::SEPARATOR
Sketchup::Drawingelement
UI::Toolbar
etc. ??
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by thomthom » Tue Feb 01, 2011 10:04 pm
Dan Rathbun wrote:I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis. Dan Rathbun wrote:Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Yes, it's possible. Some Ruby classes are listed like that. File for instance. (Just ripped it directly from the docs.) Is there a list of available? (I just ripped the class names and methods from the Ruby docs and SU docs - without further processing.) So constants and nesting is missing.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Tue Feb 01, 2011 10:13 pm
thomthom wrote:Dan Rathbun wrote:I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis.
These are the ones that caused problems (but the ver 3 does not have them.) old_NPP_autocomplete.png
Please, register (free) to access all the attachments on the forums.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Tue Feb 01, 2011 10:17 pm
thomthom wrote: Dan Rathbun wrote:Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Is there a list of available?
Both ver 2, and the original (Didier's version?) have fully qualified classes that you can cut and paste from. For constants we'll have to compile a list.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by thomthom » Tue Feb 01, 2011 10:37 pm
Dan Rathbun wrote:thomthom wrote:Dan Rathbun wrote:I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis.
These are the ones that caused problems (but the ver 3 does not have them.) old_NPP_autocomplete.png
Oh! Didn't noticed that. Dan Rathbun wrote:Both ver 2, and the original (Didier's version?) have fully qualified classes that you can cut and paste from.
Ah, yea. I did that manually for v2.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Wed Feb 02, 2011 11:53 am
Here's the 1.8.6 constant list for the Errno module, on the PC: For PC ( note! OSX SystemCallError subclasses may differ.) - Code: Select all
<Keyword name="Errno::E2BIG"/> <Keyword name="Errno::E2BIG::Errno"/> <Keyword name="Errno::EACCES"/> <Keyword name="Errno::EACCES::Errno"/> <Keyword name="Errno::EADDRINUSE"/> <Keyword name="Errno::EADDRINUSE::Errno"/> <Keyword name="Errno::EADDRNOTAVAIL"/> <Keyword name="Errno::EADDRNOTAVAIL::Errno"/> <Keyword name="Errno::EAFNOSUPPORT"/> <Keyword name="Errno::EAFNOSUPPORT::Errno"/> <Keyword name="Errno::EAGAIN"/> <Keyword name="Errno::EAGAIN::Errno"/> <Keyword name="Errno::EALREADY"/> <Keyword name="Errno::EALREADY::Errno"/> <Keyword name="Errno::EBADF"/> <Keyword name="Errno::EBADF::Errno"/> <Keyword name="Errno::EBUSY"/> <Keyword name="Errno::EBUSY::Errno"/> <Keyword name="Errno::ECHILD"/> <Keyword name="Errno::ECHILD::Errno"/> <Keyword name="Errno::ECONNABORTED"/> <Keyword name="Errno::ECONNABORTED::Errno"/> <Keyword name="Errno::ECONNREFUSED"/> <Keyword name="Errno::ECONNREFUSED::Errno"/> <Keyword name="Errno::ECONNRESET"/> <Keyword name="Errno::ECONNRESET::Errno"/> <Keyword name="Errno::EDEADLK"/> <Keyword name="Errno::EDEADLK::Errno"/> <Keyword name="Errno::EDEADLOCK"/> <Keyword name="Errno::EDEADLOCK::Errno"/> <Keyword name="Errno::EDESTADDRREQ"/> <Keyword name="Errno::EDESTADDRREQ::Errno"/> <Keyword name="Errno::EDOM"/> <Keyword name="Errno::EDOM::Errno"/> <Keyword name="Errno::EDQUOT"/> <Keyword name="Errno::EDQUOT::Errno"/> <Keyword name="Errno::EEXIST"/> <Keyword name="Errno::EEXIST::Errno"/> <Keyword name="Errno::EFAULT"/> <Keyword name="Errno::EFAULT::Errno"/> <Keyword name="Errno::EFBIG"/> <Keyword name="Errno::EFBIG::Errno"/> <Keyword name="Errno::EHOSTDOWN"/> <Keyword name="Errno::EHOSTDOWN::Errno"/> <Keyword name="Errno::EHOSTUNREACH"/> <Keyword name="Errno::EHOSTUNREACH::Errno"/> <Keyword name="Errno::EILSEQ"/> <Keyword name="Errno::EILSEQ::Errno"/> <Keyword name="Errno::EINPROGRESS"/> <Keyword name="Errno::EINPROGRESS::Errno"/> <Keyword name="Errno::EINTR"/> <Keyword name="Errno::EINTR::Errno"/> <Keyword name="Errno::EINVAL"/> <Keyword name="Errno::EINVAL::Errno"/> <Keyword name="Errno::EIO"/> <Keyword name="Errno::EIO::Errno"/> <Keyword name="Errno::EISCONN"/> <Keyword name="Errno::EISCONN::Errno"/> <Keyword name="Errno::EISDIR"/> <Keyword name="Errno::EISDIR::Errno"/> <Keyword name="Errno::ELOOP"/> <Keyword name="Errno::ELOOP::Errno"/> <Keyword name="Errno::EMFILE"/> <Keyword name="Errno::EMFILE::Errno"/> <Keyword name="Errno::EMLINK"/> <Keyword name="Errno::EMLINK::Errno"/> <Keyword name="Errno::EMSGSIZE"/> <Keyword name="Errno::EMSGSIZE::Errno"/> <Keyword name="Errno::ENAMETOOLONG"/> <Keyword name="Errno::ENAMETOOLONG::Errno"/> <Keyword name="Errno::ENETDOWN"/> <Keyword name="Errno::ENETDOWN::Errno"/> <Keyword name="Errno::ENETRESET"/> <Keyword name="Errno::ENETRESET::Errno"/> <Keyword name="Errno::ENETUNREACH"/> <Keyword name="Errno::ENETUNREACH::Errno"/> <Keyword name="Errno::ENFILE"/> <Keyword name="Errno::ENFILE::Errno"/> <Keyword name="Errno::ENOBUFS"/> <Keyword name="Errno::ENOBUFS::Errno"/> <Keyword name="Errno::ENODEV"/> <Keyword name="Errno::ENODEV::Errno"/> <Keyword name="Errno::ENOENT"/> <Keyword name="Errno::ENOENT::Errno"/> <Keyword name="Errno::ENOEXEC"/> <Keyword name="Errno::ENOEXEC::Errno"/> <Keyword name="Errno::ENOLCK"/> <Keyword name="Errno::ENOLCK::Errno"/> <Keyword name="Errno::ENOMEM"/> <Keyword name="Errno::ENOMEM::Errno"/> <Keyword name="Errno::ENOPROTOOPT"/> <Keyword name="Errno::ENOPROTOOPT::Errno"/> <Keyword name="Errno::ENOSPC"/> <Keyword name="Errno::ENOSPC::Errno"/> <Keyword name="Errno::ENOSYS"/> <Keyword name="Errno::ENOSYS::Errno"/> <Keyword name="Errno::ENOTCONN"/> <Keyword name="Errno::ENOTCONN::Errno"/> <Keyword name="Errno::ENOTDIR"/> <Keyword name="Errno::ENOTDIR::Errno"/> <Keyword name="Errno::ENOTEMPTY"/> <Keyword name="Errno::ENOTEMPTY::Errno"/> <Keyword name="Errno::ENOTSOCK"/> <Keyword name="Errno::ENOTSOCK::Errno"/> <Keyword name="Errno::ENOTTY"/> <Keyword name="Errno::ENOTTY::Errno"/> <Keyword name="Errno::ENXIO"/> <Keyword name="Errno::ENXIO::Errno"/> <Keyword name="Errno::EOPNOTSUPP"/> <Keyword name="Errno::EOPNOTSUPP::Errno"/> <Keyword name="Errno::EPERM"/> <Keyword name="Errno::EPERM::Errno"/> <Keyword name="Errno::EPFNOSUPPORT"/> <Keyword name="Errno::EPFNOSUPPORT::Errno"/> <Keyword name="Errno::EPIPE"/> <Keyword name="Errno::EPIPE::Errno"/> <Keyword name="Errno::EPROTONOSUPPORT"/> <Keyword name="Errno::EPROTONOSUPPORT::Errno"/> <Keyword name="Errno::EPROTOTYPE"/> <Keyword name="Errno::EPROTOTYPE::Errno"/> <Keyword name="Errno::ERANGE"/> <Keyword name="Errno::ERANGE::Errno"/> <Keyword name="Errno::EREMOTE"/> <Keyword name="Errno::EREMOTE::Errno"/> <Keyword name="Errno::EROFS"/> <Keyword name="Errno::EROFS::Errno"/> <Keyword name="Errno::ESHUTDOWN"/> <Keyword name="Errno::ESHUTDOWN::Errno"/> <Keyword name="Errno::ESOCKTNOSUPPORT"/> <Keyword name="Errno::ESOCKTNOSUPPORT::Errno"/> <Keyword name="Errno::ESPIPE"/> <Keyword name="Errno::ESPIPE::Errno"/> <Keyword name="Errno::ESRCH"/> <Keyword name="Errno::ESRCH::Errno"/> <Keyword name="Errno::ESTALE"/> <Keyword name="Errno::ESTALE::Errno"/> <Keyword name="Errno::ETIMEDOUT"/> <Keyword name="Errno::ETIMEDOUT::Errno"/> <Keyword name="Errno::ETOOMANYREFS"/> <Keyword name="Errno::ETOOMANYREFS::Errno"/> <Keyword name="Errno::EUSERS"/> <Keyword name="Errno::EUSERS::Errno"/> <Keyword name="Errno::EWOULDBLOCK"/> <Keyword name="Errno::EWOULDBLOCK::Errno"/> <Keyword name="Errno::EXDEV"/> <Keyword name="Errno::EXDEV::Errno"/>
output via: Ruby console and type (one-liner): Errno.constants.sort.each {|e| puts %Q[\t\t<Keyword name="Errno::#{e}"/>\n\t\t<Keyword name="Errno::#{e}::Errno"/>\n] }Then copy and paste into the ruby.xml file for Notepad++
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Wed Feb 02, 2011 12:01 pm
Here's the 1.8.6 constant list for the File module: - Code: Select all
<KeyWord name="File::ALT_SEPARATOR"/> <KeyWord name="File::APPEND"/> <KeyWord name="File::BINARY"/> <KeyWord name="File::CREAT"/> <KeyWord name="File::Constants::APPEND"/> <KeyWord name="File::Constants::BINARY"/> <KeyWord name="File::Constants::CREAT"/> <KeyWord name="File::Constants::EXCL"/> <KeyWord name="File::Constants::FNM_CASEFOLD"/> <KeyWord name="File::Constants::FNM_DOTMATCH"/> <KeyWord name="File::Constants::FNM_NOESCAPE"/> <KeyWord name="File::Constants::FNM_PATHNAME"/> <KeyWord name="File::Constants::FNM_SYSCASE"/> <KeyWord name="File::Constants::LOCK_EX"/> <KeyWord name="File::Constants::LOCK_NB"/> <KeyWord name="File::Constants::LOCK_SH"/> <KeyWord name="File::Constants::LOCK_UN"/> <KeyWord name="File::Constants::NONBLOCK"/> <KeyWord name="File::Constants::RDONLY"/> <KeyWord name="File::Constants::RDWR"/> <KeyWord name="File::Constants::TRUNC"/> <KeyWord name="File::Constants::WRONLY"/> <KeyWord name="File::EXCL"/> <KeyWord name="File::FNM_CASEFOLD"/> <KeyWord name="File::FNM_DOTMATCH"/> <KeyWord name="File::FNM_NOESCAPE"/> <KeyWord name="File::FNM_PATHNAME"/> <KeyWord name="File::FNM_SYSCASE"/> <KeyWord name="File::LOCK_EX"/> <KeyWord name="File::LOCK_NB"/> <KeyWord name="File::LOCK_SH"/> <KeyWord name="File::LOCK_UN"/> <KeyWord name="File::NONBLOCK"/> <KeyWord name="File::PATH_SEPARATOR"/> <KeyWord name="File::RDONLY"/> <KeyWord name="File::RDWR"/> <KeyWord name="File::SEEK_CUR"/> <KeyWord name="File::SEEK_END"/> <KeyWord name="File::SEEK_SET"/> <KeyWord name="File::SEPARATOR"/> <KeyWord name="File::Separator"/> <KeyWord name="File::TRUNC"/> <KeyWord name="File::WRONLY"/>
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Wed Feb 02, 2011 12:09 pm
Here's the 1.8.6 constant list for the Float class: - Code: Select all
<Keyword name="Float::DIG"/> <Keyword name="Float::EPSILON"/> <Keyword name="Float::MANT_DIG"/> <Keyword name="Float::MAX"/> <Keyword name="Float::MAX_10_EXP"/> <Keyword name="Float::MAX_EXP"/> <Keyword name="Float::MIN"/> <Keyword name="Float::MIN_10_EXP"/> <Keyword name="Float::MIN_EXP"/> <Keyword name="Float::RADIX"/> <Keyword name="Float::ROUNDS"/>
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Wed Feb 02, 2011 1:26 pm
Here's the 1.8.6 constant list for the IO class: - Code: Select all
<Keyword name="IO::APPEND"/> <Keyword name="IO::BINARY"/> <Keyword name="IO::CREAT"/> <Keyword name="IO::EXCL"/> <Keyword name="IO::FNM_CASEFOLD"/> <Keyword name="IO::FNM_DOTMATCH"/> <Keyword name="IO::FNM_NOESCAPE"/> <Keyword name="IO::FNM_PATHNAME"/> <Keyword name="IO::FNM_SYSCASE"/> <Keyword name="IO::LOCK_EX"/> <Keyword name="IO::LOCK_NB"/> <Keyword name="IO::LOCK_SH"/> <Keyword name="IO::LOCK_UN"/> <Keyword name="IO::NONBLOCK"/> <Keyword name="IO::RDONLY"/> <Keyword name="IO::RDWR"/> <Keyword name="IO::SEEK_CUR"/> <Keyword name="IO::SEEK_END"/> <Keyword name="IO::SEEK_SET"/> <Keyword name="IO::TRUNC"/> <Keyword name="IO::WRONLY"/>
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Wed Feb 02, 2011 2:31 pm
Here's the 1.8.6 constant list AND class methods for the Marshal module: - Code: Select all
<Keyword name="Marshal::MAJOR_VERSION"/> <Keyword name="Marshal::MINOR_VERSION"/> <Keyword name="Marshal::dump" func="yes"> <Overload retVal="String" descr="Returns String result of serializing obj and all descendent objects."> <Param name="~Object obj" /> </Overload> <Overload retVal="~IO" descr="Returns io_obj, after writing to it, the serialized data for obj and all descendent objects."> <Param name="~Object obj" /> <Param name="~IO io_obj" /> </Overload> <Overload retVal="~IO" descr="Returns io_obj, after writing to it, the serialized data for obj and the descendent objects limited to the specified depth (if non-negative. Default depth=-1)"> <Param name="~Object obj" /> <Param name="~IO io_obj" /> <Param name="~Integer depth" /> </Overload> </KeyWord> <Keyword name="Marshal::load" func="yes"> <Overload retVal="~Object" descr="Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str()."> <Param name="~IO|^String source" /> </Overload> <Overload retVal="~Object" descr="Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str(). If proc_obj is specified, it will be passed each object as it is deserialized."> <Param name="~IO|^String source" /> <Param name="Proc proc_obj" /> </Overload> </KeyWord> <Keyword name="Marshal::restore" func="yes"> <Overload retVal="~Object" descr="Alias for Marshal::load() Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str()."> <Param name="~IO|^String source" /> </Overload> <Overload retVal="~Object" descr="Alias for Marshal::load() Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str(). If proc_obj is specified, it will be passed each object as it is deserialized."> <Param name="~IO|^String source" /> <Param name="Proc proc_obj" /> </Overload> </KeyWord>
As an experiment, in parameters, I used: " ~" to denote "this class or subclass" " ^" to denote "implictly convertable to" (which would include the class and any subclasses.) for ex: ^Integer would mean: " Integer class, subclass, or object that implements a to_i() method."
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Thu Feb 03, 2011 4:41 pm
Hi Dan, This is the sort of thing I want to check in SU ruby on the mac, Your first snip seems to bring up loads more methods than what your posting, are you editing yours down? I'd like to do more, but adding the code to get the extra bits is beyond me. Would you mind sharing Marshal snippet, and will that work with all modules? Is the a 1.8.6 module that simply didn't exist at all in 1.8.5 that I could test for? cheers john - Code: Select all
<Keyword name="File::FNM_CASEFOLD::File"/> <Keyword name="File::FNM_DOTMATCH"/> <Keyword name="File::FNM_DOTMATCH::File"/> <Keyword name="File::FNM_NOESCAPE"/> <Keyword name="File::FNM_NOESCAPE::File"/> <Keyword name="File::FNM_PATHNAME"/> <Keyword name="File::FNM_PATHNAME::File"/> <Keyword name="File::FNM_SYSCASE"/> <Keyword name="File::FNM_SYSCASE::File"/> <Keyword name="File::LOCK_EX"/> <Keyword name="File::LOCK_EX::File"/> <Keyword name="File::LOCK_NB"/> <Keyword name="File::LOCK_NB::File"/> <Keyword name="File::LOCK_SH"/> <Keyword name="File::LOCK_SH::File"/> <Keyword name="File::LOCK_UN"/> <Keyword name="File::LOCK_UN::File"/> <Keyword name="File::NOCTTY"/> <Keyword name="File::NOCTTY::File"/> <Keyword name="File::NONBLOCK"/> <Keyword name="File::NONBLOCK::File"/> <Keyword name="File::PATH_SEPARATOR"/> <Keyword name="File::PATH_SEPARATOR::File"/> <Keyword name="File::RDONLY"/> <Keyword name="File::RDONLY::File"/> <Keyword name="File::RDWR"/> <Keyword name="File::RDWR::File"/> <Keyword name="File::SEEK_CUR"/> <Keyword name="File::SEEK_CUR::File"/> <Keyword name="File::SEEK_END"/> <Keyword name="File::SEEK_END::File"/> <Keyword name="File::SEEK_SET"/> <Keyword name="File::SEEK_SET::File"/> <Keyword name="File::SEPARATOR"/> <Keyword name="File::SEPARATOR::File"/> <Keyword name="File::SYNC"/> <Keyword name="File::SYNC::File"/> <Keyword name="File::Separator"/> <Keyword name="File::Separator::File"/> <Keyword name="File::Stat"/> <Keyword name="File::Stat::File"/> <Keyword name="File::TRUNC"/> <Keyword name="File::TRUNC::File"/> <Keyword name="File::WRONLY"/> <Keyword name="File::WRONLY::File"/> ["ALT_SEPARATOR", "APPEND", "CREAT", "Constants", "EXCL", "FNM_CASEFOLD", "FNM_DOTMATCH", "FNM_NOESCAPE", "FNM_PATHNAME", "FNM_SYSCASE", "LOCK_EX", "LOCK_NB", "LOCK_SH", "LOCK_UN", "NOCTTY", "NONBLOCK", "PATH_SEPARATOR", "RDONLY", "RDWR", "SEEK_CUR", "SEEK_END", "SEEK_SET", "SEPARATOR", "SYNC", "Separator", "Stat", "TRUNC", "WRONLY"]
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by thomthom » Thu Feb 03, 2011 4:55 pm
Thanks Dan for posting this.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by thomthom » Thu Feb 03, 2011 4:55 pm
Btw, I think I'll upload the list to BitBucket. I'll do that later today.
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by thomthom » Thu Feb 03, 2011 5:36 pm
-

thomthom
- Global Moderator
-
- Posts: 17545
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: thomthom
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Thu Feb 03, 2011 5:40 pm
driven wrote:This is the sort of thing I want to check in SU ruby on the mac, Your first snip seems to bring up loads more methods than what your posting, ...
" methods" ?? The snippet lists Constants. You mean this snippet ?? Errno.constants.sort.each {|e| puts %Q[\t\t<Keyword name="Errno::#{e}"/>\n\t\t<Keyword name="Errno::#{e}::Errno"/>\n] } driven wrote:... are you editing yours down?
NO .. BUT the Errno module is created dynamically by Ruby at startup, and MAY DIFFER from platform to platform (ie, from one Operating System to another.) The count on the PC is 73 Constants within Errno module (pointing at SystemCallError exception subclass instances,) each of whom have a local constant Errno that wraps their private instance method errno(). SO a grandtotal of 146 module Errno constants on the PC. Just to be on the safe side.. and to be sure that Global Constants (defined in Object,) are not propagating into the Errno module, in Ruby 1.8.5 .... use the following snippet, and post the results here in a code box, please. (Errno.constants.sort-Object.constants.sort).each {|e| puts %Q[\t\t<Keyword name="Errno::#{e}"/>\n\t\t<Keyword name="Errno::#{e}::Errno"/>\n] }
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Thu Feb 03, 2011 5:54 pm
here it is, I'm running these through Ruby Console, so aren't they shielded from external globals? and I know I still get names messed about, sorry.. john - Code: Select all
>> (Errno.constants.sort-Object.constants.sort).each {|e| puts %Q[\t\t<Keyword name="Errno::#{e}"/>\n\t\t<Keyword name="Errno::#{e}::Errno"/>\n] } <Keyword name="Errno::E2BIG"/> <Keyword name="Errno::E2BIG::Errno"/> <Keyword name="Errno::EACCES"/> <Keyword name="Errno::EACCES::Errno"/> <Keyword name="Errno::EADDRINUSE"/> <Keyword name="Errno::EADDRINUSE::Errno"/> <Keyword name="Errno::EADDRNOTAVAIL"/> <Keyword name="Errno::EADDRNOTAVAIL::Errno"/> <Keyword name="Errno::EAFNOSUPPORT"/> <Keyword name="Errno::EAFNOSUPPORT::Errno"/> <Keyword name="Errno::EAGAIN"/> <Keyword name="Errno::EAGAIN::Errno"/> <Keyword name="Errno::EALREADY"/> <Keyword name="Errno::EALREADY::Errno"/> <Keyword name="Errno::EBADF"/> <Keyword name="Errno::EBADF::Errno"/> <Keyword name="Errno::EBADMSG"/> <Keyword name="Errno::EBADMSG::Errno"/> <Keyword name="Errno::EBUSY"/> <Keyword name="Errno::EBUSY::Errno"/> <Keyword name="Errno::ECHILD"/> <Keyword name="Errno::ECHILD::Errno"/> <Keyword name="Errno::ECONNABORTED"/> <Keyword name="Errno::ECONNABORTED::Errno"/> <Keyword name="Errno::ECONNREFUSED"/> <Keyword name="Errno::ECONNREFUSED::Errno"/> <Keyword name="Errno::ECONNRESET"/> <Keyword name="Errno::ECONNRESET::Errno"/> <Keyword name="Errno::EDEADLK"/> <Keyword name="Errno::EDEADLK::Errno"/> <Keyword name="Errno::EDESTADDRREQ"/> <Keyword name="Errno::EDESTADDRREQ::Errno"/> <Keyword name="Errno::EDOM"/> <Keyword name="Errno::EDOM::Errno"/> <Keyword name="Errno::EDQUOT"/> <Keyword name="Errno::EDQUOT::Errno"/> <Keyword name="Errno::EEXIST"/> <Keyword name="Errno::EEXIST::Errno"/> <Keyword name="Errno::EFAULT"/> <Keyword name="Errno::EFAULT::Errno"/> <Keyword name="Errno::EFBIG"/> <Keyword name="Errno::EFBIG::Errno"/> <Keyword name="Errno::EHOSTDOWN"/> <Keyword name="Errno::EHOSTDOWN::Errno"/> <Keyword name="Errno::EHOSTUNREACH"/> <Keyword name="Errno::EHOSTUNREACH::Errno"/> <Keyword name="Errno::EIDRM"/> <Keyword name="Errno::EIDRM::Errno"/> <Keyword name="Errno::EILSEQ"/> <Keyword name="Errno::EILSEQ::Errno"/> <Keyword name="Errno::EINPROGRESS"/> <Keyword name="Errno::EINPROGRESS::Errno"/> <Keyword name="Errno::EINTR"/> <Keyword name="Errno::EINTR::Errno"/> <Keyword name="Errno::EINVAL"/> <Keyword name="Errno::EINVAL::Errno"/> <Keyword name="Errno::EIO"/> <Keyword name="Errno::EIO::Errno"/> <Keyword name="Errno::EISCONN"/> <Keyword name="Errno::EISCONN::Errno"/> <Keyword name="Errno::EISDIR"/> <Keyword name="Errno::EISDIR::Errno"/> <Keyword name="Errno::ELOOP"/> <Keyword name="Errno::ELOOP::Errno"/> <Keyword name="Errno::EMFILE"/> <Keyword name="Errno::EMFILE::Errno"/> <Keyword name="Errno::EMLINK"/> <Keyword name="Errno::EMLINK::Errno"/> <Keyword name="Errno::EMSGSIZE"/> <Keyword name="Errno::EMSGSIZE::Errno"/> <Keyword name="Errno::EMULTIHOP"/> <Keyword name="Errno::EMULTIHOP::Errno"/> <Keyword name="Errno::ENAMETOOLONG"/> <Keyword name="Errno::ENAMETOOLONG::Errno"/> <Keyword name="Errno::ENETDOWN"/> <Keyword name="Errno::ENETDOWN::Errno"/> <Keyword name="Errno::ENETRESET"/> <Keyword name="Errno::ENETRESET::Errno"/> <Keyword name="Errno::ENETUNREACH"/> <Keyword name="Errno::ENETUNREACH::Errno"/> <Keyword name="Errno::ENFILE"/> <Keyword name="Errno::ENFILE::Errno"/> <Keyword name="Errno::ENOBUFS"/> <Keyword name="Errno::ENOBUFS::Errno"/> <Keyword name="Errno::ENODATA"/> <Keyword name="Errno::ENODATA::Errno"/> <Keyword name="Errno::ENODEV"/> <Keyword name="Errno::ENODEV::Errno"/> <Keyword name="Errno::ENOENT"/> <Keyword name="Errno::ENOENT::Errno"/> <Keyword name="Errno::ENOEXEC"/> <Keyword name="Errno::ENOEXEC::Errno"/> <Keyword name="Errno::ENOLCK"/> <Keyword name="Errno::ENOLCK::Errno"/> <Keyword name="Errno::ENOLINK"/> <Keyword name="Errno::ENOLINK::Errno"/> <Keyword name="Errno::ENOMEM"/> <Keyword name="Errno::ENOMEM::Errno"/> <Keyword name="Errno::ENOMSG"/> <Keyword name="Errno::ENOMSG::Errno"/> <Keyword name="Errno::ENOPROTOOPT"/> <Keyword name="Errno::ENOPROTOOPT::Errno"/> <Keyword name="Errno::ENOSPC"/> <Keyword name="Errno::ENOSPC::Errno"/> <Keyword name="Errno::ENOSR"/> <Keyword name="Errno::ENOSR::Errno"/> <Keyword name="Errno::ENOSTR"/> <Keyword name="Errno::ENOSTR::Errno"/> <Keyword name="Errno::ENOSYS"/> <Keyword name="Errno::ENOSYS::Errno"/> <Keyword name="Errno::ENOTBLK"/> <Keyword name="Errno::ENOTBLK::Errno"/> <Keyword name="Errno::ENOTCONN"/> <Keyword name="Errno::ENOTCONN::Errno"/> <Keyword name="Errno::ENOTDIR"/> <Keyword name="Errno::ENOTDIR::Errno"/> <Keyword name="Errno::ENOTEMPTY"/> <Keyword name="Errno::ENOTEMPTY::Errno"/> <Keyword name="Errno::ENOTSOCK"/> <Keyword name="Errno::ENOTSOCK::Errno"/> <Keyword name="Errno::ENOTTY"/> <Keyword name="Errno::ENOTTY::Errno"/> <Keyword name="Errno::ENXIO"/> <Keyword name="Errno::ENXIO::Errno"/> <Keyword name="Errno::EOPNOTSUPP"/> <Keyword name="Errno::EOPNOTSUPP::Errno"/> <Keyword name="Errno::EOVERFLOW"/> <Keyword name="Errno::EOVERFLOW::Errno"/> <Keyword name="Errno::EPERM"/> <Keyword name="Errno::EPERM::Errno"/> <Keyword name="Errno::EPFNOSUPPORT"/> <Keyword name="Errno::EPFNOSUPPORT::Errno"/> <Keyword name="Errno::EPIPE"/> <Keyword name="Errno::EPIPE::Errno"/> <Keyword name="Errno::EPROTO"/> <Keyword name="Errno::EPROTO::Errno"/> <Keyword name="Errno::EPROTONOSUPPORT"/> <Keyword name="Errno::EPROTONOSUPPORT::Errno"/> <Keyword name="Errno::EPROTOTYPE"/> <Keyword name="Errno::EPROTOTYPE::Errno"/> <Keyword name="Errno::ERANGE"/> <Keyword name="Errno::ERANGE::Errno"/> <Keyword name="Errno::EREMOTE"/> <Keyword name="Errno::EREMOTE::Errno"/> <Keyword name="Errno::EROFS"/> <Keyword name="Errno::EROFS::Errno"/> <Keyword name="Errno::ESHUTDOWN"/> <Keyword name="Errno::ESHUTDOWN::Errno"/> <Keyword name="Errno::ESOCKTNOSUPPORT"/> <Keyword name="Errno::ESOCKTNOSUPPORT::Errno"/> <Keyword name="Errno::ESPIPE"/> <Keyword name="Errno::ESPIPE::Errno"/> <Keyword name="Errno::ESRCH"/> <Keyword name="Errno::ESRCH::Errno"/> <Keyword name="Errno::ESTALE"/> <Keyword name="Errno::ESTALE::Errno"/> <Keyword name="Errno::ETIME"/> <Keyword name="Errno::ETIME::Errno"/> <Keyword name="Errno::ETIMEDOUT"/> <Keyword name="Errno::ETIMEDOUT::Errno"/> <Keyword name="Errno::ETOOMANYREFS"/> <Keyword name="Errno::ETOOMANYREFS::Errno"/> <Keyword name="Errno::ETXTBSY"/> <Keyword name="Errno::ETXTBSY::Errno"/> <Keyword name="Errno::EUSERS"/> <Keyword name="Errno::EUSERS::Errno"/> <Keyword name="Errno::EWOULDBLOCK"/> <Keyword name="Errno::EWOULDBLOCK::Errno"/> <Keyword name="Errno::EXDEV"/> <Keyword name="Errno::EXDEV::Errno"/> ["E2BIG", "EACCES", "EADDRINUSE", "EADDRNOTAVAIL", "EAFNOSUPPORT", "EAGAIN", "EALREADY", "EBADF", "EBADMSG", "EBUSY", "ECHILD", "ECONNABORTED", "ECONNREFUSED", "ECONNRESET", "EDEADLK", "EDESTADDRREQ", "EDOM", "EDQUOT", "EEXIST", "EFAULT", "EFBIG", "EHOSTDOWN", "EHOSTUNREACH", "EIDRM", "EILSEQ", "EINPROGRESS", "EINTR", "EINVAL", "EIO", "EISCONN", "EISDIR", "ELOOP", "EMFILE", "EMLINK", "EMSGSIZE", "EMULTIHOP", "ENAMETOOLONG", "ENETDOWN", "ENETRESET", "ENETUNREACH", "ENFILE", "ENOBUFS", "ENODATA", "ENODEV", "ENOENT", "ENOEXEC", "ENOLCK", "ENOLINK", "ENOMEM", "ENOMSG", "ENOPROTOOPT", "ENOSPC", "ENOSR", "ENOSTR", "ENOSYS", "ENOTBLK", "ENOTCONN", "ENOTDIR", "ENOTEMPTY", "ENOTSOCK", "ENOTTY", "ENXIO", "EOPNOTSUPP", "EOVERFLOW", "EPERM", "EPFNOSUPPORT", "EPIPE", "EPROTO", "EPROTONOSUPPORT", "EPROTOTYPE", "ERANGE", "EREMOTE", "EROFS", "ESHUTDOWN", "ESOCKTNOSUPPORT", "ESPIPE", "ESRCH", "ESTALE", "ETIME", "ETIMEDOUT", "ETOOMANYREFS", "ETXTBSY", "EUSERS", "EWOULDBLOCK", "EXDEV"]
-
driven
- Top SketchUcator
-
- Posts: 1409
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 8
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Thu Feb 03, 2011 6:00 pm
driven wrote:Would you mind sharing Marshal snippet, and will that work with all modules?
I'm not sure what you are asking for. Marshal::constants.sort>> ["MAJOR_VERSION", "MINOR_VERSION"] Marshal::singleton_methods.sort>> ["dump", "load", "restore"] The Marshal module has been part of Standard Ruby since the very early days. It's listed in the old "Pick-Axe" book which was Ruby circa 1.6.x
By the way.. can Safari open a CHM ( Compiled HTML Help Markup,) file natively without a plugin ?? If so.. you should get at least the Reference for v1.8.6 in this post. ~
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4069
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
Return to Developers' Forum
|