pendulum 0.1.0 → 0.1.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: 39768125e6cbdf710a729beac0133f6c3e53d7b9
4
- data.tar.gz: ef90d7cedb538420b6cdae2dcea602a2b5bafb5b
3
+ metadata.gz: aa3f12296f6657494a58bee25637972dc425918e
4
+ data.tar.gz: b28c330673e2fac874bc8b71b63dc7e80372f69d
5
5
  SHA512:
6
- metadata.gz: b9e1c70253542545c488fd040d7640f907343920783feae932def202a27f274f23781251f060fb3deeeff382b49910eb2b723a681f47a3750c9df53cd3535556
7
- data.tar.gz: da9651c21dc64f7b674b94b2f66edd0f88c869744191c149493bf2a3918f2b42faad57ac958ca842e549a6c02ee4075e86313e73d42631dd3f300a103e993f98
6
+ metadata.gz: b8cd6cab2576bde56fbffa8dc07df726d1ef109074a544a7023580453c03d32504853a7b5e1cf9eec0ca5917a19546f1ab334e5ae1923ca999db98175a4974e3
7
+ data.tar.gz: 90952cf321d9cc0eb2ea0744c05c474bdfa130ea8a990972464243e18f518c68ed4f62850b52c2a466b7104fafed8bcdbbd941d43bd6edee90a7e6a72655305a
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Pendulum
1
+ # Pendulum [![Build Status](https://travis-ci.org/monochromegane/pendulum.svg?branch=master)](https://travis-ci.org/monochromegane/pendulum)
2
2
 
3
3
  Pendulum is a tool to manage Treasure Data scheduled jobs.
4
4
 
@@ -22,14 +22,14 @@ $ pendulum --apikey='...' -a
22
22
 
23
23
  ```rb
24
24
  schedule 'test-scheduled-job' do
25
- database 'db_name'
26
- query 'select time from access;'
25
+ database 'db_name'
26
+ query 'select time from access;'
27
27
  retry_limit 0
28
28
  priority :normal
29
29
  cron '30 0 * * *'
30
30
  timezone 'Asia/Tokyo'
31
31
  delay 0
32
- result_url 'td://@/db_name/table_name'
32
+ result 'td://@/db_name/table_name'
33
33
  end
34
34
  ```
35
35
 
data/Rakefile CHANGED
@@ -1,10 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
- require "rake/testtask"
2
+ require "rspec/core/rake_task"
3
3
 
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
4
+ RSpec::Core::RakeTask.new(:spec)
9
5
 
10
6
  task :default => :spec
@@ -16,13 +16,13 @@ module Pendulum::Command
16
16
  query_hash(from_uri) != query_hash(to_uri)
17
17
  end
18
18
 
19
+ private
20
+
19
21
  def mask(uri)
20
22
  uri.password = '***' if uri.user
21
23
  uri
22
24
  end
23
25
 
24
- private
25
-
26
26
  def uri_without_query(uri)
27
27
  uri.to_s.split('?').first
28
28
  end
@@ -32,7 +32,7 @@ module Pendulum::Command
32
32
  end
33
33
 
34
34
  def to_uri(url)
35
- return URI.parse(url) if url.include?('://')
35
+ return URI.parse(url) if ( url.empty? || url.include?('://') )
36
36
 
37
37
  # use result
38
38
  name, table = url.split(':', 2)
@@ -21,6 +21,8 @@ module Pendulum::Command
21
21
  end
22
22
  end
23
23
 
24
+ private
25
+
24
26
  def create
25
27
  puts message_for_create
26
28
  client.create_schedule(to.name, to.to_params) unless dry_run?
@@ -39,8 +41,6 @@ module Pendulum::Command
39
41
  client.delete_schedule(from.name) if force? && !dry_run?
40
42
  end
41
43
 
42
- private
43
-
44
44
  def will_create?
45
45
  !from && to
46
46
  end
@@ -26,8 +26,8 @@ module Pendulum::DSL
26
26
  schedule '<%= schedule.name %>' do
27
27
  database '<%= schedule.database %>'
28
28
  <% if schedule.query -%>
29
- query_file 'queries/<%= schedule.name %>.hql'
30
- # type :hive # FIXME: Treasure Data schedule api dosen't contain type result.
29
+ query_file 'queries/<%= schedule.name %>.hql'
30
+ # type :hive # FIXME: Treasure Data schedule api dosen't contain type result.
31
31
  retry_limit <%= schedule.retry_limit %>
32
32
  priority <%= schedule.priority %>
33
33
  <% end -%>
@@ -1,3 +1,3 @@
1
1
  module Pendulum
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.11"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "minitest", "~> 5.0"
29
+ spec.add_development_dependency "rspec"
30
30
  spec.add_development_dependency "pry"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pendulum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - monochromegane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: td
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '10.0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: minitest
98
+ name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '5.0'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '5.0'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -131,6 +131,7 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
134
+ - ".rspec"
134
135
  - ".travis.yml"
135
136
  - Gemfile
136
137
  - LICENSE.txt