tembin 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/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +52 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/tembin +5 -0
- data/lib/tembin.rb +6 -0
- data/lib/tembin/applyer.rb +78 -0
- data/lib/tembin/cli.rb +61 -0
- data/lib/tembin/element.rb +4 -0
- data/lib/tembin/element/alert.rb +2 -0
- data/lib/tembin/element/base.rb +44 -0
- data/lib/tembin/element/dashboard.rb +2 -0
- data/lib/tembin/element/query.rb +8 -0
- data/lib/tembin/element/visualizations.rb +32 -0
- data/lib/tembin/element_parser.rb +30 -0
- data/lib/tembin/exporter.rb +69 -0
- data/lib/tembin/redash.rb +16 -0
- data/lib/tembin/redash/client.rb +47 -0
- data/lib/tembin/redash/query.rb +57 -0
- data/lib/tembin/version.rb +3 -0
- data/tembin.gemspec +29 -0
- metadata +180 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eeef0f33ab745308739346211e755ae16f534f95
|
4
|
+
data.tar.gz: 4d2083cc57d110314cfa4d1fb7fbc45c689c28b3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ed8b72437c1e67d058c9b4c7d1b7036b5453d6c22c99786e6eb68fa98e450d2ceeb677cac2ac30dde32e39bee0ff70ea8e626adbc415865e298858a839622b5d
|
7
|
+
data.tar.gz: 9dc17e0d4e683995c0ce64527073a737ebfbad2051d311d21dec1cb4abbd499915a811ed084aa8ffb1372e49d6cb1cef186b4de9074798e98dafc00eb874906d
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Tembin
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tembin`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'tembin', '0.1.0.alpha2'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install tembin --pre
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### redash.yml
|
24
|
+
|
25
|
+
```
|
26
|
+
host: 'https://your.redash.host'
|
27
|
+
api_key: <%= ENV['REDASH_API_KEY'] %>
|
28
|
+
authorized_user_email: 'your-account@email.com'
|
29
|
+
```
|
30
|
+
|
31
|
+
### Export
|
32
|
+
|
33
|
+
```shell
|
34
|
+
$ tembin export --dir /path/to/sql/store/directory/tembin --redash_config ~/redash.yml
|
35
|
+
```
|
36
|
+
|
37
|
+
### Apply
|
38
|
+
|
39
|
+
```shell
|
40
|
+
$ tembin apply --file /path/to/entry_point_script/tembin.rb --redash_config ~/redash.yml
|
41
|
+
```
|
42
|
+
|
43
|
+
## Development
|
44
|
+
|
45
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
46
|
+
|
47
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
48
|
+
|
49
|
+
## Contributing
|
50
|
+
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tembin.
|
52
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "tembin"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/exe/tembin
ADDED
data/lib/tembin.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'diffy'
|
2
|
+
require 'highline'
|
3
|
+
|
4
|
+
class Tembin::Applyer
|
5
|
+
def self.run(elements, dry_run: true, out: STDOUT)
|
6
|
+
new(elements, out: out, dry_run: dry_run).run
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize(elements, out: STDOUT, dry_run: true)
|
10
|
+
@elements = elements
|
11
|
+
@dry_run = dry_run
|
12
|
+
@out = out
|
13
|
+
end
|
14
|
+
|
15
|
+
def run
|
16
|
+
remote_queries = Tembin::Redash::Query.created_by_me
|
17
|
+
remote_queries.each do |remote_query|
|
18
|
+
@out.puts(h.color("#{remote_query.name}", :green))
|
19
|
+
|
20
|
+
update_query(
|
21
|
+
remote_query,
|
22
|
+
@elements.find{ |e| e.name == remote_query.name },
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
remote_query_names = remote_queries.map(&:name)
|
27
|
+
@elements.reject { |local|
|
28
|
+
remote_query_names.include?(local.name)
|
29
|
+
}.each { |element|
|
30
|
+
create_new_query(element)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def create_new_query(local)
|
37
|
+
@out.puts(h.color("#{local.name}", :green))
|
38
|
+
if @dry_run
|
39
|
+
@out.puts(h.color(" --> will be created.", :yellow))
|
40
|
+
else
|
41
|
+
Tembin::Redash::Query.create(local.name, local.attributes[:sql])
|
42
|
+
@out.puts(h.color(" --> create.", :yellow))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def update_query(remote, local)
|
47
|
+
if local.nil?
|
48
|
+
if @dry_run
|
49
|
+
@out.puts(h.color(" --> will be deleted.", :red))
|
50
|
+
else
|
51
|
+
@out.puts(h.color(" --> delete.", :red))
|
52
|
+
remote.delete!
|
53
|
+
end
|
54
|
+
|
55
|
+
@out.puts
|
56
|
+
return
|
57
|
+
end
|
58
|
+
|
59
|
+
if remote.changed?(local.attributes[:sql])
|
60
|
+
@out.puts(h.color(" --> has changed.", :yellow))
|
61
|
+
|
62
|
+
if @dry_run
|
63
|
+
@out.puts(Diffy::Diff.new(remote.sql, local.attributes[:sql]).to_s(:color))
|
64
|
+
else
|
65
|
+
remote.update!(element.attributes[:sql])
|
66
|
+
@out.puts(h.color(" --> updated.", :green))
|
67
|
+
end
|
68
|
+
else
|
69
|
+
@out.puts(h.color(" --> already up to date.", :cyan))
|
70
|
+
end
|
71
|
+
|
72
|
+
@out.puts
|
73
|
+
end
|
74
|
+
|
75
|
+
def h
|
76
|
+
@h ||= HighLine.new
|
77
|
+
end
|
78
|
+
end
|
data/lib/tembin/cli.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'yaml'
|
3
|
+
require 'erb'
|
4
|
+
|
5
|
+
class Tembin::CLI < Thor
|
6
|
+
package_name :Tembin
|
7
|
+
|
8
|
+
desc 'apply', 'apply re:dash files'
|
9
|
+
option :file, type: :string, aliases: :f, banner: 'entry file path'
|
10
|
+
option :apply, type: :boolean, aliases: :a, banner: 'apply flag(default dry run)'
|
11
|
+
option :redash_config, type: :string, aliases: :c, banner: 'redash config file path'
|
12
|
+
def apply
|
13
|
+
load_redash_credentials
|
14
|
+
|
15
|
+
Tembin::Applyer.run(
|
16
|
+
Tembin::ElementParser.parse(dsl_file),
|
17
|
+
dry_run: !options[:apply]
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'export', 'export re:dash files'
|
22
|
+
option :dir, type: :string, aliases: :d, required: true, banner: 'export file store directory'
|
23
|
+
option :redash_config, type: :string, aliases: :c, banner: 'redash config file path'
|
24
|
+
option :disable_split_sql, type: :boolean, banner: 'disable sqlfile split mode'
|
25
|
+
option :split_file, type: :boolean, banner: 'disable split file mode'
|
26
|
+
def export
|
27
|
+
load_redash_credentials
|
28
|
+
|
29
|
+
Tembin::Exporter.run(
|
30
|
+
Pathname.new(options[:dir]),
|
31
|
+
split_sql: !options[:disable_split_sql],
|
32
|
+
split_file: options[:split_file],
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def dsl_file
|
39
|
+
Pathname.new(options[:file] || 'Redashfile')
|
40
|
+
end
|
41
|
+
|
42
|
+
def redash_config_path
|
43
|
+
Pathname.new(options[:redash_config] || 'redash.yml')
|
44
|
+
end
|
45
|
+
|
46
|
+
def load_redash_credentials
|
47
|
+
Tembin::Redash.config = YAML.load(
|
48
|
+
ERB.new(
|
49
|
+
open(redash_config_path).read
|
50
|
+
).result(binding)
|
51
|
+
)
|
52
|
+
|
53
|
+
if Tembin::Redash.config['api_key'].nil?
|
54
|
+
raise ArgumentError, "Re:dash api key is empty. Please set Tembin::Redash.config['api_key']"
|
55
|
+
end
|
56
|
+
|
57
|
+
if Tembin::Redash.config['authorized_user_email'].nil?
|
58
|
+
raise ArgumentError, "Re:dash user login email is empty. Please set Tembin::Redash.config['authorized_user_email']"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Tembin::Element
|
2
|
+
module FieldDefinationMacros
|
3
|
+
AVAILABLE_TYPES = [
|
4
|
+
:string, :element, :numeric, :array, :boolean, :time
|
5
|
+
].freeze
|
6
|
+
|
7
|
+
def field(key, type, options = {})
|
8
|
+
raise ArgumentError, "Unknown element field type. #{key}, #{type}, #{options}" if !AVAILABLE_TYPES.include?(type)
|
9
|
+
define_method(key) do |*args, &block|
|
10
|
+
case type
|
11
|
+
when :string, :numeric, :boolean
|
12
|
+
@attributes[key] = args.first
|
13
|
+
when :element
|
14
|
+
@attributes[key] = options[:class].build(*args, &block)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Base
|
21
|
+
extend FieldDefinationMacros
|
22
|
+
|
23
|
+
def self.build(*args, &block)
|
24
|
+
new(*args, &block).build
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_reader :name, :attributes
|
28
|
+
|
29
|
+
def initialize(*args, &block)
|
30
|
+
@name = args[0]
|
31
|
+
@block = block
|
32
|
+
@attributes = {}
|
33
|
+
end
|
34
|
+
|
35
|
+
def build
|
36
|
+
instance_exec(&@block)
|
37
|
+
self
|
38
|
+
end
|
39
|
+
|
40
|
+
def to_params
|
41
|
+
raise NotImplementedError
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Tembin::Element::Visualizations < Tembin::Element::Base
|
2
|
+
class Chart < Tembin::Element::Base
|
3
|
+
class XAxis < Tembin::Element::Base
|
4
|
+
field :scale, :string, only: ['Datetime', 'Linear', 'Logarithmic', 'Category']
|
5
|
+
field :name, :string
|
6
|
+
field :sort, :boolean
|
7
|
+
field :labels, :boolean
|
8
|
+
field :height, :numeric
|
9
|
+
end
|
10
|
+
|
11
|
+
class YAxis < Tembin::Element::Base
|
12
|
+
class Value < Tembin::Element::Base
|
13
|
+
field :scale, :string, only: ['Datetime', 'Linear', 'Logarithmic']
|
14
|
+
field :name, :string
|
15
|
+
end
|
16
|
+
|
17
|
+
field :left, :element, class: Chart::YAxis::Value
|
18
|
+
field :right, :element, class: Chart::YAxis::Value
|
19
|
+
end
|
20
|
+
|
21
|
+
field :type, :string, only: ['Line', 'Bar', 'Area', 'Pie', 'Scatter']
|
22
|
+
field :x_column, :string
|
23
|
+
field :y_columns, :array
|
24
|
+
field :group_by, :string
|
25
|
+
field :show_legend, :boolean
|
26
|
+
field :stacking, :string
|
27
|
+
field :x_axis, :element, class: Chart::XAxis
|
28
|
+
field :y_axis, :element, class: Chart::YAxis
|
29
|
+
end
|
30
|
+
|
31
|
+
field :chart, :element, class: Chart
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'tembin/element'
|
2
|
+
|
3
|
+
class Tembin::ElementParser
|
4
|
+
def self.parse(dsl_filepath)
|
5
|
+
new(dsl_filepath).elements
|
6
|
+
end
|
7
|
+
|
8
|
+
def initialize(dsl)
|
9
|
+
@elements = []
|
10
|
+
instance_eval(dsl.read, dsl.to_path, 1)
|
11
|
+
end
|
12
|
+
|
13
|
+
def elements
|
14
|
+
@elements
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def query(name, &block)
|
20
|
+
@elements << Tembin::Element::Query.build(name, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
def dashboard(name, &block)
|
24
|
+
@elements << Tembin::Element::Dashboard.build(name, &block)
|
25
|
+
end
|
26
|
+
|
27
|
+
def alert(name, &block)
|
28
|
+
@elements << Tembin::Element::Alert.build(name, &block)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
class Tembin::Exporter
|
2
|
+
def self.run(out_dir, split_sql: true, split_file: true, out: STDOUT)
|
3
|
+
new(out_dir, split_sql: split_sql, split_file: split_file, out: STDOUT).run
|
4
|
+
end
|
5
|
+
|
6
|
+
def initialize(out_dir, split_sql: true, split_file: true, out: STDOUT)
|
7
|
+
@out_dir = out_dir
|
8
|
+
@split_sql_mode = split_sql
|
9
|
+
@split_file_mode = split_file
|
10
|
+
@out = out
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
FileUtils.rm_f(@out_dir.join('tembin.rb')) if File.exist?(@out_dir.join('tembin.rb'))
|
15
|
+
|
16
|
+
export_head_file if @split_file_mode
|
17
|
+
|
18
|
+
Tembin::Redash::Query.created_by_me.each do |query|
|
19
|
+
@out.puts(h.color("export #{query.name}", :green))
|
20
|
+
|
21
|
+
file =
|
22
|
+
if @split_file_mode
|
23
|
+
File.open(@out_dir.join("#{query.filename}.rb"), "w")
|
24
|
+
else
|
25
|
+
File.open(@out_dir.join("tembin.rb"), "a")
|
26
|
+
end
|
27
|
+
|
28
|
+
@out.puts(h.color(" redash query file --> #{file.path}", :yellow))
|
29
|
+
|
30
|
+
sql =
|
31
|
+
if @split_sql_mode
|
32
|
+
path = @out_dir.join("#{query.filename}.sql")
|
33
|
+
File.write(path, query.sql)
|
34
|
+
@out.puts(h.color(" sql --> #{path}", :yellow))
|
35
|
+
"open(File.join(__dir__, '#{query.filename}.sql')).read"
|
36
|
+
else
|
37
|
+
"%(#{query.sql})"
|
38
|
+
end
|
39
|
+
|
40
|
+
file.puts(<<EOS)
|
41
|
+
query "#{query.name}" do
|
42
|
+
sql #{sql}
|
43
|
+
end\n
|
44
|
+
EOS
|
45
|
+
file.close
|
46
|
+
|
47
|
+
@out.puts
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def export_head_file
|
54
|
+
File.open(@out_dir.join('tembin.rb'), "w") do |file|
|
55
|
+
@out.puts(h.color("export head file --> #{file.path}", :green))
|
56
|
+
|
57
|
+
file.puts(<<EOS)
|
58
|
+
Dir.glob(File.join(__dir__, "*.rb")) do |file|
|
59
|
+
next if File.expand_path(file) == File.expand_path('#{file.path}')
|
60
|
+
instance_eval(open(file).read, file, 1)
|
61
|
+
end
|
62
|
+
EOS
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def h
|
67
|
+
@h ||= HighLine.new
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Tembin::Redash
|
2
|
+
def self.config=(value)
|
3
|
+
@config = value
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.config
|
7
|
+
@config ||= {
|
8
|
+
api_key: nil,
|
9
|
+
host: nil,
|
10
|
+
authorized_user_email: nil,
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'tembin/redash/client'
|
16
|
+
require 'tembin/redash/query'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Tembin::Redash
|
4
|
+
class Client
|
5
|
+
class RequestNotSucceedError < StandardError; end
|
6
|
+
|
7
|
+
def self.current
|
8
|
+
Thread.current[:__tembin__redash_client__] ||= new(Tembin::Redash.config['api_key'], authorized_user_email: Tembin::Redash.config['authorized_user_email'])
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(api_key, authorized_user_email: nil)
|
12
|
+
@api_key = api_key
|
13
|
+
@authorized_user_email = authorized_user_email
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(path, params: {})
|
17
|
+
response = connection.get(path, { api_key: @api_key }.merge(params))
|
18
|
+
raise RequestNotSucceedError, response.body if !response.success?
|
19
|
+
response
|
20
|
+
end
|
21
|
+
|
22
|
+
def post(path, body: {}, params: {})
|
23
|
+
response = connection.post do |req|
|
24
|
+
req.url(path)
|
25
|
+
req.params = params.merge(api_key: @api_key)
|
26
|
+
req.body = body.to_json
|
27
|
+
req
|
28
|
+
end
|
29
|
+
|
30
|
+
raise RequestNotSucceedError, response.body if !response.success?
|
31
|
+
|
32
|
+
response
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete(path, params: {})
|
36
|
+
response = connection.delete(path, { api_key: @api_key }.merge(params))
|
37
|
+
raise RequestNotSucceedError, response.body if !response.success?
|
38
|
+
response
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def connection
|
44
|
+
@connection ||= Faraday.new(url: Tembin::Redash.config['host'])
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'diffy'
|
3
|
+
|
4
|
+
module Tembin::Redash
|
5
|
+
class Query
|
6
|
+
def self.all
|
7
|
+
response = Tembin::Redash::Client.current.get('/api/queries')
|
8
|
+
raise RequestNotSucceedError, response.body if !response.success?
|
9
|
+
JSON.parse(response.body)['results'].map { |j| self.new(j) }
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.created_by_me
|
13
|
+
all.select { |q| q.author_email == Tembin::Redash.config['authorized_user_email'] }
|
14
|
+
end
|
15
|
+
|
16
|
+
INITIAL_DATA_SOURCE_ID = 1
|
17
|
+
def self.create(name, sql)
|
18
|
+
Tembin::Redash::Client.current.post("/api/queries", body: { name: name, query: sql, data_source_id: INITIAL_DATA_SOURCE_ID })
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(attributes)
|
22
|
+
@attributes = attributes
|
23
|
+
end
|
24
|
+
|
25
|
+
def id
|
26
|
+
@attributes['id']
|
27
|
+
end
|
28
|
+
|
29
|
+
def name
|
30
|
+
@attributes['name']
|
31
|
+
end
|
32
|
+
|
33
|
+
def author_email
|
34
|
+
@attributes['user'] && @attributes['user']['email']
|
35
|
+
end
|
36
|
+
|
37
|
+
def sql
|
38
|
+
@attributes['query']
|
39
|
+
end
|
40
|
+
|
41
|
+
def filename
|
42
|
+
"#{@attributes['id']}_#{@attributes['name'].gsub(/(\/|-|\s)/, '_')}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def changed?(query)
|
46
|
+
Diffy::Diff.new(sql, query).to_s.length != 0
|
47
|
+
end
|
48
|
+
|
49
|
+
def update!(query)
|
50
|
+
Tembin::Redash::Client.current.post("/api/queries/#{id}", body: { query: query })
|
51
|
+
end
|
52
|
+
|
53
|
+
def delete!
|
54
|
+
Tembin::Redash::Client.current.delete("/api/queries/#{id}")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/tembin.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tembin/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tembin"
|
8
|
+
spec.version = Tembin::VERSION
|
9
|
+
spec.authors = ["Takatoshi Maeda"]
|
10
|
+
spec.email = ["me@tmd.tw"]
|
11
|
+
|
12
|
+
spec.summary = %q{Codenized Re:dash configurations}
|
13
|
+
spec.homepage = "https://github.com/TakatoshiMaeda/tembin"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.bindir = "exe"
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency "thor"
|
21
|
+
spec.add_runtime_dependency "diffy"
|
22
|
+
spec.add_runtime_dependency "highline"
|
23
|
+
spec.add_runtime_dependency "faraday"
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.5.0"
|
28
|
+
spec.add_development_dependency "pry"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tembin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Takatoshi Maeda
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
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: diffy
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: highline
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.11'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.11'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.5.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.5.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- me@tmd.tw
|
128
|
+
executables:
|
129
|
+
- tembin
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".travis.yml"
|
135
|
+
- Gemfile
|
136
|
+
- README.md
|
137
|
+
- Rakefile
|
138
|
+
- bin/console
|
139
|
+
- bin/setup
|
140
|
+
- exe/tembin
|
141
|
+
- lib/tembin.rb
|
142
|
+
- lib/tembin/applyer.rb
|
143
|
+
- lib/tembin/cli.rb
|
144
|
+
- lib/tembin/element.rb
|
145
|
+
- lib/tembin/element/alert.rb
|
146
|
+
- lib/tembin/element/base.rb
|
147
|
+
- lib/tembin/element/dashboard.rb
|
148
|
+
- lib/tembin/element/query.rb
|
149
|
+
- lib/tembin/element/visualizations.rb
|
150
|
+
- lib/tembin/element_parser.rb
|
151
|
+
- lib/tembin/exporter.rb
|
152
|
+
- lib/tembin/redash.rb
|
153
|
+
- lib/tembin/redash/client.rb
|
154
|
+
- lib/tembin/redash/query.rb
|
155
|
+
- lib/tembin/version.rb
|
156
|
+
- tembin.gemspec
|
157
|
+
homepage: https://github.com/TakatoshiMaeda/tembin
|
158
|
+
licenses: []
|
159
|
+
metadata: {}
|
160
|
+
post_install_message:
|
161
|
+
rdoc_options: []
|
162
|
+
require_paths:
|
163
|
+
- lib
|
164
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
requirements: []
|
175
|
+
rubyforge_project:
|
176
|
+
rubygems_version: 2.4.5
|
177
|
+
signing_key:
|
178
|
+
specification_version: 4
|
179
|
+
summary: Codenized Re:dash configurations
|
180
|
+
test_files: []
|