Dan,
Thankyou for taking the time for such a detailed response. I really appreciate it. I said I was new to Ruby and I guess it shows . I would like to comment on your various points below. Hopefully I get the quoting right. (Not sure how to use the block quote but I will try.) Hopefully it does not mess up too badly…
I was aware of these and have actually accessed them and am working through them. And thanks for the tip on the colorized code and text back ticks.
Noted for the single quotes imbed and the tab spacing. I use Notepad++ and Textpad for my text editing. Both have tab setting and colorization capabilities based on the file extension. I will use two spaces for tabs from here on, thanks. I am new to notepad++ but have used Textpad for years. Beginning to think I like Notepad better.
As regards the space between the method id and the param list, This is easy to comply with. will do. I assume Rubocop is a play on the TV movie. And no I don’t use it but I will google it and check it out. Anything that helps with my coding is a plus.
[quote=“DanRathbun, post:6, topic:190140”]
Ruby does not force the use of frivolous parenthesis around each conditional expression. Ie:
The convention is to use them only when it is necessary to force order of evaluation.
Noted: I am still experimenting with this for readability, etc.
I wondered about this but could not quite figure out how to implement it properly. I appreciate the coding tips and explanation
You are correct that this is more a utility then a command. This was my intent I just did not know the proper way to describe it. (still learning here)
Your comments on SketchUp Ruby and shared environments concern me. I certainly do NOT want to impact this shared environment, or other users with my code, nor do I want my code impacted by this.
At the moment, I am only running my utilities file via Sketchup Make and its Ruby console. I think I see where I might impact the Sketchup environment in my local session of Sketchup, and possibly code implemented by any extensions I am using. I am unclear how this could go farther. I (currently) only run my bst.rb file from the console and it is not in the sketchup plugins subdirectory so it does not load automatically with Sketchup. I HAD planned do just that if I found enough usefulness in the utils. might want to rethink this. Right now its a means for learning Ruby.
Can you explain more about creating my own namespace and how I might accomplish this an run my utils and any future tools I may write without risking impact on other code. My reading to date has not yet touched on namespaces or creating submodules.
One last question. when I invoke the utility m() with
m 'test', [10,10,10]
the console responds with
m 'test', [10,10,10]
# of args 2
args[0] is test
args[1] is [10, 10, 10]
Sketchup ComponentInstance is test
Sketchup::ComponentInstance is false
which is correct according to the code, but WHY does the component instance test come back with FALSE? I created the component and gave it the name test. How should I access/name the component so that args[0] is the name of the component I want to move?
Again, thank you for your advice and for taking time to help me.
Brad Smith