Revision 442:753f1380d6bc lib/tasks
| lib/tasks/.svn/all-wcprops | ||
|---|---|---|
| 1 | 1 |
K 25 |
| 2 | 2 |
svn:wc:ra_dav:version-url |
| 3 |
V 34 |
|
| 4 |
/svn/!svn/ver/4950/trunk/lib/tasks |
|
| 5 |
END |
|
| 6 |
deprecated.rake |
|
| 7 |
K 25 |
|
| 8 |
svn:wc:ra_dav:version-url |
|
| 9 |
V 49 |
|
| 10 |
/svn/!svn/ver/691/trunk/lib/tasks/deprecated.rake |
|
| 11 |
END |
|
| 12 |
jdbc.rake |
|
| 13 |
K 25 |
|
| 14 |
svn:wc:ra_dav:version-url |
|
| 15 |
V 44 |
|
| 16 |
/svn/!svn/ver/3721/trunk/lib/tasks/jdbc.rake |
|
| 3 |
V 48 |
|
| 4 |
/svn/!svn/ver/5943/branches/1.2-stable/lib/tasks |
|
| 17 | 5 |
END |
| 18 | 6 |
extract_fixtures.rake |
| 19 | 7 |
K 25 |
| 20 | 8 |
svn:wc:ra_dav:version-url |
| 21 |
V 54 |
|
| 22 |
/svn/!svn/ver/67/trunk/lib/tasks/extract_fixtures.rake |
|
| 23 |
END |
|
| 24 |
reminder.rake |
|
| 25 |
K 25 |
|
| 26 |
svn:wc:ra_dav:version-url |
|
| 27 |
V 48 |
|
| 28 |
/svn/!svn/ver/4167/trunk/lib/tasks/reminder.rake |
|
| 29 |
END |
|
| 30 |
metrics.rake |
|
| 31 |
K 25 |
|
| 32 |
svn:wc:ra_dav:version-url |
|
| 33 |
V 47 |
|
| 34 |
/svn/!svn/ver/2825/trunk/lib/tasks/metrics.rake |
|
| 35 |
END |
|
| 36 |
initializers.rake |
|
| 37 |
K 25 |
|
| 38 |
svn:wc:ra_dav:version-url |
|
| 39 |
V 52 |
|
| 40 |
/svn/!svn/ver/4405/trunk/lib/tasks/initializers.rake |
|
| 41 |
END |
|
| 42 |
ciphering.rake |
|
| 43 |
K 25 |
|
| 44 |
svn:wc:ra_dav:version-url |
|
| 45 |
V 49 |
|
| 46 |
/svn/!svn/ver/4950/trunk/lib/tasks/ciphering.rake |
|
| 47 |
END |
|
| 48 |
permissions.rake |
|
| 49 |
K 25 |
|
| 50 |
svn:wc:ra_dav:version-url |
|
| 51 |
V 51 |
|
| 52 |
/svn/!svn/ver/3948/trunk/lib/tasks/permissions.rake |
|
| 53 |
END |
|
| 54 |
load_default_data.rake |
|
| 55 |
K 25 |
|
| 56 |
svn:wc:ra_dav:version-url |
|
| 57 |
V 57 |
|
| 58 |
/svn/!svn/ver/2592/trunk/lib/tasks/load_default_data.rake |
|
| 59 |
END |
|
| 60 |
testing.rake |
|
| 61 |
K 25 |
|
| 62 |
svn:wc:ra_dav:version-url |
|
| 63 |
V 47 |
|
| 64 |
/svn/!svn/ver/4806/trunk/lib/tasks/testing.rake |
|
| 65 |
END |
|
| 66 |
watchers.rake |
|
| 67 |
K 25 |
|
| 68 |
svn:wc:ra_dav:version-url |
|
| 69 |
V 48 |
|
| 70 |
/svn/!svn/ver/3167/trunk/lib/tasks/watchers.rake |
|
| 71 |
END |
|
| 72 |
plugins.rake |
|
| 73 |
K 25 |
|
| 74 |
svn:wc:ra_dav:version-url |
|
| 75 |
V 47 |
|
| 76 |
/svn/!svn/ver/1786/trunk/lib/tasks/plugins.rake |
|
| 77 |
END |
|
| 78 |
yardoc.rake |
|
| 79 |
K 25 |
|
| 80 |
svn:wc:ra_dav:version-url |
|
| 81 |
V 46 |
|
| 82 |
/svn/!svn/ver/3922/trunk/lib/tasks/yardoc.rake |
|
| 9 |
V 70 |
|
| 10 |
/svn/!svn/ver/5878/branches/1.2-stable/lib/tasks/extract_fixtures.rake |
|
| 83 | 11 |
END |
| 84 | 12 |
locales.rake |
| 85 | 13 |
K 25 |
| 86 | 14 |
svn:wc:ra_dav:version-url |
| 87 |
V 47 |
|
| 88 |
/svn/!svn/ver/4937/trunk/lib/tasks/locales.rake |
|
| 89 |
END |
|
| 90 |
migrate_from_trac.rake |
|
| 91 |
K 25 |
|
| 92 |
svn:wc:ra_dav:version-url |
|
| 93 |
V 57 |
|
| 94 |
/svn/!svn/ver/4599/trunk/lib/tasks/migrate_from_trac.rake |
|
| 95 |
END |
|
| 96 |
migrate_from_mantis.rake |
|
| 97 |
K 25 |
|
| 98 |
svn:wc:ra_dav:version-url |
|
| 99 |
V 59 |
|
| 100 |
/svn/!svn/ver/4765/trunk/lib/tasks/migrate_from_mantis.rake |
|
| 15 |
V 61 |
|
| 16 |
/svn/!svn/ver/5878/branches/1.2-stable/lib/tasks/locales.rake |
|
| 101 | 17 |
END |
| 102 | 18 |
email.rake |
| 103 | 19 |
K 25 |
| 104 | 20 |
svn:wc:ra_dav:version-url |
| 105 |
V 45
|
|
| 106 |
/svn/!svn/ver/4256/trunk/lib/tasks/email.rake
|
|
| 21 |
V 59
|
|
| 22 |
/svn/!svn/ver/5943/branches/1.2-stable/lib/tasks/email.rake
|
|
| 107 | 23 |
END |
| 108 |
migrate_plugins.rake |
|
| 109 |
K 25 |
|
| 110 |
svn:wc:ra_dav:version-url |
|
| 111 |
V 54 |
|
| 112 |
/svn/!svn/ver/752/trunk/lib/tasks/migrate_plugins.rake |
|
| 113 |
END |
|
| 114 |
ci.rake |
|
| 115 |
K 25 |
|
| 116 |
svn:wc:ra_dav:version-url |
|
| 117 |
V 42 |
|
| 118 |
/svn/!svn/ver/4643/trunk/lib/tasks/ci.rake |
|
| 119 |
END |
|
| 120 |
fetch_changesets.rake |
|
| 121 |
K 25 |
|
| 122 |
svn:wc:ra_dav:version-url |
|
| 123 |
V 56 |
|
| 124 |
/svn/!svn/ver/1155/trunk/lib/tasks/fetch_changesets.rake |
|
| 125 |
END |
|
| lib/tasks/.svn/entries | ||
|---|---|---|
| 1 | 1 |
10 |
| 2 | 2 |
|
| 3 | 3 |
dir |
| 4 |
4993
|
|
| 5 |
http://redmine.rubyforge.org/svn/trunk/lib/tasks
|
|
| 4 |
6000
|
|
| 5 |
http://redmine.rubyforge.org/svn/branches/1.2-stable/lib/tasks
|
|
| 6 | 6 |
http://redmine.rubyforge.org/svn |
| 7 | 7 |
|
| 8 | 8 |
|
| 9 | 9 |
|
| 10 |
2011-02-26T13:09:25.657748Z
|
|
| 11 |
4950
|
|
| 12 |
jplang
|
|
| 10 |
2011-05-28T03:34:47.536780Z
|
|
| 11 |
5943
|
|
| 12 |
tmaruyama
|
|
| 13 | 13 |
|
| 14 | 14 |
|
| 15 | 15 |
|
| ... | ... | |
| 32 | 32 |
|
| 33 | 33 |
|
| 34 | 34 |
|
| 35 |
2011-03-03T11:05:14.000000Z
|
|
| 35 |
2011-06-06T13:15:00.000000Z
|
|
| 36 | 36 |
03301be8b264b5cb46d05896861dcc4d |
| 37 | 37 |
2007-09-02T08:08:10.346505Z |
| 38 | 38 |
691 |
| ... | ... | |
| 66 | 66 |
|
| 67 | 67 |
|
| 68 | 68 |
|
| 69 |
2011-03-03T11:05:14.000000Z
|
|
| 69 |
2011-06-06T13:15:00.000000Z
|
|
| 70 | 70 |
2ee57ccc06c675e55c38a4153a27c7c3 |
| 71 | 71 |
2010-05-01T09:37:46.451305Z |
| 72 | 72 |
3721 |
| ... | ... | |
| 100 | 100 |
|
| 101 | 101 |
|
| 102 | 102 |
|
| 103 |
2011-03-03T11:05:14.000000Z
|
|
| 104 |
0c57af5536009680bb8c3c3302fc628d
|
|
| 105 |
2006-07-29T09:32:58.780216Z
|
|
| 106 |
12
|
|
| 107 |
jplang
|
|
| 103 |
2011-06-06T13:20:53.000000Z
|
|
| 104 |
7a4ab6c4928c49aa5194dec204164068
|
|
| 105 |
2011-04-28T07:10:13.491200Z
|
|
| 106 |
5560
|
|
| 107 |
tmaruyama
|
|
| 108 | 108 |
|
| 109 | 109 |
|
| 110 | 110 |
|
| ... | ... | |
| 126 | 126 |
|
| 127 | 127 |
|
| 128 | 128 |
|
| 129 |
877
|
|
| 129 |
863
|
|
| 130 | 130 |
|
| 131 | 131 |
reminder.rake |
| 132 | 132 |
file |
| ... | ... | |
| 134 | 134 |
|
| 135 | 135 |
|
| 136 | 136 |
|
| 137 |
2011-03-03T11:05:14.000000Z
|
|
| 137 |
2011-06-06T13:15:00.000000Z
|
|
| 138 | 138 |
07fcf57752978d65a694eb57adcc0851 |
| 139 | 139 |
2010-09-20T23:17:51.402972Z |
| 140 | 140 |
4167 |
| ... | ... | |
| 168 | 168 |
|
| 169 | 169 |
|
| 170 | 170 |
|
| 171 |
2011-03-03T11:05:14.000000Z
|
|
| 171 |
2011-06-06T13:15:00.000000Z
|
|
| 172 | 172 |
0254f4ee916dee0a2572e63e947f8a1b |
| 173 | 173 |
2009-07-27T00:55:43.057910Z |
| 174 | 174 |
2825 |
| ... | ... | |
| 202 | 202 |
|
| 203 | 203 |
|
| 204 | 204 |
|
| 205 |
2011-03-03T11:05:14.000000Z
|
|
| 205 |
2011-06-06T13:15:00.000000Z
|
|
| 206 | 206 |
c25b466de7654465538a91e5f5ab32b9 |
| 207 | 207 |
2010-11-14T15:14:19.280754Z |
| 208 | 208 |
4405 |
| ... | ... | |
| 236 | 236 |
|
| 237 | 237 |
|
| 238 | 238 |
|
| 239 |
2011-03-03T11:40:18.000000Z
|
|
| 239 |
2011-06-06T13:15:00.000000Z
|
|
| 240 | 240 |
b522c20249b1fad89c3276d10ccaaf6b |
| 241 | 241 |
2011-02-26T13:09:25.657748Z |
| 242 | 242 |
4950 |
| ... | ... | |
| 270 | 270 |
|
| 271 | 271 |
|
| 272 | 272 |
|
| 273 |
2011-03-03T11:05:14.000000Z
|
|
| 273 |
2011-06-06T13:15:00.000000Z
|
|
| 274 | 274 |
010fbb563237ff01803aa47736cf863e |
| 275 | 275 |
2010-08-18T17:23:23.071766Z |
| 276 | 276 |
3948 |
| ... | ... | |
| 304 | 304 |
|
| 305 | 305 |
|
| 306 | 306 |
|
| 307 |
2011-03-03T11:05:14.000000Z
|
|
| 307 |
2011-06-06T13:15:00.000000Z
|
|
| 308 | 308 |
984c757ee4c8fa78f649f8dd34b715cf |
| 309 | 309 |
2009-03-15T10:03:56.604709Z |
| 310 | 310 |
2592 |
| ... | ... | |
| 338 | 338 |
|
| 339 | 339 |
|
| 340 | 340 |
|
| 341 |
2011-03-03T11:40:18.000000Z
|
|
| 341 |
2011-06-06T13:15:00.000000Z
|
|
| 342 | 342 |
ca73c8345daa839f0145c671ad94b91f |
| 343 | 343 |
2011-02-11T15:30:45.959165Z |
| 344 | 344 |
4806 |
| ... | ... | |
| 372 | 372 |
|
| 373 | 373 |
|
| 374 | 374 |
|
| 375 |
2011-03-03T11:05:14.000000Z
|
|
| 375 |
2011-06-06T13:15:00.000000Z
|
|
| 376 | 376 |
16eaf27a5959829a12961ff16e233600 |
| 377 | 377 |
2009-12-13T12:39:22.716082Z |
| 378 | 378 |
3167 |
| ... | ... | |
| 406 | 406 |
|
| 407 | 407 |
|
| 408 | 408 |
|
| 409 |
2011-03-03T11:05:14.000000Z
|
|
| 409 |
2011-06-06T13:15:00.000000Z
|
|
| 410 | 410 |
f27a83cf3f04d7906ac2f3ca40d01a20 |
| 411 | 411 |
2008-09-05T10:31:06.632668Z |
| 412 | 412 |
1786 |
| ... | ... | |
| 440 | 440 |
|
| 441 | 441 |
|
| 442 | 442 |
|
| 443 |
2011-03-03T11:05:14.000000Z
|
|
| 443 |
2011-06-06T13:15:00.000000Z
|
|
| 444 | 444 |
5c9889bed6f4a4d18dbeb3d904855bb6 |
| 445 | 445 |
2010-08-07T15:11:26.667915Z |
| 446 | 446 |
3922 |
| ... | ... | |
| 474 | 474 |
|
| 475 | 475 |
|
| 476 | 476 |
|
| 477 |
2011-03-03T11:40:18.000000Z
|
|
| 478 |
ceb44040708bb290ad5b62b5a366e823
|
|
| 479 |
2011-02-23T18:03:33.945201Z
|
|
| 480 |
4937
|
|
| 481 |
jplang
|
|
| 477 |
2011-06-06T13:20:53.000000Z
|
|
| 478 |
d8372de066f74a4f6e71b5795a316cf3
|
|
| 479 |
2011-05-10T11:41:30.089198Z
|
|
| 480 |
5724
|
|
| 481 |
tmaruyama
|
|
| 482 | 482 |
has-props |
| 483 | 483 |
|
| 484 | 484 |
|
| ... | ... | |
| 500 | 500 |
|
| 501 | 501 |
|
| 502 | 502 |
|
| 503 |
4250
|
|
| 503 |
4206
|
|
| 504 | 504 |
|
| 505 | 505 |
migrate_from_trac.rake |
| 506 | 506 |
file |
| ... | ... | |
| 508 | 508 |
|
| 509 | 509 |
|
| 510 | 510 |
|
| 511 |
2011-03-03T11:05:14.000000Z
|
|
| 511 |
2011-06-06T13:15:00.000000Z
|
|
| 512 | 512 |
db60f05f7cd325cbdd984f0b6d7b42ea |
| 513 | 513 |
2010-12-31T15:30:50.544770Z |
| 514 | 514 |
4599 |
| ... | ... | |
| 542 | 542 |
|
| 543 | 543 |
|
| 544 | 544 |
|
| 545 |
2011-03-03T11:05:14.000000Z
|
|
| 545 |
2011-06-06T13:15:00.000000Z
|
|
| 546 | 546 |
ba7db3c8df92c72d300288ec7276dbad |
| 547 | 547 |
2011-01-28T19:45:09.952949Z |
| 548 | 548 |
4765 |
| ... | ... | |
| 576 | 576 |
|
| 577 | 577 |
|
| 578 | 578 |
|
| 579 |
2011-03-03T11:05:14.000000Z
|
|
| 580 |
7875b7a15307c626a93c284f33757320
|
|
| 581 |
2010-10-15T22:50:33.240825Z
|
|
| 582 |
4256
|
|
| 583 |
edavis10
|
|
| 579 |
2011-06-06T13:20:53.000000Z
|
|
| 580 |
6d17052a266b55a94e9d8de784cc1331
|
|
| 581 |
2011-05-28T03:34:47.536780Z
|
|
| 582 |
5943
|
|
| 583 |
tmaruyama
|
|
| 584 | 584 |
|
| 585 | 585 |
|
| 586 | 586 |
|
| ... | ... | |
| 602 | 602 |
|
| 603 | 603 |
|
| 604 | 604 |
|
| 605 |
8244
|
|
| 605 |
8145
|
|
| 606 | 606 |
|
| 607 | 607 |
migrate_plugins.rake |
| 608 | 608 |
file |
| ... | ... | |
| 610 | 610 |
|
| 611 | 611 |
|
| 612 | 612 |
|
| 613 |
2011-03-03T11:05:14.000000Z
|
|
| 613 |
2011-06-06T13:15:00.000000Z
|
|
| 614 | 614 |
82e0901f7cbdda05ed63c12a764c3614 |
| 615 | 615 |
2007-09-23T17:19:27.414302Z |
| 616 | 616 |
752 |
| ... | ... | |
| 644 | 644 |
|
| 645 | 645 |
|
| 646 | 646 |
|
| 647 |
2011-03-03T11:05:14.000000Z
|
|
| 647 |
2011-06-06T13:15:00.000000Z
|
|
| 648 | 648 |
93f8964aea856c06fb2eaa62ca2023c2 |
| 649 | 649 |
2011-01-06T18:52:37.169690Z |
| 650 | 650 |
4643 |
| ... | ... | |
| 678 | 678 |
|
| 679 | 679 |
|
| 680 | 680 |
|
| 681 |
2011-03-03T11:05:14.000000Z
|
|
| 681 |
2011-06-06T13:15:00.000000Z
|
|
| 682 | 682 |
320b77011663b1209247bb809bc43ecb |
| 683 | 683 |
2008-02-16T16:25:58.204498Z |
| 684 | 684 |
1155 |
| lib/tasks/.svn/text-base/email.rake.svn-base | ||
|---|---|---|
| 1 | 1 |
# Redmine - project management software |
| 2 |
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
|
| 3 | 3 |
# |
| 4 | 4 |
# This program is free software; you can redistribute it and/or |
| 5 | 5 |
# modify it under the terms of the GNU General Public License |
| 6 | 6 |
# as published by the Free Software Foundation; either version 2 |
| 7 | 7 |
# of the License, or (at your option) any later version. |
| 8 |
#
|
|
| 8 |
# |
|
| 9 | 9 |
# This program is distributed in the hope that it will be useful, |
| 10 | 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | 12 |
# GNU General Public License for more details. |
| 13 |
#
|
|
| 13 |
# |
|
| 14 | 14 |
# You should have received a copy of the GNU General Public License |
| 15 | 15 |
# along with this program; if not, write to the Free Software |
| 16 | 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| ... | ... | |
| 29 | 29 |
create: create a user account |
| 30 | 30 |
no_permission_check=1 disable permission checking when receiving |
| 31 | 31 |
the email |
| 32 |
|
|
| 32 |
|
|
| 33 | 33 |
Issue attributes control options: |
| 34 | 34 |
project=PROJECT identifier of the target project |
| 35 | 35 |
status=STATUS name of the target status |
| ... | ... | |
| 58 | 58 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| 59 | 59 |
options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
| 60 | 60 |
options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
| 61 |
|
|
| 61 |
|
|
| 62 | 62 |
MailHandler.receive(STDIN.read, options) |
| 63 | 63 |
end |
| 64 |
|
|
| 64 |
|
|
| 65 | 65 |
desc <<-END_DESC |
| 66 | 66 |
Read emails from an IMAP server. |
| 67 | 67 |
|
| ... | ... | |
| 73 | 73 |
create: create a user account |
| 74 | 74 |
no_permission_check=1 disable permission checking when receiving |
| 75 | 75 |
the email |
| 76 |
|
|
| 76 |
|
|
| 77 | 77 |
Available IMAP options: |
| 78 | 78 |
host=HOST IMAP server host (default: 127.0.0.1) |
| 79 | 79 |
port=PORT IMAP server port (default: 143) |
| ... | ... | |
| 81 | 81 |
username=USERNAME IMAP account |
| 82 | 82 |
password=PASSWORD IMAP password |
| 83 | 83 |
folder=FOLDER IMAP folder to read (default: INBOX) |
| 84 |
|
|
| 84 |
|
|
| 85 | 85 |
Issue attributes control options: |
| 86 | 86 |
project=PROJECT identifier of the target project |
| 87 | 87 |
status=STATUS name of the target status |
| ... | ... | |
| 91 | 91 |
allow_override=ATTRS allow email content to override attributes |
| 92 | 92 |
specified by previous options |
| 93 | 93 |
ATTRS is a comma separated list of attributes |
| 94 |
|
|
| 94 |
|
|
| 95 | 95 |
Processed emails control options: |
| 96 | 96 |
move_on_success=MAILBOX move emails that were successfully received |
| 97 | 97 |
to MAILBOX instead of deleting them |
| 98 | 98 |
move_on_failure=MAILBOX move emails that were ignored to MAILBOX |
| 99 |
|
|
| 99 |
|
|
| 100 | 100 |
Examples: |
| 101 | 101 |
# No project specified. Emails MUST contain the 'Project' keyword: |
| 102 |
|
|
| 102 |
|
|
| 103 | 103 |
rake redmine:email:receive_iamp RAILS_ENV="production" \\ |
| 104 | 104 |
host=imap.foo.bar username=redmine@example.net password=xxx |
| 105 | 105 |
|
| 106 | 106 |
|
| 107 | 107 |
# Fixed project and default tracker specified, but emails can override |
| 108 | 108 |
# both tracker and priority attributes: |
| 109 |
|
|
| 109 |
|
|
| 110 | 110 |
rake redmine:email:receive_iamp RAILS_ENV="production" \\ |
| 111 | 111 |
host=imap.foo.bar username=redmine@example.net password=xxx ssl=1 \\ |
| 112 | 112 |
project=foo \\ |
| ... | ... | |
| 123 | 123 |
:folder => ENV['folder'], |
| 124 | 124 |
:move_on_success => ENV['move_on_success'], |
| 125 | 125 |
:move_on_failure => ENV['move_on_failure']} |
| 126 |
|
|
| 126 |
|
|
| 127 | 127 |
options = { :issue => {} }
|
| 128 | 128 |
%w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] }
|
| 129 | 129 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| ... | ... | |
| 132 | 132 |
|
| 133 | 133 |
Redmine::IMAP.check(imap_options, options) |
| 134 | 134 |
end |
| 135 |
|
|
| 135 |
|
|
| 136 | 136 |
desc <<-END_DESC |
| 137 | 137 |
Read emails from an POP3 server. |
| 138 | 138 |
|
| ... | ... | |
| 148 | 148 |
|
| 149 | 149 |
See redmine:email:receive_imap for more options and examples. |
| 150 | 150 |
END_DESC |
| 151 |
|
|
| 151 |
|
|
| 152 | 152 |
task :receive_pop3 => :environment do |
| 153 | 153 |
pop_options = {:host => ENV['host'],
|
| 154 | 154 |
:port => ENV['port'], |
| ... | ... | |
| 156 | 156 |
:username => ENV['username'], |
| 157 | 157 |
:password => ENV['password'], |
| 158 | 158 |
:delete_unprocessed => ENV['delete_unprocessed']} |
| 159 |
|
|
| 159 |
|
|
| 160 | 160 |
options = { :issue => {} }
|
| 161 | 161 |
%w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] }
|
| 162 | 162 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| 163 | 163 |
options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
| 164 | 164 |
options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
| 165 |
|
|
| 165 |
|
|
| 166 | 166 |
Redmine::POP3.check(pop_options, options) |
| 167 | 167 |
end |
| 168 |
|
|
| 168 |
|
|
| 169 | 169 |
desc "Send a test email to the user with the provided login name" |
| 170 | 170 |
task :test, :login, :needs => :environment do |task, args| |
| 171 | 171 |
include Redmine::I18n |
| 172 |
abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
|
|
| 172 |
abort l(:notice_email_error, "Please include the user login to test with. Example: rake redmine:email:test[login]") if args[:login].blank?
|
|
| 173 | 173 |
|
| 174 | 174 |
user = User.find_by_login(args[:login]) |
| 175 |
abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
|
|
| 176 |
|
|
| 175 |
abort l(:notice_email_error, "User #{args[:login]} not found") unless user && user.logged?
|
|
| 176 |
|
|
| 177 | 177 |
ActionMailer::Base.raise_delivery_errors = true |
| 178 | 178 |
begin |
| 179 | 179 |
Mailer.deliver_test(User.current) |
| lib/tasks/.svn/text-base/extract_fixtures.rake.svn-base | ||
|---|---|---|
| 10 | 10 |
File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file|
|
| 11 | 11 |
data = ActiveRecord::Base.connection.select_all(sql % table_name) |
| 12 | 12 |
file.write data.inject({}) { |hash, record|
|
| 13 |
|
|
| 14 |
# cast extracted values |
|
| 15 |
ActiveRecord::Base.connection.columns(table_name).each { |col|
|
|
| 16 |
record[col.name] = col.type_cast(record[col.name]) if record[col.name] |
|
| 17 |
} |
|
| 18 |
|
|
| 19 |
hash["#{table_name}_#{i.succ!}"] = record
|
|
| 20 |
hash |
|
| 13 |
# cast extracted values |
|
| 14 |
ActiveRecord::Base.connection.columns(table_name).each { |col|
|
|
| 15 |
record[col.name] = col.type_cast(record[col.name]) if record[col.name] |
|
| 16 |
} |
|
| 17 |
hash["#{table_name}_#{i.succ!}"] = record
|
|
| 18 |
hash |
|
| 21 | 19 |
}.to_yaml |
| 22 | 20 |
end |
| 23 | 21 |
end |
| 24 |
end |
|
| 22 |
end |
|
| lib/tasks/.svn/text-base/locales.rake.svn-base | ||
|---|---|---|
| 9 | 9 |
desc 'Updates language files based on en.yml content (only works for new top level keys).' |
| 10 | 10 |
task :update do |
| 11 | 11 |
dir = ENV['DIR'] || './config/locales' |
| 12 |
|
|
| 12 |
|
|
| 13 | 13 |
en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en'] |
| 14 |
|
|
| 14 |
|
|
| 15 | 15 |
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
| 16 | 16 |
files.each do |file| |
| 17 | 17 |
puts "Updating file #{file}"
|
| 18 | 18 |
file_strings = YAML.load(File.read(file)) |
| 19 | 19 |
file_strings = file_strings[file_strings.keys.first] |
| 20 |
|
|
| 20 |
|
|
| 21 | 21 |
missing_keys = en_strings.keys - file_strings.keys |
| 22 | 22 |
next if missing_keys.empty? |
| 23 |
|
|
| 23 |
|
|
| 24 | 24 |
puts "==> Missing #{missing_keys.size} keys (#{missing_keys.join(', ')})"
|
| 25 | 25 |
lang = File.open(file, 'a') |
| 26 |
|
|
| 26 |
|
|
| 27 | 27 |
missing_keys.each do |key| |
| 28 | 28 |
{key => en_strings[key]}.to_yaml.each_line do |line|
|
| 29 | 29 |
next if line =~ /^---/ || line.empty? |
| ... | ... | |
| 31 | 31 |
lang << " #{line}"
|
| 32 | 32 |
end |
| 33 | 33 |
end |
| 34 |
|
|
| 34 |
|
|
| 35 | 35 |
lang.close |
| 36 | 36 |
end |
| 37 | 37 |
end |
| 38 |
|
|
| 38 |
|
|
| 39 | 39 |
desc 'Checks interpolation arguments in locals against en.yml' |
| 40 | 40 |
task :check_interpolation do |
| 41 | 41 |
dir = ENV['DIR'] || './config/locales' |
| ... | ... | |
| 44 | 44 |
files.each do |file| |
| 45 | 45 |
file_strings = YAML.load(File.read(file)) |
| 46 | 46 |
file_strings = file_strings[file_strings.keys.first] |
| 47 |
|
|
| 47 |
|
|
| 48 | 48 |
file_strings.each do |key, string| |
| 49 | 49 |
next unless string.is_a?(String) |
| 50 | 50 |
string.scan /%\{\w+\}/ do |match|
|
| ... | ... | |
| 71 | 71 |
deletes = ENV['key'] ? Regexp.union(ENV['key'].split(',')) : nil
|
| 72 | 72 |
# Ignore multiline keys (begin with | or >) and keys with children (nothing meaningful after :) |
| 73 | 73 |
delete_regex = /\A #{deletes}: +[^\|>\s#].*\z/
|
| 74 |
|
|
| 74 |
|
|
| 75 | 75 |
files.each do |path| |
| 76 | 76 |
# Skip certain locales |
| 77 | 77 |
(puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
|
| ... | ... | |
| 80 | 80 |
File.open(path, 'w') {|file| orig_content.each_line {|line| file.puts line unless line.chomp =~ delete_regex}}
|
| 81 | 81 |
end |
| 82 | 82 |
end |
| 83 |
|
|
| 83 |
|
|
| 84 | 84 |
desc <<-END_DESC |
| 85 | 85 |
Adds a new top-level translation string to all locale file (only works for childless keys, probably doesn\'t work on windows, doesn't check for duplicates). |
| 86 | 86 |
|
| lib/tasks/email.rake | ||
|---|---|---|
| 1 | 1 |
# Redmine - project management software |
| 2 |
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
|
| 3 | 3 |
# |
| 4 | 4 |
# This program is free software; you can redistribute it and/or |
| 5 | 5 |
# modify it under the terms of the GNU General Public License |
| 6 | 6 |
# as published by the Free Software Foundation; either version 2 |
| 7 | 7 |
# of the License, or (at your option) any later version. |
| 8 |
#
|
|
| 8 |
# |
|
| 9 | 9 |
# This program is distributed in the hope that it will be useful, |
| 10 | 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | 12 |
# GNU General Public License for more details. |
| 13 |
#
|
|
| 13 |
# |
|
| 14 | 14 |
# You should have received a copy of the GNU General Public License |
| 15 | 15 |
# along with this program; if not, write to the Free Software |
| 16 | 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| ... | ... | |
| 29 | 29 |
create: create a user account |
| 30 | 30 |
no_permission_check=1 disable permission checking when receiving |
| 31 | 31 |
the email |
| 32 |
|
|
| 32 |
|
|
| 33 | 33 |
Issue attributes control options: |
| 34 | 34 |
project=PROJECT identifier of the target project |
| 35 | 35 |
status=STATUS name of the target status |
| ... | ... | |
| 58 | 58 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| 59 | 59 |
options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
| 60 | 60 |
options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
| 61 |
|
|
| 61 |
|
|
| 62 | 62 |
MailHandler.receive(STDIN.read, options) |
| 63 | 63 |
end |
| 64 |
|
|
| 64 |
|
|
| 65 | 65 |
desc <<-END_DESC |
| 66 | 66 |
Read emails from an IMAP server. |
| 67 | 67 |
|
| ... | ... | |
| 73 | 73 |
create: create a user account |
| 74 | 74 |
no_permission_check=1 disable permission checking when receiving |
| 75 | 75 |
the email |
| 76 |
|
|
| 76 |
|
|
| 77 | 77 |
Available IMAP options: |
| 78 | 78 |
host=HOST IMAP server host (default: 127.0.0.1) |
| 79 | 79 |
port=PORT IMAP server port (default: 143) |
| ... | ... | |
| 81 | 81 |
username=USERNAME IMAP account |
| 82 | 82 |
password=PASSWORD IMAP password |
| 83 | 83 |
folder=FOLDER IMAP folder to read (default: INBOX) |
| 84 |
|
|
| 84 |
|
|
| 85 | 85 |
Issue attributes control options: |
| 86 | 86 |
project=PROJECT identifier of the target project |
| 87 | 87 |
status=STATUS name of the target status |
| ... | ... | |
| 91 | 91 |
allow_override=ATTRS allow email content to override attributes |
| 92 | 92 |
specified by previous options |
| 93 | 93 |
ATTRS is a comma separated list of attributes |
| 94 |
|
|
| 94 |
|
|
| 95 | 95 |
Processed emails control options: |
| 96 | 96 |
move_on_success=MAILBOX move emails that were successfully received |
| 97 | 97 |
to MAILBOX instead of deleting them |
| 98 | 98 |
move_on_failure=MAILBOX move emails that were ignored to MAILBOX |
| 99 |
|
|
| 99 |
|
|
| 100 | 100 |
Examples: |
| 101 | 101 |
# No project specified. Emails MUST contain the 'Project' keyword: |
| 102 |
|
|
| 102 |
|
|
| 103 | 103 |
rake redmine:email:receive_iamp RAILS_ENV="production" \\ |
| 104 | 104 |
host=imap.foo.bar username=redmine@example.net password=xxx |
| 105 | 105 |
|
| 106 | 106 |
|
| 107 | 107 |
# Fixed project and default tracker specified, but emails can override |
| 108 | 108 |
# both tracker and priority attributes: |
| 109 |
|
|
| 109 |
|
|
| 110 | 110 |
rake redmine:email:receive_iamp RAILS_ENV="production" \\ |
| 111 | 111 |
host=imap.foo.bar username=redmine@example.net password=xxx ssl=1 \\ |
| 112 | 112 |
project=foo \\ |
| ... | ... | |
| 123 | 123 |
:folder => ENV['folder'], |
| 124 | 124 |
:move_on_success => ENV['move_on_success'], |
| 125 | 125 |
:move_on_failure => ENV['move_on_failure']} |
| 126 |
|
|
| 126 |
|
|
| 127 | 127 |
options = { :issue => {} }
|
| 128 | 128 |
%w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] }
|
| 129 | 129 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| ... | ... | |
| 132 | 132 |
|
| 133 | 133 |
Redmine::IMAP.check(imap_options, options) |
| 134 | 134 |
end |
| 135 |
|
|
| 135 |
|
|
| 136 | 136 |
desc <<-END_DESC |
| 137 | 137 |
Read emails from an POP3 server. |
| 138 | 138 |
|
| ... | ... | |
| 148 | 148 |
|
| 149 | 149 |
See redmine:email:receive_imap for more options and examples. |
| 150 | 150 |
END_DESC |
| 151 |
|
|
| 151 |
|
|
| 152 | 152 |
task :receive_pop3 => :environment do |
| 153 | 153 |
pop_options = {:host => ENV['host'],
|
| 154 | 154 |
:port => ENV['port'], |
| ... | ... | |
| 156 | 156 |
:username => ENV['username'], |
| 157 | 157 |
:password => ENV['password'], |
| 158 | 158 |
:delete_unprocessed => ENV['delete_unprocessed']} |
| 159 |
|
|
| 159 |
|
|
| 160 | 160 |
options = { :issue => {} }
|
| 161 | 161 |
%w(project status tracker category priority).each { |a| options[:issue][a.to_sym] = ENV[a] if ENV[a] }
|
| 162 | 162 |
options[:allow_override] = ENV['allow_override'] if ENV['allow_override'] |
| 163 | 163 |
options[:unknown_user] = ENV['unknown_user'] if ENV['unknown_user'] |
| 164 | 164 |
options[:no_permission_check] = ENV['no_permission_check'] if ENV['no_permission_check'] |
| 165 |
|
|
| 165 |
|
|
| 166 | 166 |
Redmine::POP3.check(pop_options, options) |
| 167 | 167 |
end |
| 168 |
|
|
| 168 |
|
|
| 169 | 169 |
desc "Send a test email to the user with the provided login name" |
| 170 | 170 |
task :test, :login, :needs => :environment do |task, args| |
| 171 | 171 |
include Redmine::I18n |
| 172 |
abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
|
|
| 172 |
abort l(:notice_email_error, "Please include the user login to test with. Example: rake redmine:email:test[login]") if args[:login].blank?
|
|
| 173 | 173 |
|
| 174 | 174 |
user = User.find_by_login(args[:login]) |
| 175 |
abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
|
|
| 176 |
|
|
| 175 |
abort l(:notice_email_error, "User #{args[:login]} not found") unless user && user.logged?
|
|
| 176 |
|
|
| 177 | 177 |
ActionMailer::Base.raise_delivery_errors = true |
| 178 | 178 |
begin |
| 179 | 179 |
Mailer.deliver_test(User.current) |
| lib/tasks/extract_fixtures.rake | ||
|---|---|---|
| 10 | 10 |
File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file|
|
| 11 | 11 |
data = ActiveRecord::Base.connection.select_all(sql % table_name) |
| 12 | 12 |
file.write data.inject({}) { |hash, record|
|
| 13 |
|
|
| 14 |
# cast extracted values |
|
| 15 |
ActiveRecord::Base.connection.columns(table_name).each { |col|
|
|
| 16 |
record[col.name] = col.type_cast(record[col.name]) if record[col.name] |
|
| 17 |
} |
|
| 18 |
|
|
| 19 |
hash["#{table_name}_#{i.succ!}"] = record
|
|
| 20 |
hash |
|
| 13 |
# cast extracted values |
|
| 14 |
ActiveRecord::Base.connection.columns(table_name).each { |col|
|
|
| 15 |
record[col.name] = col.type_cast(record[col.name]) if record[col.name] |
|
| 16 |
} |
|
| 17 |
hash["#{table_name}_#{i.succ!}"] = record
|
|
| 18 |
hash |
|
| 21 | 19 |
}.to_yaml |
| 22 | 20 |
end |
| 23 | 21 |
end |
| 24 |
end |
|
| 22 |
end |
|
| lib/tasks/locales.rake | ||
|---|---|---|
| 9 | 9 |
desc 'Updates language files based on en.yml content (only works for new top level keys).' |
| 10 | 10 |
task :update do |
| 11 | 11 |
dir = ENV['DIR'] || './config/locales' |
| 12 |
|
|
| 12 |
|
|
| 13 | 13 |
en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en'] |
| 14 |
|
|
| 14 |
|
|
| 15 | 15 |
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
| 16 | 16 |
files.each do |file| |
| 17 | 17 |
puts "Updating file #{file}"
|
| 18 | 18 |
file_strings = YAML.load(File.read(file)) |
| 19 | 19 |
file_strings = file_strings[file_strings.keys.first] |
| 20 |
|
|
| 20 |
|
|
| 21 | 21 |
missing_keys = en_strings.keys - file_strings.keys |
| 22 | 22 |
next if missing_keys.empty? |
| 23 |
|
|
| 23 |
|
|
| 24 | 24 |
puts "==> Missing #{missing_keys.size} keys (#{missing_keys.join(', ')})"
|
| 25 | 25 |
lang = File.open(file, 'a') |
| 26 |
|
|
| 26 |
|
|
| 27 | 27 |
missing_keys.each do |key| |
| 28 | 28 |
{key => en_strings[key]}.to_yaml.each_line do |line|
|
| 29 | 29 |
next if line =~ /^---/ || line.empty? |
| ... | ... | |
| 31 | 31 |
lang << " #{line}"
|
| 32 | 32 |
end |
| 33 | 33 |
end |
| 34 |
|
|
| 34 |
|
|
| 35 | 35 |
lang.close |
| 36 | 36 |
end |
| 37 | 37 |
end |
| 38 |
|
|
| 38 |
|
|
| 39 | 39 |
desc 'Checks interpolation arguments in locals against en.yml' |
| 40 | 40 |
task :check_interpolation do |
| 41 | 41 |
dir = ENV['DIR'] || './config/locales' |
| ... | ... | |
| 44 | 44 |
files.each do |file| |
| 45 | 45 |
file_strings = YAML.load(File.read(file)) |
| 46 | 46 |
file_strings = file_strings[file_strings.keys.first] |
| 47 |
|
|
| 47 |
|
|
| 48 | 48 |
file_strings.each do |key, string| |
| 49 | 49 |
next unless string.is_a?(String) |
| 50 | 50 |
string.scan /%\{\w+\}/ do |match|
|
| ... | ... | |
| 71 | 71 |
deletes = ENV['key'] ? Regexp.union(ENV['key'].split(',')) : nil
|
| 72 | 72 |
# Ignore multiline keys (begin with | or >) and keys with children (nothing meaningful after :) |
| 73 | 73 |
delete_regex = /\A #{deletes}: +[^\|>\s#].*\z/
|
| 74 |
|
|
| 74 |
|
|
| 75 | 75 |
files.each do |path| |
| 76 | 76 |
# Skip certain locales |
| 77 | 77 |
(puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
|
| ... | ... | |
| 80 | 80 |
File.open(path, 'w') {|file| orig_content.each_line {|line| file.puts line unless line.chomp =~ delete_regex}}
|
| 81 | 81 |
end |
| 82 | 82 |
end |
| 83 |
|
|
| 83 |
|
|
| 84 | 84 |
desc <<-END_DESC |
| 85 | 85 |
Adds a new top-level translation string to all locale file (only works for childless keys, probably doesn\'t work on windows, doesn't check for duplicates). |
| 86 | 86 |
|
Also available in: Unified diff