fragile 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c1aceb4146fb04948570861ec35dd7691167472f
4
+ data.tar.gz: 9e89ad7cafb59f6d2373f1cd034372aeaa4d5adc
5
+ SHA512:
6
+ metadata.gz: 5fb9f5b5da03f18a30d86132cf8178b77a3f41efc5393a6308ffa003dd20e3df4c7290fbb4c29eded91c52a654454f73bebae9315a6fcd2cf6f8d4599dda7fbd
7
+ data.tar.gz: eab0782015746fd0bcac4a42e8699dce89c105619ad88a0d5c61a07345f6efddf54be001f02c288c97d5e78a6a5b1b2f175b7d03b21527a95715f5d830fee172
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+
3
+ module Fragile
4
+ module Plugin
5
+ # config で直接パイプラインに流すデータを指定するプラグイン
6
+ #
7
+ # @example
8
+ # require "fragile/plugin/direct_input
9
+ # require "fragile/plugin/console_output
10
+ #
11
+ # pipeline :sample do
12
+ # use :direct_input, data: ["https://tnakamura.hatenablog.com"]
13
+ # use :console_output
14
+ # end
15
+ class DirectInput
16
+ attr_reader :data
17
+
18
+ def initialize(config={})
19
+ @data = config[:data] || []
20
+ end
21
+
22
+ def call(data=[])
23
+ @data
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -2,10 +2,10 @@
2
2
  # Name:: Fragile
3
3
  # Author:: tnakamura <http://d.hatena.ne.jp/griefworker>
4
4
  # Created:: Jun 15, 2012
5
- # Updated:: Jun 23, 2012
5
+ # Updated:: Jun 28, 2013
6
6
  # Copyright:: tnakamura Copyright (c) 2013
7
7
  # License:: Licensed under the MIT LICENSE.
8
8
 
9
9
  module Fragile
10
- VERSION = "0.0.4"
10
+ VERSION = "0.0.5"
11
11
  end
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+ require "spec_helper"
3
+ require "fragile/plugin/direct_input"
4
+
5
+ describe Fragile::Plugin::DirectInput do
6
+ describe "#initialize" do
7
+ context "config を省略したとき" do
8
+ it "@data に空の配列が格納されるべき" do
9
+ @input = described_class.new
10
+ expect(@input.data).to be_empty
11
+ end
12
+ end
13
+
14
+ context "data を含まない config を渡したとき" do
15
+ it "@data に空の配列が格納されるべき" do
16
+ @input = described_class.new({ :test => ["foo"] })
17
+ expect(@input.data).to be_empty
18
+ end
19
+ end
20
+
21
+ context "data を含んでいる config を渡したとき" do
22
+ it "@data に config の data が格納されるべき" do
23
+ @input = described_class.new(data: ["http://tnakamura.hatenablog.com"])
24
+ expect(@input.data.size).to eq(1)
25
+ expect(@input.data[0]).to eq("http://tnakamura.hatenablog.com")
26
+ end
27
+ end
28
+ end
29
+
30
+ describe "#call" do
31
+ it "initialize に渡した config の data を返すべき" do
32
+ @input = described_class.new(data: ["http://tnakamura.hatenablog.com"])
33
+ @data = @input.call
34
+ expect(@data.size).to eq(1)
35
+ expect(@data[0]).to eq("http://tnakamura.hatenablog.com")
36
+ end
37
+ end
38
+ end
39
+
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fragile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - tnakamura
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-06-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Ruby Pipeline Framework
@@ -52,6 +49,7 @@ files:
52
49
  - lib/fragile/pipeline.rb
53
50
  - lib/fragile/pipeline_manager.rb
54
51
  - lib/fragile/plugin/console_output.rb
52
+ - lib/fragile/plugin/direct_input.rb
55
53
  - lib/fragile/plugin/im_kayac_output.rb
56
54
  - lib/fragile/plugin/mail_output.rb
57
55
  - lib/fragile/plugin/map_filter.rb
@@ -62,37 +60,38 @@ files:
62
60
  - spec/dsl_spec.rb
63
61
  - spec/pipeline_manager_spec.rb
64
62
  - spec/pipeline_spec.rb
63
+ - spec/plugin/direct_input_spec.rb
65
64
  - spec/plugin/im_kayac_output_spec.rb
66
65
  - spec/plugin_manager_spec.rb
67
66
  - spec/spec_helper.rb
68
67
  homepage: https://github.com/tnakamura/fragile
69
68
  licenses: []
69
+ metadata: {}
70
70
  post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
73
73
  - lib
74
74
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
75
  requirements:
77
- - - ! '>='
76
+ - - '>='
78
77
  - !ruby/object:Gem::Version
79
78
  version: '0'
80
79
  required_rubygems_version: !ruby/object:Gem::Requirement
81
- none: false
82
80
  requirements:
83
- - - ! '>='
81
+ - - '>='
84
82
  - !ruby/object:Gem::Version
85
83
  version: '0'
86
84
  requirements: []
87
85
  rubyforge_project:
88
- rubygems_version: 1.8.23
86
+ rubygems_version: 2.0.0
89
87
  signing_key:
90
- specification_version: 3
88
+ specification_version: 4
91
89
  summary: Ruby Pipeline Framework
92
90
  test_files:
93
91
  - spec/dsl_spec.rb
94
92
  - spec/pipeline_manager_spec.rb
95
93
  - spec/pipeline_spec.rb
94
+ - spec/plugin/direct_input_spec.rb
96
95
  - spec/plugin/im_kayac_output_spec.rb
97
96
  - spec/plugin_manager_spec.rb
98
97
  - spec/spec_helper.rb