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 +4 -4
- data/.rspec +3 -0
- data/README.md +4 -4
- data/Rakefile +2 -6
- data/lib/pendulum/command/apply/result_url.rb +3 -3
- data/lib/pendulum/command/apply/schedule.rb +2 -2
- data/lib/pendulum/dsl/converter.rb +2 -2
- data/lib/pendulum/version.rb +1 -1
- data/pendulum.gemspec +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3f12296f6657494a58bee25637972dc425918e
|
4
|
+
data.tar.gz: b28c330673e2fac874bc8b71b63dc7e80372f69d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8cd6cab2576bde56fbffa8dc07df726d1ef109074a544a7023580453c03d32504853a7b5e1cf9eec0ca5917a19546f1ab334e5ae1923ca999db98175a4974e3
|
7
|
+
data.tar.gz: 90952cf321d9cc0eb2ea0744c05c474bdfa130ea8a990972464243e18f518c68ed4f62850b52c2a466b7104fafed8bcdbbd941d43bd6edee90a7e6a72655305a
|
data/.rspec
ADDED
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
|
26
|
-
query
|
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
|
-
|
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 "
|
2
|
+
require "rspec/core/rake_task"
|
3
3
|
|
4
|
-
|
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
|
30
|
-
# type
|
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 -%>
|
data/lib/pendulum/version.rb
CHANGED
data/pendulum.gemspec
CHANGED
@@ -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 "
|
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.
|
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-
|
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:
|
98
|
+
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
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: '
|
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
|