<commit_before>= Custom_Webservice

This plugin is a simple example of how to provide custom web services for your Redmine.
By starting from this template, you can write only a few lines of Ruby code
and add powerful query or update functions to your Redmine.

As the Redmine REST API becomes more complete, this will 
hopefully be less necessary, but for now there are many 
missing functions in the REST API and the state of implementation
varies from Redmine release to release, so we found it
more useful to put the code our external tools rely on in
our own plugin that can be stable across releases and versions.  

That said, almost everything you would do with this plugin
(with the possible exception of some query stuff) will eventually 
mostly migrate to using the REST API.  In the meantime, enjoy.

= Install and Setup

This plugin installs normally:
 1. cd vendors/plugins in your Redmine install.  A test install is recommended!
 1. git clone git://github.com/leovitch/custom_webservice.git
 1. Run or restart Redmine
    * The examples in the code all assume you're testing under Mongrel by using this command at the root.
    * RAILS_ENV=production ruby script/server
 1. Go to the Administration > Settings > Authentication page and make sure the box "Enable REST Web Service" is on.
 1. For testing, log in as the admin user, go to the "My Account" page, and copy the API key.  You'll need it for testing.
 1. Now you can test the samples from the shell using curl (or wget).  See the class documentation for CustomWebserviceController.
 1. Once you see how the samples work, delete those actions and make some useful new actions of your own.
    * You'll probably find custom_webservice/app/controllers/custom_webservice_controller.rb is the only file you need to modify.
 1. If you deploy web services based on this plugin, here are a couple points to be aware of.
    1. Be sure to delete the non-authenticated actions at the top of the controller.  They're only there to help you understand and try out some simple actions.
    1. For a non-admin user to use these web services, they must have the "Access Custom Web Services" permission.
       * You'll probably want to create a new Role called Robots or some such, that has only the needed permissions for your application.
       * Most of the Redmine ActiveRecord classes (Issue, Project, etc.) do enforce the permission bits, so be sure to give your Robot role all the appropriate permissions like "add issue", "edit issue", and so on.
    1. In general, to avoid POST forgeries, API keys are only secure if used over https or on a totally trusted LAN segment.


Copyright (c) 2011 <NAME>, released under the MIT license
<commit_msg> Not really liking rdoc's formatting here.<commit_after>= Custom_Webservice

This plugin is a simple example of how to provide custom web services for your Redmine.
By starting from this template, you can write only a few lines of Ruby code
and add powerful query or update functions to your Redmine.

As the Redmine REST API becomes more complete, this will 
hopefully be less necessary, but for now there are many 
missing functions in the REST API and the state of implementation
varies from Redmine release to release, so we found it
more useful to put the code our external tools rely on in
our own plugin that can be stable across releases and versions.  

That said, almost everything you would do with this plugin
(with the possible exception of some query stuff) will eventually 
mostly migrate to using the REST API.  In the meantime, enjoy.

= Install and Setup

This plugin installs normally:
1. cd vendors/plugins in your Redmine install.  A test install is recommended!
1. git clone git://github.com/leovitch/custom_webservice.git
1. Run or restart Redmine
   * The examples in the code all assume you're testing under Mongrel by using this command at the root.
   * RAILS_ENV=production ruby script/server
1. Go to the Administration > Settings > Authentication page and make sure the box "Enable REST Web Service" is on.
1. For testing, log in as the admin user, go to the "My Account" page, and copy the API key.  You'll need it for testing.
1. Now you can test the samples from the shell using curl (or wget).  See the class documentation for CustomWebserviceController.
1. Once you see how the samples work, delete those actions and make some useful new actions of your own.
   * You'll probably find custom_webservice/app/controllers/custom_webservice_controller.rb is the only file you need to modify.
1. If you deploy web services based on this plugin, here are a couple points to be aware of.
   1. Be sure to delete the non-authenticated actions at the top of the controller.  They're only there to help you understand and try out some simple actions.
   1. For a non-admin user to use these web services, they must have the "Access Custom Web Services" permission.
      * You'll probably want to create a new Role called Robots or some such, that has only the needed permissions for your application.
      * Most of the Redmine ActiveRecord classes (Issue, Project, etc.) do enforce the permission bits, so be sure to give your Robot role all the appropriate permissions like "add issue", "edit issue", and so on.
   1. In general, to avoid POST forgeries, API keys are only secure if used over https or on a totally trusted LAN segment.


Copyright (c) 2011 <NAME>, released under the MIT license

{'fraction_non_alphanumeric': 0.04046349089571455, 'fraction_numerical': 0.0055177487585065296, 'mean_word_length': 3.943636363636364, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6903746', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1311, 'n_words': 878}