tumugi 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8a889ceab4e85663023c13142fd19f4b427fb5c
4
- data.tar.gz: 67ed6e06b39c20fe355b456cb1a84751b23544e6
3
+ metadata.gz: 9cacccf9bd212e250546c6f13442e5fb75204984
4
+ data.tar.gz: fe87e410cfc12dd03fb38f0bd0074d6d62a6fbd7
5
5
  SHA512:
6
- metadata.gz: ede2235c0f2c6810fce09093c78422ae152a2f0a3ccd3e6275856d5aabd5308f84846042467d032652c6bd5cfe96b6fd68428e32222f91d44af00630b225b2a6
7
- data.tar.gz: 3841d5750ab943219623530d0032ddcf0532c21e6d3b4fc09e1cdf643f59c78e26cc1f9ab0e69893408e68d4ea19d150584a7cecb9848c0a17316f97176ce331
6
+ metadata.gz: 8aa7fbd4256fb08e12d49d9ecbd9b3f7743eeacc660d82b7041a35703e7d5abef4fc07f0aeb87c8d11bc2041e6bc1c78d6cc04ebf63fdbe38ed611e2e04cbd9d
7
+ data.tar.gz: d60e4ac7af6033dedac2f3772508176a7591aa9c2e287df50156bbc601b264c13f295602fdda8011b715de745a7672562622f73003343b98ea55b624782457a2
data/CHANGELOG.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # Change Log
2
2
 
3
- ## [0.5.0](https://github.com/tumugi/tumugi/tree/0.5.0) (2016-05-26)
4
- [Full Changelog](https://github.com/tumugi/tumugi/compare/v0.4.5...0.5.0)
3
+ ## [0.5.1](https://github.com/tumugi/tumugi/tree/0.5.1) (2016-05-30)
4
+ [Full Changelog](https://github.com/tumugi/tumugi/compare/v0.5.0...0.5.1)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - \[Breaking Change\] Parameter auto bind feature is disabled as default [\#69](https://github.com/tumugi/tumugi/issues/69)
9
+ - Restruct FileSystemError [\#70](https://github.com/tumugi/tumugi/pull/70) ([hakobera](https://github.com/hakobera))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Disable param auto binding feature as default [\#71](https://github.com/tumugi/tumugi/pull/71) ([hakobera](https://github.com/hakobera))
14
+
15
+ ## [v0.5.0](https://github.com/tumugi/tumugi/tree/v0.5.0) (2016-05-26)
16
+ [Full Changelog](https://github.com/tumugi/tumugi/compare/v0.4.5...v0.5.0)
5
17
 
6
18
  **Implemented enhancements:**
7
19
 
@@ -15,6 +27,7 @@
15
27
 
16
28
  **Merged pull requests:**
17
29
 
30
+ - Prepare release for v0.5.0 [\#68](https://github.com/tumugi/tumugi/pull/68) ([hakobera](https://github.com/hakobera))
18
31
  - Call init first Tumugi::Logger instance access [\#67](https://github.com/tumugi/tumugi/pull/67) ([hakobera](https://github.com/hakobera))
19
32
  - Better task scheduling. [\#66](https://github.com/tumugi/tumugi/pull/66) ([hakobera](https://github.com/hakobera))
20
33
  - Support log output to file [\#65](https://github.com/tumugi/tumugi/pull/65) ([hakobera](https://github.com/hakobera))
@@ -1,11 +1,9 @@
1
1
  task :task1 do
2
- param :key1, required: true #=> 'value1', get value from CLI parameter
3
- param :key2 #=> 'value2', get value from Environment variables
2
+ param :key1, auto_bind: true, required: true #=> 'value1', get value from CLI parameter
4
3
 
5
4
  requires :task2
6
5
  run do
7
6
  log "key1=#{key1}" # You can get param as task property
8
- log "key2=#{key2}"
9
7
  end
10
8
  end
11
9
 
data/lib/tumugi/config.rb CHANGED
@@ -5,7 +5,6 @@ module Tumugi
5
5
  attr_accessor :workers
6
6
  attr_accessor :max_retry
7
7
  attr_accessor :retry_interval
8
- attr_accessor :param_auto_bind_enabled
9
8
  attr_accessor :timeout
10
9
 
11
10
  @@sections ||= {}
@@ -30,7 +29,6 @@ module Tumugi
30
29
  @workers = 1
31
30
  @max_retry = 3
32
31
  @retry_interval = 300 #seconds
33
- @param_auto_bind_enabled = true
34
32
  @timeout = 0 # meaning no timeout
35
33
 
36
34
  @section_procs = {}
data/lib/tumugi/error.rb CHANGED
@@ -16,4 +16,16 @@ module Tumugi
16
16
 
17
17
  class TimeoutError < TumugiError
18
18
  end
19
+
20
+ class FileSystemError < TumugiError
21
+ end
22
+
23
+ class FileAlreadyExistError < FileSystemError
24
+ end
25
+
26
+ class MissingParentDirectoryError < FileSystemError
27
+ end
28
+
29
+ class NotADirectoryError < FileSystemError
30
+ end
19
31
  end
@@ -1,5 +1,5 @@
1
1
  require 'tumugi'
2
- require 'tumugi/file_system_error'
2
+ require 'tumugi/error'
3
3
 
4
4
  module Tumugi
5
5
  # This class defines interfaces of file system
@@ -4,13 +4,11 @@ require 'tumugi/parameter/converter'
4
4
  module Tumugi
5
5
  module Parameter
6
6
  class Parameter
7
- attr_accessor :name, :task_param_auto_bind_enabled, :application_param_auto_bind_enabled
7
+ attr_accessor :name
8
8
 
9
9
  def initialize(name, opts={})
10
10
  @name = name
11
11
  @opts = opts
12
- @application_param_auto_bind_enabled = Tumugi.config.param_auto_bind_enabled
13
- @task_param_auto_bind_enabled = @application_param_auto_bind_enabled
14
12
  validate
15
13
  end
16
14
 
@@ -23,11 +21,7 @@ module Tumugi
23
21
 
24
22
  def auto_bind?
25
23
  if @opts[:auto_bind].nil?
26
- if @task_param_auto_bind_enabled
27
- true
28
- else
29
- false
30
- end
24
+ false
31
25
  else
32
26
  @opts[:auto_bind]
33
27
  end
@@ -1,6 +1,6 @@
1
1
  require 'tumugi/target'
2
2
  require 'tumugi/file_system'
3
- require 'tumugi/file_system_error'
3
+ require 'tumugi/error'
4
4
 
5
5
  module Tumugi
6
6
  module Plugin
@@ -1,6 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'tumugi/file_system'
3
- require 'tumugi/file_system_error'
3
+ require 'tumugi/error'
4
4
 
5
5
  module Tumugi
6
6
  module Plugin
@@ -20,9 +20,9 @@ module Tumugi
20
20
  def mkdir(path, parents: true, raise_if_exist: false)
21
21
  if File.exist?(path)
22
22
  if raise_if_exist
23
- raise FileAlreadyExistError
23
+ raise FileAlreadyExistError.new("Path #{path} is already exist")
24
24
  elsif !directory?(path)
25
- raise NotADirectoryError
25
+ raise NotADirectoryError.new("Path #{path} is not a directory")
26
26
  else
27
27
  return
28
28
  end
@@ -31,10 +31,11 @@ module Tumugi
31
31
  if parents
32
32
  FileUtils.mkdir_p(path)
33
33
  else
34
- if File.exist?(File.expand_path("..", path))
34
+ parent_path = File.expand_path("..", path)
35
+ if File.exist?(parent_path)
35
36
  FileUtils.mkdir(path)
36
37
  else
37
- raise MissingParentDirectoryError
38
+ raise MissingParentDirectoryError.new("Parent path #{parent_path} is not exist")
38
39
  end
39
40
  end
40
41
  end
@@ -1,3 +1,3 @@
1
1
  module Tumugi
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumugi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyuki Honda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -205,7 +205,6 @@ files:
205
205
  - lib/tumugi/dsl.rb
206
206
  - lib/tumugi/error.rb
207
207
  - lib/tumugi/file_system.rb
208
- - lib/tumugi/file_system_error.rb
209
208
  - lib/tumugi/logger.rb
210
209
  - lib/tumugi/mixin/listable.rb
211
210
  - lib/tumugi/mixin/parameterizable.rb
@@ -1,13 +0,0 @@
1
- module Tumugi
2
- class FileSystemError < StandardError
3
- end
4
-
5
- class FileAlreadyExistError < FileSystemError
6
- end
7
-
8
- class MissingParentDirectoryError < FileSystemError
9
- end
10
-
11
- class NotADirectoryError < FileSystemError
12
- end
13
- end