automatic 12.2.1 → 12.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -10,16 +10,16 @@ See doc/README.ja file.
10
10
  Usage
11
11
  -----
12
12
 
13
- Get started -- checkout https://github.com/id774/automaticruby
13
+ Get started.
14
14
 
15
15
  ``` html
16
- bin/automatic
16
+ gem install automatic
17
17
  ```
18
18
 
19
19
  Specify any recipe with -c option.
20
20
 
21
21
  ``` html
22
- bin/automatic -c <recipe>
22
+ automatic -c <recipe>
23
23
  ```
24
24
 
25
25
  For more info, refer to the document (doc/README.ja).
@@ -96,6 +96,12 @@ Author
96
96
  + http://github.com/id774
97
97
 
98
98
 
99
+ Developers
100
+ ----------
101
+
102
+ See doc/AUTHORS.
103
+
104
+
99
105
  Copyright and license
100
106
  ---------------------
101
107
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.02.1
1
+ 12.3.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "automatic"
8
- s.version = "12.2.1"
8
+ s.version = "12.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["id774"]
@@ -21,12 +21,12 @@ Gem::Specification.new do |s|
21
21
  "README.md",
22
22
  "Rakefile",
23
23
  "VERSION",
24
- "app.rb",
25
24
  "automatic.gemspec",
26
25
  "bin/automatic",
27
26
  "config/default.yml",
28
27
  "config/feed2console.yml",
29
28
  "db/.gitkeep",
29
+ "doc/AUTHORS",
30
30
  "doc/COPYING",
31
31
  "doc/ChangeLog",
32
32
  "doc/PLUGINS.ja",
@@ -37,7 +37,6 @@ Gem::Specification.new do |s|
37
37
  "lib/automatic/log.rb",
38
38
  "lib/automatic/pipeline.rb",
39
39
  "lib/automatic/recipe.rb",
40
- "lib/config/validator.rb",
41
40
  "plugins/custom_feed/svn_log.rb",
42
41
  "plugins/filter/ignore.rb",
43
42
  "plugins/filter/image.rb",
@@ -0,0 +1,7 @@
1
+ id774
2
+ kzgs
3
+ daic-h
4
+ ainame
5
+ banyan
6
+ hsbt
7
+ aerith
@@ -1,3 +1,22 @@
1
+ === 12.03 / 2012-03-07
2
+
3
+ * Distribute as a gem library
4
+
5
+ * Plugins added
6
+
7
+ * CustomFeed::SVNLog
8
+ * Notify::Ikachan
9
+ * Filter::TumblrResize
10
+ * Filter::Image
11
+ * Store::TargetLink
12
+
13
+ * CI / Build scripts
14
+
15
+ * script/bootstrap
16
+
17
+ * Signficant Refactoring
18
+
19
+
1
20
  === 12.02.1 / 2012-02-25
2
21
 
3
22
  * Point release
@@ -4,13 +4,13 @@ automaticruby
4
4
  automaticruby - Ruby による汎用的な自動処理フレームワーク
5
5
 
6
6
  書式
7
- $ bin/automatic
7
+ $ automatic
8
8
 
9
9
  任意のレシピを指定して起動する
10
- $ bin/automatic -c <recipe>
10
+ $ automatic -c <recipe>
11
11
 
12
12
  バージョン番号を表示する
13
- $ bin/automatic -v
13
+ $ automatic -v
14
14
 
15
15
  説明
16
16
  このソフトウェアは、プラガブルに機能を拡張可能な Ruby
@@ -23,9 +23,12 @@ $ bin/automatic -v
23
23
  インストール
24
24
  ============
25
25
 
26
- 本ソフトウェアを GitHub がらダウンロードする。
27
- $ git clone git://github.com/id774/automaticruby.git
26
+ [安定版]
27
+ $ gem install automatic
28
+
28
29
 
30
+ [開発版]
31
+ $ git clone git://github.com/id774/automaticruby.git
29
32
 
30
33
  ruby 1.9 の場合
31
34
  $ script/bootstrap
@@ -34,21 +37,20 @@ $ script/bootstrap
34
37
  Gemfile にある必要な gem を手動でインストールする
35
38
 
36
39
 
40
+ ============
41
+ 実行してみる
42
+ ============
43
+
37
44
  任意のレシピ (後述) を作成する。
38
- $ bin/automatic -c your_recipe.yml
45
+ $ automatic -c your_recipe.yml
39
46
 
40
47
  -c オプション付きで手動実行し、問題がなければ
41
48
  cron に登録するなどして自動化する。
42
49
 
43
50
 
44
- ============
45
- 実行してみる
46
- ============
47
-
48
51
  試しに実行するなら config/feed2console.yml
49
52
  を利用すると良い。
50
-
51
- $ bin/automatic -c config/feed2console.yml
53
+ $ automatic -c config/feed2console.yml
52
54
 
53
55
  これは、ブログのフィードを単純にコンソール出力するだけの
54
56
  簡単なレシピである。
@@ -95,24 +97,23 @@ $ bin/automatic -c config/feed2console.yml
95
97
  | | Automatic モジュールの定義をする
96
98
  | |
97
99
  | +- automatic
98
- | | |
99
- | | +- environment.rb
100
- | | | 環境情報を読み込む
101
- | | |
102
- | | +- pipeline.rb
103
- | | | パイプラインと呼ばれるオブジェクトを利用し
104
- | | | レシピに書かれたプラグインに処理を順次受け渡す
105
- | | |
106
- | | +- feed_parser.rb
107
- | | | フィードを解析する
108
- | | |
109
- | | +- log.rb
110
- | | | ログを出力する
111
- | | |
112
- | | +- recipe.rb
113
- | | レシピを読み込む
114
- | |
115
- | +- config
100
+ | |
101
+ | +- environment.rb
102
+ | | 環境情報を読み込む
103
+ | |
104
+ | +- pipeline.rb
105
+ | | パイプラインと呼ばれるオブジェクトを利用し
106
+ | | レシピに書かれたプラグインに処理を順次受け渡す
107
+ | |
108
+ | +- feed_parser.rb
109
+ | | フィードを解析する
110
+ | |
111
+ | +- log.rb
112
+ | | ログを出力する
113
+ | |
114
+ | +- recipe.rb
115
+ | レシピを読み込む
116
+ |
116
117
  |
117
118
  +- db
118
119
  | |
@@ -169,7 +170,7 @@ $ bin/automatic -c config/feed2console.yml
169
170
  された場合は config/default.yml が呼ばれる。
170
171
 
171
172
  [起動例]
172
- $ bin/automatic -c ~/recipes/your_recipe.yml
173
+ $ automatic -c ~/recipes/your_recipe.yml
173
174
 
174
175
 
175
176
  ================
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Name:: Automatic::Ruby
3
3
  # Author:: 774 <http://id774.net>
4
- # Version:: 12.02.1-devel
4
+ # Version:: 12.03
5
5
  # Created:: Feb 18, 2012
6
- # Updated:: Mar 2, 2012
6
+ # Updated:: Mar 7, 2012
7
7
  # Copyright:: 774 Copyright (c) 2012
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
@@ -14,7 +14,7 @@ module Automatic
14
14
  require 'automatic/log'
15
15
  require 'automatic/feed_parser'
16
16
 
17
- VERSION = "12.02.1-devel"
17
+ VERSION = "12.03"
18
18
 
19
19
  def self.root_dir
20
20
  @root_dir
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.2.1
4
+ version: 12.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
16
- requirement: &78060030 !ruby/object:Gem::Requirement
16
+ requirement: &78711590 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *78060030
24
+ version_requirements: *78711590
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &78059770 !ruby/object:Gem::Requirement
27
+ requirement: &78711240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *78059770
35
+ version_requirements: *78711240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hashie
38
- requirement: &78059530 !ruby/object:Gem::Requirement
38
+ requirement: &78711000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *78059530
46
+ version_requirements: *78711000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activerecord
49
- requirement: &78059250 !ruby/object:Gem::Requirement
49
+ requirement: &78710750 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *78059250
57
+ version_requirements: *78710750
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: gcalapi
60
- requirement: &78058990 !ruby/object:Gem::Requirement
60
+ requirement: &78710460 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *78058990
68
+ version_requirements: *78710460
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: xml-simple
71
- requirement: &78058690 !ruby/object:Gem::Requirement
71
+ requirement: &78710200 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *78058690
79
+ version_requirements: *78710200
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &78058350 !ruby/object:Gem::Requirement
82
+ requirement: &78709930 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *78058350
90
+ version_requirements: *78709930
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundler
93
- requirement: &78058040 !ruby/object:Gem::Requirement
93
+ requirement: &78709670 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.0.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *78058040
101
+ version_requirements: *78709670
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: jeweler
104
- requirement: &78057560 !ruby/object:Gem::Requirement
104
+ requirement: &78709430 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 1.8.3
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *78057560
112
+ version_requirements: *78709430
113
113
  description: Ruby General Automation Framework
114
114
  email: idnanashi@gmail.com
115
115
  executables:
@@ -122,12 +122,12 @@ files:
122
122
  - README.md
123
123
  - Rakefile
124
124
  - VERSION
125
- - app.rb
126
125
  - automatic.gemspec
127
126
  - bin/automatic
128
127
  - config/default.yml
129
128
  - config/feed2console.yml
130
129
  - db/.gitkeep
130
+ - doc/AUTHORS
131
131
  - doc/COPYING
132
132
  - doc/ChangeLog
133
133
  - doc/PLUGINS.ja
@@ -138,7 +138,6 @@ files:
138
138
  - lib/automatic/log.rb
139
139
  - lib/automatic/pipeline.rb
140
140
  - lib/automatic/recipe.rb
141
- - lib/config/validator.rb
142
141
  - plugins/custom_feed/svn_log.rb
143
142
  - plugins/filter/ignore.rb
144
143
  - plugins/filter/image.rb
data/app.rb DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- coding: utf-8 -*-
3
- # Name:: Automatic::Ruby
4
- # Author:: 774 <http://id774.net>
5
- # Created:: Feb 18, 2012
6
- # Updated:: Feb 24, 2012
7
- # Copyright:: 774 Copyright (c) 2012
8
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
-
10
- root_dir = File.expand_path(File.dirname(__FILE__))
11
- $:.unshift root_dir
12
- $:.unshift root_dir + '/lib'
13
- require 'lib/automatic'
14
-
15
- Automatic.run(root_dir)
@@ -1,83 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- coding: utf-8 -*-
3
- # Name:: Automatic::Config::Validator
4
- # Author:: aerith <http://aerith.sc/>
5
- # Created:: Feb 23, 2012
6
- # Updated:: Feb 23, 2012
7
- # Copyright:: Copyright (c) 2012
8
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
-
10
- class Automatic
11
- module Config
12
- class Validator
13
- attr_accessor :config, :result
14
-
15
- class InvalidException < Exception; end;
16
-
17
- def initialize(config = nil)
18
- @config = config || {}
19
- @result = ValidateResult.new
20
- end
21
-
22
- def validate(klass, config = nil)
23
- return true if config.nil?
24
- return true if not config.is_a?(Hash)
25
- return true if not klass.respond_to?(:rules)
26
-
27
- rules = klass.rules
28
- return true if not rules.is_a?(Hash)
29
-
30
- process(rules, config).result.valid?
31
- end
32
-
33
- private
34
- def process(rules, config)
35
- errors = {}
36
-
37
- rules.each do |key, rule|
38
- name = key.to_sym
39
-
40
- rule.each do |method, args|
41
- unless ValidateRule.send(method, *[config, name, args])
42
- errors[name] = {} if errors[name].nil? or errors.size < 1
43
- errors[name][method] = true
44
- if @config["stop_on_invalid"] and errors[name][method]
45
- raise InvalidException
46
- end
47
- end
48
- end
49
- end
50
-
51
- @result.errors = errors
52
-
53
- self
54
- end
55
-
56
- class ValidateResult
57
- attr_accessor :errors
58
-
59
- def error(name)
60
- errors.exists?(name)
61
- end
62
-
63
- def valid?
64
- errors.empty?
65
- end
66
- end
67
-
68
- module ValidateRule
69
- def self.required(config, name, *args)
70
- return true unless args.size < 1 or args.first
71
- return true if not config[name.to_s].nil? and not config[name.to_s].empty?
72
- false
73
- end
74
-
75
- def self.default(config, name, *args)
76
- config[name.to_s] ||= args.first
77
- true
78
- end
79
- end
80
- end
81
- end
82
- end
83
-