tableau_notify 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +20 -0
- data/bin/tableau-notify +10 -0
- data/lib/tableau_notify/version.rb +3 -0
- data/lib/tableau_notify.rb +39 -0
- data/tableau_notify.gemspec +21 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c84c892986302783b61616705218b863fbc753cc
|
4
|
+
data.tar.gz: 9a3e71cf8b7e267fd84c99f655cf012d571a43e5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b26cd42aafa78a5d6a4f46a939a94456ba8d891507668bdb0fcf33a044cb23c5d51ecc0421badc66a3dffdb333d59496fc23d1d1f797f64f2127d827a1cf2889
|
7
|
+
data.tar.gz: d1f1945dee049e57cf9d63ac32cda6b67b3bc4b943e2e057e7383ff12e6c0cd8f25d8fbf7f072546e4a311a1e4474272bd255f398731b5e11dc6b1b6117eb06c
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tableau_notify (0.0.1)
|
5
|
+
file-tail
|
6
|
+
terminal-notifier
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
file-tail (1.0.12)
|
12
|
+
tins (~> 0.5)
|
13
|
+
terminal-notifier (1.6.1)
|
14
|
+
tins (0.13.2)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
tableau_notify!
|
data/bin/tableau-notify
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'file-tail'
|
2
|
+
require 'json'
|
3
|
+
require 'terminal-notifier'
|
4
|
+
require 'tempfile'
|
5
|
+
|
6
|
+
module TableauNotify
|
7
|
+
def run
|
8
|
+
query_data = false
|
9
|
+
|
10
|
+
File.open(File.expand_path("~/Documents/My\ Tableau\ Repository/Logs/log.txt")) do |log|
|
11
|
+
log.extend(File::Tail)
|
12
|
+
log.max_interval = 1
|
13
|
+
log.interval = 0.5
|
14
|
+
log.backward(0)
|
15
|
+
|
16
|
+
log.tail do |line|
|
17
|
+
logline = JSON.parse(line)
|
18
|
+
event = logline["k"]
|
19
|
+
|
20
|
+
query_data = true if event == "begin-data-interpreter"
|
21
|
+
query_data = false if event == "end-data-interpreter"
|
22
|
+
|
23
|
+
if query_data && event == "begin-query"
|
24
|
+
query = logline["v"]["query"]
|
25
|
+
|
26
|
+
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} - Running Query (PID #{logline['pid']}):"
|
27
|
+
puts "#{query}"
|
28
|
+
puts ""
|
29
|
+
|
30
|
+
query_file = Tempfile.new(["query", ".sql"])
|
31
|
+
query_file.write(query)
|
32
|
+
query_file.close
|
33
|
+
|
34
|
+
TerminalNotifier.notify(query, title: "Running Query", sender: "com.tableausoftware.tableaudesktop", group: logline["pid"], open: "file:///#{query_file.path}")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "tableau_notify/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "tableau_notify"
|
7
|
+
s.version = TableauNotify::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Nick Evans"]
|
10
|
+
s.email = ["me@nicolasevans.org"]
|
11
|
+
s.homepage = "http://github.com/manygrams/tableau_notify"
|
12
|
+
s.summary = %q{Notifier for Tableau}
|
13
|
+
s.description = %q{Shows Apple Notification Center notifcations for Tableau queries against external data sources.}
|
14
|
+
|
15
|
+
s.add_runtime_dependency "file-tail"
|
16
|
+
s.add_runtime_dependency "terminal-notifier"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.executables = ["tableau-notify"]
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tableau_notify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Evans
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: file-tail
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: terminal-notifier
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Shows Apple Notification Center notifcations for Tableau queries against
|
42
|
+
external data sources.
|
43
|
+
email:
|
44
|
+
- me@nicolasevans.org
|
45
|
+
executables:
|
46
|
+
- tableau-notify
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- bin/tableau-notify
|
53
|
+
- lib/tableau_notify.rb
|
54
|
+
- lib/tableau_notify/version.rb
|
55
|
+
- tableau_notify.gemspec
|
56
|
+
homepage: http://github.com/manygrams/tableau_notify
|
57
|
+
licenses: []
|
58
|
+
metadata: {}
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
requirements: []
|
74
|
+
rubyforge_project:
|
75
|
+
rubygems_version: 2.0.14
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: Notifier for Tableau
|
79
|
+
test_files: []
|
80
|
+
has_rdoc:
|