Tuesday, May 17, 2016

How to Develop Moonshine Plugin

1. Create a new Rails 4.2.6 project
2. Add gem 'plugger' and run bundle
3. plugger install git://github.com/railsmachine/moonshine.git
4. rails g to list all available generators
5. rails g moonshine:plugin wordnet
6. rails g moonshine:plugin wordnet
      create  vendor/plugins/moonshine_wordnet/LICENSE
      create  vendor/plugins/moonshine_wordnet/README.markdown
      create  vendor/plugins/moonshine_wordnet/moonshine/init.rb
      create  vendor/plugins/moonshine_wordnet/lib/moonshine/wordnet.rb
      create  vendor/plugins/moonshine_wordnet/spec/moonshine/wordnet_spec.rb
      create  vendor/plugins/moonshine_wordnet/spec/spec_helper.rb
7. Automate these commands:

      cd /tmp
      curl -o wordnet.tar.gz http://wordnetcode.princeton.edu/3.0/WNprolog-3.0.tar.gz
      tar -zxvf wordnet.tar.gz
      mv prolog/wn_s.pl /var/lib

in lib/moonshine/wordnet.rb.





Reference:
 
Mongodb Moonshine Plugin:

exec 'install_mongodb',
        :command => [
          "wget http://downloads.mongodb.org/linux/mongodb-linux-#{arch}-#{options[:version]}.tgz",
          "tar xzf mongodb-linux-#{arch}-#{options[:version]}.tgz",
          "mv mongodb-linux-#{arch}-#{options[:version]} /opt/local/mongo-#{options[:version]}"
        ].join(' && '),
        :cwd => '/tmp',
        :creates => "/opt/local/mongo-#{options[:version]}/bin/mongod",
        :require => [
          file('/opt/local'),
          package('wget')
        ]

No comments:

Post a Comment