automatic 14.12.2 → 26.08

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +635 -83
  3. data/VERSION +1 -1
  4. data/automatic.gemspec +109 -248
  5. data/bin/automatic +20 -139
  6. data/config/feed2console.yml +10 -4
  7. data/config/feed2markdown.yml +41 -0
  8. data/doc/AI_TUTORIAL.md +518 -0
  9. data/doc/BASIC_DESIGN.md +516 -0
  10. data/doc/COPYING.LESSER +165 -0
  11. data/doc/DEPLOYMENT.md +824 -0
  12. data/doc/LICENSE.md +14 -0
  13. data/doc/PLUGINS.md +1875 -0
  14. data/doc/PLUGIN_DEVELOPMENT.md +86 -0
  15. data/doc/POLICY.md +857 -0
  16. data/doc/QUICKSTART.md +256 -0
  17. data/doc/RELEASING.md +381 -0
  18. data/doc/REQUIREMENTS.md +526 -0
  19. data/doc/VERSIONS +208 -0
  20. data/lib/automatic/cli.rb +248 -0
  21. data/lib/automatic/environment.rb +31 -5
  22. data/lib/automatic/feed_maker.rb +10 -9
  23. data/lib/automatic/feed_parser.rb +51 -35
  24. data/lib/automatic/http.rb +107 -0
  25. data/lib/automatic/log.rb +49 -18
  26. data/lib/automatic/opml.rb +3 -1
  27. data/lib/automatic/pipeline.rb +63 -32
  28. data/lib/automatic/recipe.rb +56 -17
  29. data/lib/automatic/version.rb +14 -1
  30. data/lib/automatic.rb +78 -20
  31. data/plugins/custom_feed/svn_log.rb +73 -32
  32. data/plugins/custom_feed/web.rb +348 -0
  33. data/plugins/filter/absolute_uri.rb +43 -27
  34. data/plugins/filter/accept.rb +38 -45
  35. data/plugins/filter/claude.rb +217 -0
  36. data/plugins/filter/clear.rb +12 -8
  37. data/plugins/filter/description_link.rb +49 -51
  38. data/plugins/filter/full_feed.rb +158 -52
  39. data/plugins/filter/gemini.rb +216 -0
  40. data/plugins/filter/github_feed.rb +38 -26
  41. data/plugins/filter/ignore.rb +33 -44
  42. data/plugins/filter/image.rb +36 -25
  43. data/plugins/filter/image_source.rb +58 -52
  44. data/plugins/filter/join.rb +107 -0
  45. data/plugins/filter/one.rb +19 -26
  46. data/plugins/filter/open_ai.rb +198 -0
  47. data/plugins/filter/rand.rb +16 -17
  48. data/plugins/filter/sakura_ai.rb +205 -0
  49. data/plugins/filter/sanitize.rb +29 -34
  50. data/plugins/filter/sort.rb +20 -27
  51. data/plugins/filter/tumblr_resize.rb +31 -23
  52. data/plugins/notify/ikachan.rb +86 -48
  53. data/plugins/provide/fluentd.rb +43 -24
  54. data/plugins/publish/amazon_s3.rb +73 -40
  55. data/plugins/publish/console.rb +19 -16
  56. data/plugins/publish/console_link.rb +20 -17
  57. data/plugins/publish/eject.rb +48 -26
  58. data/plugins/publish/fluentd.rb +50 -30
  59. data/plugins/publish/hatena_bookmark.rb +88 -71
  60. data/plugins/publish/instapaper.rb +69 -59
  61. data/plugins/publish/markdown.rb +278 -0
  62. data/plugins/publish/memcached.rb +35 -29
  63. data/plugins/store/database.rb +50 -48
  64. data/plugins/store/digest.rb +212 -0
  65. data/plugins/store/file.rb +99 -68
  66. data/plugins/store/full_text.rb +32 -25
  67. data/plugins/store/permalink.rb +18 -22
  68. data/plugins/subscription/feed.rb +34 -21
  69. data/plugins/subscription/link.rb +31 -32
  70. data/plugins/subscription/text.rb +32 -46
  71. data/plugins/subscription/tumblr.rb +55 -44
  72. data/plugins/subscription/xml.rb +40 -36
  73. metadata +108 -321
  74. data/Gemfile +0 -38
  75. data/Rakefile +0 -59
  76. data/doc/ChangeLog +0 -303
  77. data/doc/PLUGINS +0 -750
  78. data/doc/PLUGINS.ja +0 -753
  79. data/doc/README +0 -511
  80. data/doc/README.ja +0 -519
  81. data/plugins/filter/google_news.rb +0 -50
  82. data/plugins/publish/google_calendar.rb +0 -84
  83. data/plugins/publish/hipchat.rb +0 -46
  84. data/plugins/publish/pocket.rb +0 -45
  85. data/plugins/publish/twitter.rb +0 -58
  86. data/plugins/subscription/chan_toru.rb +0 -57
  87. data/plugins/subscription/g_guide.rb +0 -57
  88. data/plugins/subscription/pocket.rb +0 -51
  89. data/plugins/subscription/twitter.rb +0 -69
  90. data/plugins/subscription/twitter_search.rb +0 -50
  91. data/plugins/subscription/weather.rb +0 -33
  92. data/script/build +0 -84
  93. data/spec/fixtures/sampleFeeds.tsv +0 -1
  94. data/spec/fixtures/sampleFeeds2.tsv +0 -2
  95. data/spec/fixtures/sampleRecipe.yml +0 -24
  96. data/spec/lib/automatic/log_spec.rb +0 -32
  97. data/spec/lib/automatic/pipeline_spec.rb +0 -68
  98. data/spec/lib/automatic/recipe_spec.rb +0 -40
  99. data/spec/lib/automatic_spec.rb +0 -99
  100. data/spec/plugins/custom_feed/svn_log_spec.rb +0 -31
  101. data/spec/plugins/filter/absolute_uri_spec.rb +0 -61
  102. data/spec/plugins/filter/accept_spec.rb +0 -331
  103. data/spec/plugins/filter/clear_spec.rb +0 -49
  104. data/spec/plugins/filter/description_link_spec.rb +0 -138
  105. data/spec/plugins/filter/full_feed_spec.rb +0 -129
  106. data/spec/plugins/filter/github_feed_spec.rb +0 -55
  107. data/spec/plugins/filter/google_news_spec.rb +0 -69
  108. data/spec/plugins/filter/ignore_spec.rb +0 -328
  109. data/spec/plugins/filter/image_source_spec.rb +0 -89
  110. data/spec/plugins/filter/image_spec.rb +0 -65
  111. data/spec/plugins/filter/one_spec.rb +0 -71
  112. data/spec/plugins/filter/rand_spec.rb +0 -52
  113. data/spec/plugins/filter/sanitize_spec.rb +0 -153
  114. data/spec/plugins/filter/sort_spec.rb +0 -189
  115. data/spec/plugins/filter/tumblr_resize_spec.rb +0 -109
  116. data/spec/plugins/notify/ikachan_spec.rb +0 -58
  117. data/spec/plugins/provide/fluentd_spec.rb +0 -49
  118. data/spec/plugins/publish/amazon_s3_spec.rb +0 -40
  119. data/spec/plugins/publish/console_spec.rb +0 -30
  120. data/spec/plugins/publish/eject_spec.rb +0 -40
  121. data/spec/plugins/publish/fluentd_spec.rb +0 -40
  122. data/spec/plugins/publish/google_calendar_spec.rb +0 -83
  123. data/spec/plugins/publish/hatena_bookmark_spec.rb +0 -134
  124. data/spec/plugins/publish/hipchat_spec.rb +0 -69
  125. data/spec/plugins/publish/instapaper_spec.rb +0 -82
  126. data/spec/plugins/publish/memcached_spec.rb +0 -63
  127. data/spec/plugins/publish/pocket_spec.rb +0 -51
  128. data/spec/plugins/publish/twitter_spec.rb +0 -73
  129. data/spec/plugins/store/file_spec.rb +0 -58
  130. data/spec/plugins/store/full_text_spec.rb +0 -152
  131. data/spec/plugins/store/permalink_spec.rb +0 -206
  132. data/spec/plugins/subscription/chan_toru_spec.rb +0 -56
  133. data/spec/plugins/subscription/feed_spec.rb +0 -71
  134. data/spec/plugins/subscription/g_guide_spec.rb +0 -82
  135. data/spec/plugins/subscription/link_spec.rb +0 -72
  136. data/spec/plugins/subscription/pocket_spec.rb +0 -57
  137. data/spec/plugins/subscription/text_spec.rb +0 -84
  138. data/spec/plugins/subscription/tumblr_spec.rb +0 -74
  139. data/spec/plugins/subscription/twitter_search_spec.rb +0 -57
  140. data/spec/plugins/subscription/twitter_spec.rb +0 -73
  141. data/spec/plugins/subscription/weather_spec.rb +0 -44
  142. data/spec/plugins/subscription/xml_spec.rb +0 -84
  143. data/spec/spec_helper.rb +0 -106
  144. data/spec/user_dir/plugins/store/mock.rb +0 -16
  145. data/test/fixtures/sampleOPML.xml +0 -11
  146. data/test/integration/test_absoluteurl.yml +0 -25
  147. data/test/integration/test_activerecord.yml +0 -24
  148. data/test/integration/test_add_pocket.yml +0 -26
  149. data/test/integration/test_chan_toru.yml +0 -21
  150. data/test/integration/test_descriptionlink.yml +0 -21
  151. data/test/integration/test_fluentd.yml +0 -22
  152. data/test/integration/test_fulltext.yml +0 -30
  153. data/test/integration/test_google_news.yml +0 -21
  154. data/test/integration/test_googlealert.yml +0 -21
  155. data/test/integration/test_hatenabookmark.yml +0 -30
  156. data/test/integration/test_ignore.yml +0 -25
  157. data/test/integration/test_ignore2.yml +0 -22
  158. data/test/integration/test_image2local.yml +0 -33
  159. data/test/integration/test_instapaper.yml +0 -26
  160. data/test/integration/test_link2local.yml +0 -34
  161. data/test/integration/test_one.yml +0 -23
  162. data/test/integration/test_pocket.yml +0 -22
  163. data/test/integration/test_rand.yml +0 -21
  164. data/test/integration/test_sanitize.yml +0 -23
  165. data/test/integration/test_sort.yml +0 -36
  166. data/test/integration/test_svnlog.yml +0 -15
  167. data/test/integration/test_text2feed.yml +0 -36
  168. data/test/integration/test_tumblr2local.yml +0 -43
  169. data/test/integration/test_twitter_search.yml +0 -22
  170. data/test/integration/test_weather.yml +0 -19
  171. data/test/integration/test_xml2fluentd.yml +0 -21
  172. data/vendor/.gitkeep +0 -0
data/doc/README DELETED
@@ -1,511 +0,0 @@
1
- automaticruby
2
-
3
- Name
4
- Automatic Ruby - Ruby framework for the general-purpose automatic processing
5
-
6
- Syntax
7
- $ automatic
8
-
9
- Specify the start of any recipe
10
- $ automatic -c <recipe>
11
-
12
- To view the version number
13
- $ automatic -v
14
-
15
- Description
16
- This is a general-purpose automatic processing
17
- ruby framework which can extend the functionality
18
- by plug-ins.
19
-
20
-
21
- ============
22
- Installation
23
- ============
24
-
25
- [Stable]
26
- $ gem install automatic
27
- $ automatic scaffold
28
- (Make ~/.automatic on your home directory.)
29
- $ automatic -c ~/.automatic/config/example/feed2console.yml
30
- (This process will be output my blog feed to your terminal.)
31
-
32
-
33
- [Development]
34
- $ git clone git://github.com/automaticruby/automaticruby.git
35
- $ cd automaticruby
36
- $ bundle install --path vendor/gems
37
- $ bin/automatic scaffold
38
- $ bin/automatic -c ~/.automatic/config/example/feed2console.yml
39
- (The same as above.)
40
-
41
-
42
- ===========
43
- Get Started
44
- ===========
45
-
46
- Create of any recipe (see below).
47
- $ automatic -c your_recipe.yml
48
-
49
- -c option to run with the manual. If there is no problem
50
- to automate, register it to cron.
51
-
52
- If you specify the-c argument of a simple file name, load
53
- the file located in ~ /.automatic/config. If not exist,
54
- load file as specified in the path.
55
-
56
- If ~/.automatic/db exists, plug-ins save the file to this
57
- directory.
58
-
59
- If ~/.automatic/plugins exists, the plug-ins be loaded
60
- as well.
61
-
62
-
63
- This is the easy recipe to simply output blog's feed to
64
- only console. It can be used to check the operation of
65
- this software.
66
- $ automatic -c ~/.automatic/config/example/feed2console.yml
67
-
68
-
69
- =======
70
- Recipes
71
- =======
72
-
73
- Automatic Ruby parses configuration file that was written
74
- in the form of YAML which including variety of information
75
- of associated plug-ins.
76
-
77
- This YAML file is called "Recipe".
78
-
79
- You can use -c option for specify a file name.
80
-
81
- [Example]
82
- $ automatic -c your_recipe.yml
83
-
84
-
85
- =====================
86
- How to write a Recipe
87
- =====================
88
-
89
- The Recipe has an implicit naming convention.
90
-
91
- [Syntax]
92
-
93
- plugins:
94
- - module: MODULE_NAME
95
- config:
96
- VARIABLES
97
-
98
-
99
- The following is a example.
100
-
101
- plugins:
102
- - module: SubscriptionFeed
103
- config:
104
- feeds:
105
- - http://reretlet.tumblr.com/rss
106
-
107
- - module: StorePermalink
108
- config:
109
- db: tumblr.db
110
-
111
- - module: FilterImage
112
-
113
- - module: FilterTumblrResize
114
-
115
- - module: StoreFile
116
- config:
117
- path: /Users/yourname/Desktop/
118
- interval: 1
119
-
120
- In the case of sample this recipe.
121
- 1. Subscribe to RSS feeds of Tumblr by SubScriptionFeed.
122
- 2. Save permalink to database by StorePermalink.
123
- 3. Specify the URL of the image by FilterImage and FilterTumblrResize.
124
- 4. Downloading image file of Tumblr by StoreFile.
125
-
126
-
127
- Showing another example as follows.
128
-
129
- plugins:
130
- - module: SubscriptionFeed
131
- config:
132
- feeds:
133
- - http://example.com/rss2
134
- - http://hogefuga.com/feed
135
-
136
- - module: FilterIgnore
137
- config:
138
- link:
139
- - hoge
140
- - fuga
141
-
142
- - module: StorePermalink
143
- config:
144
- db: permalink.db
145
-
146
- - module: PublishHatenaBookmark
147
- config:
148
- username: your_hatena_id
149
- password: your_password
150
- interval: 5
151
-
152
- In the case of sample this recipe.
153
- 1. Subscribe to 2 RSS feeds by SubScriptionFeed.
154
- 2. Feed ignore the keyword by FilterIgnore.
155
- 3. Save permalink to database by StorePermalink.
156
- 4. Social Bookmarking by PublishHatenaBookmark.
157
-
158
- (Hatena Bookmark is a most popular social bookmark service
159
- in Japan.)
160
-
161
-
162
- These have been realized by a combination of plug-ins
163
- a series of processes.
164
-
165
- In this way, by simply writing to the recipe and
166
- configuration information for plug-ins, free processing can
167
- be achieved by a combination of multiple plug-ins.
168
-
169
- The possibility of infinite depending on the combination
170
- of plug-ins can be realized.
171
-
172
- All depending on whether you make a plug-in looks like!
173
-
174
-
175
- =======
176
- Plug-in
177
- =======
178
-
179
- Plug-ins from the plugins directory (see below) will be loaded.
180
-
181
- If ~ /.automatic/plugins exists, is loaded into them as well.
182
-
183
- Put your own plug-ins in your home directory.
184
- (How to make the plug-in will be described later.)
185
-
186
- You can automatically generate a sub-directory for your own plug-ins
187
- with the following command.
188
-
189
- $ automatic scaffold
190
- (For a description of automatic subcommands will be described later.)
191
-
192
-
193
- ============================
194
- Directory and file structure
195
- ============================
196
- .
197
- |
198
- +-+ bin
199
- | |
200
- | +-- automatic
201
- | The main file for run.
202
- |
203
- +-- config
204
- |
205
- | Describe the recipe information in the form of yaml.
206
- | They called in the argument -c option of Automatic Ruby.
207
- | If you write a new recipe, locate it in the config directory.
208
- |
209
- |
210
- +-+ plugins
211
- | |
212
- | +-- subscription
213
- | | Plug-ins to subscribe to feeds.
214
- | |
215
- | +-- customfeed
216
- | | Plug-ins to generate a custom feed.
217
- | |
218
- | +-- filter
219
- | | Plug-ins to filter the information.
220
- | |
221
- | +-- store
222
- | | Plug-ins to store the information to internally.
223
- | |
224
- | +-- notify
225
- | | Plug-ins to notify the information.
226
- | |
227
- | +-- publish
228
- | Plug-ins to send information to external.
229
- |
230
- | If you write a new plug-in, locate it in the plugins directory.
231
- |
232
- |
233
- +-+ lib
234
- | |
235
- | +-- automatic.rb
236
- | | To the definition of automatic module.
237
- | |
238
- | +-+ automatic
239
- | |
240
- | +-- environment.rb
241
- | | Read the environmental information.
242
- | |
243
- | +-- pipeline.rb
244
- | | To use an object called a pipeline
245
- | | sequentially processing plug-ins in recipes.
246
- | |
247
- | +-- feed_parser.rb
248
- | | To parse the feed.
249
- | |
250
- | +-- log.rb
251
- | | To output logs.
252
- | |
253
- | +-- recipe.rb
254
- | Read a recipes.
255
- |
256
- +-- db
257
- |
258
- | If ~/.automatic/db not exist, save db file here.
259
- |
260
- +-- assets
261
- |
262
- | There are some files that needed in a plug-ins.
263
- | If ~/.automatic/assets exist, takes precedence it.
264
- |
265
- +-+ script
266
- | |
267
- | +-- build
268
- | Run Integration Test that carried out on CI.
269
- |
270
- +-- spec
271
- | Directory for unit tests (Use RSpec).
272
- |
273
- +-+ test
274
- | |
275
- | +-- fixtures
276
- | | Fixtures for test.
277
- | |
278
- | +-- integration
279
- | Directory for the Integration Test.
280
- |
281
- +-+ vendor
282
- | |
283
- | +-- gems
284
- | Bundle installed gem packages.
285
- |
286
- +---+ doc
287
- |
288
- +-- COPYING
289
- | The license for this software.
290
- |
291
- +-- ChangeLog
292
- | Update history.
293
- |
294
- +-- PLUGINS
295
- | Documentation for plug-ins.
296
- |
297
- +-- README
298
- This document.
299
-
300
-
301
-
302
- ===========
303
- Development
304
- ===========
305
-
306
- Repository
307
- https://github.com/automaticruby/automaticruby
308
-
309
- Issues
310
- https://github.com/automaticruby/automaticruby/issues
311
-
312
- RubyForge
313
- http://rubyforge.org/projects/automatic/
314
-
315
- RubyGems.org
316
- https://rubygems.org/gems/automatic
317
-
318
- CI
319
- http://jenkins.id774.net/jenkins/
320
-
321
-
322
- ===========
323
- How to Join
324
- ===========
325
-
326
- 1. Fork the repository.
327
- 2. Write new plugin or existing code improvement.
328
- 3. Send pull request!
329
-
330
- After that, we will give you the right to commit for a quick fix finely.
331
-
332
-
333
- ===========
334
- Coding Rule
335
- ===========
336
-
337
- Coding standards should be completed in 1 file.
338
- Remove trailing spaces.
339
- {} is recommended than do end (To avoid end end end,,).
340
- RDoc Header is written by creator of the file.
341
- Write tests with RSPec.
342
- Aim at 100% coverage.
343
-
344
-
345
- ===================
346
- Automatic::Pipeline
347
- ===================
348
-
349
- This framework sequentially analyze a plug-ins on yaml recipe.
350
- At this time, pipeline passed instantance as an argument. And then,
351
- pipeline backs again as the return value.
352
-
353
- Code is as follows.
354
-
355
- pipeline = []
356
- recipe.each_plugin {|plugin|
357
- mod = plugin.module
358
- load_plugin(mod)
359
- klass = Automatic::Plugin.const_get(mod)
360
- pipeline = klass.new(plugin.config, pipeline).run
361
- }
362
-
363
- In this iteration, sequential processing can be realized.
364
-
365
- This mechanism called "Automatic::Pipeline".
366
-
367
- The contents of the pipeline is the array of the feeds.
368
-
369
-
370
- =============================
371
- Implementation of the plug-in
372
- =============================
373
-
374
- Plug-in is loaded by the constructor of YAML.load
375
- Class is recieved the array of hashes as the instance
376
- variable of pipelines object.
377
-
378
- Example implementation of the constructor that is recommended
379
- is as follows.
380
-
381
- def initialize(config, pipeline=[])
382
- @config = config
383
- @pipeline = pipeline
384
- end
385
-
386
- Run an instance method is called automatically. The return value
387
- is on the instance variable @pipeline. And then, be handed over
388
- to the next plug-in in the recipe.
389
-
390
- @pipeline's data format should be combined. If the preceding
391
- plug-in will return an RSS feed, you need to write handle the
392
- RSS feed. If the one will return as HTML, you need to write
393
- code to handle HTML.
394
-
395
-
396
- =========
397
- Unit Test
398
- =========
399
-
400
- Unit testing is performed in RSpec.
401
-
402
- Test of the plug-in, pass the pipeline which will be the argument,
403
- to check the return value.
404
-
405
-
406
- ============
407
- Binding Test
408
- ============
409
-
410
- To combine more than one recipe under the test/integration.
411
- Put the recipe for the binding test.
412
-
413
- Before you check-in to the repository, run following
414
- command with ruby 1.9.
415
- $ script/build
416
-
417
- By this, all RSpec tests and binding tests will be conducted.
418
- You can check-in to the repository after all test successed.
419
- Otherwise, CI will fail.
420
-
421
-
422
- ======================
423
- Continuous Integration
424
- ======================
425
-
426
- CI is performed in Jenkins.
427
- http://jenkins.id774.net/jenkins/
428
-
429
-
430
- ===========================
431
- Description of the plug-ins
432
- ===========================
433
-
434
- See doc/PLUGINS.
435
-
436
-
437
-
438
- ===========
439
- SubCommands
440
- ===========
441
-
442
- automatic has the auxiliary tool in subcommands.
443
-
444
- [Syntax]
445
- $ automatic
446
- Show help and list of sub-command.
447
-
448
- $ automatic scaffold
449
- Make ~/.automatic directory in your home directory.
450
- This operation makes 'plugins', 'db', 'config', 'assets' directories.
451
- These takes precedence the origin directory.
452
-
453
- $ automatic unscaffold
454
- Delete ~/.automatic directory.
455
-
456
- $ automatic autodiscovery <url>
457
- Return the URL of the feed of target detected by auto discovery.
458
- (ex.)
459
- $ automatic autodiscovery http://blog.id774.net/post
460
- ["http://blog.id774.net/post/feed/", "http://blog.id774.net/post/comments/feed/"]
461
-
462
- $ automatic opmlparser <opml path>
463
- Output the URLs to parse the OPML file.
464
- (ex.)
465
- $ automatic opmlparser opml.xml > feeds.txt
466
-
467
- $ automatic feedparser <url>
468
- Return the contents to parse the feed.
469
-
470
- $ automatic inspect <url>
471
- Return the URL of the feed of target detected by auto discovery.
472
- Return the contents to parse the first feed further.
473
- This inspects verify the target subscriptionable.
474
-
475
- $ automatic log <level> <message>
476
- Output log messages in the form of Automatic Ruby.
477
-
478
-
479
-
480
- ==============
481
- Update History
482
- ==============
483
-
484
- See doc/ChangeLog.
485
-
486
-
487
- ====
488
- TODO
489
- ====
490
-
491
- Refer to the issues of github.
492
- https://github.com/automaticruby/automaticruby/issues
493
-
494
-
495
- ===========
496
- Environment
497
- ===========
498
-
499
- After Ruby 1.9.
500
-
501
- Depend on the packages that described in Gemfile.
502
-
503
-
504
- =====
505
- Notes
506
- =====
507
-
508
- To avoid excessive scraping, use in the bounds of common sense.
509
- This software licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
510
-
511
-