General developer forum

 
 
Picture of Tomasz Muras
Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Hi All,

There is a really cool commandline utility for Drupal called drush. I though that we need something like this for Moodle and I've created moosh (moodle plugin page) a while ago. Have a quick look at the documentation - it's fairly straight-forward what it does.

The moosh commands are plugable and it should be simple enough to create new ones, so fork me on github if you think there is something that may be useful for every-day Moodle development.

Now, what I really would like to share here & get your feedback is the code generation feature. I've implemented it just now and recorded a 9 minutes screencast to explain it. I don't know how do you code in Moodle but I keep forgetting function names, form element names, etc. - using code templates makes the development much quicker for me.

My idea (for the code generation part of moosh) would be to collect working and re-usable pieces of Moodle code and use them as kind of know-how. A template for creating new modules is a good start: https://github.com/moodlehq/moodle-mod_newmodule but we should have similar templates for blocks, etc.

All feedback welcome!

cheers,
Tomek

 
Average of ratings:Useful (2)
Dan at desk in Moodle HQ, Perth
Re: Developer helper - moosh
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Hi Tomek,

This sounds really interesting, I saw it on github previously but hadn't had a chance to check it out.

Your screencast site appears to be down though.

thanks
Dan
 
Average of ratings: -
Picture of Tomasz Muras
Re: Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

The page should load, unless my hosting company is turning the servers off for the night: http://techblog.zabuchy.net/2013/code-generation-feature-in-moosh-0-5/

I have uploaded OGV video there and only used video tag to display - hoping that this HTML5 feature will be spread enough thorough the recent browsers. The direct link is: moosh_0.5_code_generation.ogv . Let me know if you can't display it - I was reluctant to do so but I may end up uploading it to youtube.

cheers,
Tomek 

 
Average of ratings: -
C'est moi :-)
Re: Developer helper - moosh
Group Documentation writersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Thanks for this tool, that seems really interesting. This video is a great help, even for people not speaking english as primary langage.

Looking at the documenttation on GitHub, i've seen that it also allows to do several things, more linked to administration than development. Just don't know if there shouldn't be 2 separate tools, one for development, and the other one for administration...

Just to know : do file delete and role delete verify that they're not used, or not (brute delete, to use only for development/test, but not in production) ?

Séverin

 
Average of ratings: -
Picture of Tomasz Muras
Re: Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Hi Séverin,

Yes, I think those are two a bit different concepts - administration & development. I aim this one at development, which has some important implications - it will allow you to do things you should not be doing on the production, for example:

  • when I change the password, I want it changed no matter what the password policy is
  • when deleting the files, just delete them, even if I'm trying to wipe the whole table

I use those administrative tasks for development - e.g. I install fresh Moodle, create 2 courses and 10 users and enrol them.

I gave in and put the screencast on youtube as well:

cheers,
Tomek

 
Average of ratings:Useful (1)
Picture of Eric Villard
Re: Developer helper - moosh
 

Thanks Tomasz for this useful tool.

I will quickly give it a try wink.

Eric

 
Average of ratings: -
Picture of Jamie Pratt
Re: Developer helper - moosh
Group DevelopersGroup Documentation writers

I have made a simple question type plug in template, which will be added to over time. It would be great to see it used to add new functionality to moosh.

See the discussion in the quiz and question forum : https://moodle.org/mod/forum/discuss.php?d=221074

 
Average of ratings: -
Picture of Tomasz Muras
Re: Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Great, I will include https://github.com/jamiepratt/moodle-qtype_TEMPLATE in moosh soon. That will be a third template - wow smile.

cheers,
Tomek

 
Average of ratings: -
Picture of Tomasz Muras
Re: Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Thanks for creating the template, I've added this, 2 other commands, done some minor bugfixing and released 0.6.

cheers,
Tomek

 
Average of ratings: -
Picture of Katarzyna Potocka
Re: Developer helper - moosh
 

Hi Tomek, 

that is a really great command line tool!

I've seen your video and will hopefully find some time to test it. 

cheers Kasia

 
Average of ratings: -
Picture of Kate Sin
Re: Developer helper - moosh
 

I`m using something simlar:

https://github.com/FMCorz/mdk

It`s really good idea to auto create templates for specific moodle components.

 

 
Average of ratings: -
Picture of Mark Nelson
Re: Developer helper - moosh
Group DevelopersGroup Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Testers

A lot of the HQ developers are using mdk, it definitely makes Moodle development/testing easier. That being said, I have not tried moosh and am interested in doing so.

 
Average of ratings: -
Picture of Tomasz Muras
Re: Developer helper - moosh
Group DevelopersGroup Particularly helpful MoodlersGroup Translators

Nice. I can see that MDK is python-based helper for developing core Moodle (or at least it looks like, I didn't use it yet!).

I was thinking about implementing some git management commands in moosh as well, but I don't want to overlap the functionality with another tool - I will stick to implementing commands in Moodle context - for plugin development and testing.

 

Tomek

 
Average of ratings: -
Picture of Frédéric Massart
Re: Developer helper - moosh
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

I haven't had a thorough look at Moosh yet, but it seems that MDK and Moosh could complete each other. I'll have a look to see how to implement it as part of MDK.

 
Average of ratings: -