sisense 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +73 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/lib/sisense/alert.rb +5 -0
- data/lib/sisense/api/client.rb +101 -0
- data/lib/sisense/api/nested_resource.rb +12 -0
- data/lib/sisense/api/resource.rb +97 -0
- data/lib/sisense/connection.rb +5 -0
- data/lib/sisense/dashboard.rb +5 -0
- data/lib/sisense/dataset.rb +5 -0
- data/lib/sisense/elasticube.rb +15 -0
- data/lib/sisense/elasticube_datasecurity.rb +26 -0
- data/lib/sisense/folder.rb +5 -0
- data/lib/sisense/group.rb +11 -0
- data/lib/sisense/share.rb +5 -0
- data/lib/sisense/translation.rb +5 -0
- data/lib/sisense/user.rb +34 -0
- data/lib/sisense/utils/string.rb +16 -0
- data/lib/sisense/version.rb +3 -0
- data/lib/sisense/widget.rb +5 -0
- data/lib/sisense.rb +33 -0
- data/sisense.gemspec +29 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2101e08febdf163359caa6a4796036a4d014bc42f2d998dcf04fb076c6db4679
|
4
|
+
data.tar.gz: 685f7eb3401b207167c4614e9f9229969547463c669f3412376313687d1f4c44
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8644de850bbb9a66a126e84b437f2f344b569d9dfe14c28039115d4e9f7f818d3fc724a419ac5344a43dbdeb0d1c02ce76a7e39742ef94f6fec46d18477b0e9a
|
7
|
+
data.tar.gz: 23977fccf7fde6ca1a31b7f1feb8666212bc8df31e84efeb525a68eb549616b66f5194ba2289ea1cb5cf75a23dc792dd27c12595008e0859259bf1f4f4f29b3d
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sisense (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
addressable (2.5.2)
|
10
|
+
public_suffix (>= 2.0.2, < 4.0)
|
11
|
+
ast (2.4.0)
|
12
|
+
coderay (1.1.2)
|
13
|
+
crack (0.4.3)
|
14
|
+
safe_yaml (~> 1.0.0)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
hashdiff (0.3.7)
|
17
|
+
jaro_winkler (1.5.1)
|
18
|
+
method_source (0.9.0)
|
19
|
+
parallel (1.12.1)
|
20
|
+
parser (2.5.1.2)
|
21
|
+
ast (~> 2.4.0)
|
22
|
+
powerpack (0.1.2)
|
23
|
+
pry (0.11.3)
|
24
|
+
coderay (~> 1.1.0)
|
25
|
+
method_source (~> 0.9.0)
|
26
|
+
public_suffix (3.0.3)
|
27
|
+
rainbow (3.0.0)
|
28
|
+
rake (12.3.1)
|
29
|
+
rspec (3.8.0)
|
30
|
+
rspec-core (~> 3.8.0)
|
31
|
+
rspec-expectations (~> 3.8.0)
|
32
|
+
rspec-mocks (~> 3.8.0)
|
33
|
+
rspec-core (3.8.0)
|
34
|
+
rspec-support (~> 3.8.0)
|
35
|
+
rspec-expectations (3.8.1)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.8.0)
|
38
|
+
rspec-mocks (3.8.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.8.0)
|
41
|
+
rspec-support (3.8.0)
|
42
|
+
rubocop (0.59.1)
|
43
|
+
jaro_winkler (~> 1.5.1)
|
44
|
+
parallel (~> 1.10)
|
45
|
+
parser (>= 2.5, != 2.5.1.1)
|
46
|
+
powerpack (~> 0.1)
|
47
|
+
rainbow (>= 2.2.2, < 4.0)
|
48
|
+
ruby-progressbar (~> 1.7)
|
49
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
50
|
+
ruby-progressbar (1.10.0)
|
51
|
+
safe_yaml (1.0.4)
|
52
|
+
unicode-display_width (1.4.0)
|
53
|
+
vcr (4.0.0)
|
54
|
+
webmock (3.4.2)
|
55
|
+
addressable (>= 2.3.6)
|
56
|
+
crack (>= 0.3.2)
|
57
|
+
hashdiff
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
bundler
|
64
|
+
pry
|
65
|
+
rake
|
66
|
+
rspec
|
67
|
+
rubocop
|
68
|
+
sisense!
|
69
|
+
vcr
|
70
|
+
webmock
|
71
|
+
|
72
|
+
BUNDLED WITH
|
73
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Olivier Buffon
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Sisense
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.com/chronogolf/sisense.svg?branch=master)](https://travis-ci.com/chronogolf/sisense)
|
4
|
+
|
5
|
+
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/sisense`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
TODO: Delete this and the text above, and describe your gem
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'sisense'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install sisense
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
TODO: Write usage instructions here
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
+
|
33
|
+
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).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chronogolf/sisense.
|
38
|
+
|
39
|
+
## License
|
40
|
+
|
41
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
3
|
+
require 'cgi'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Sisense
|
7
|
+
module API
|
8
|
+
class Client
|
9
|
+
VERB_MAP = {
|
10
|
+
get: Net::HTTP::Get,
|
11
|
+
post: Net::HTTP::Post,
|
12
|
+
put: Net::HTTP::Put,
|
13
|
+
patch: Net::HTTP::Patch,
|
14
|
+
delete: Net::HTTP::Delete
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
uri = URI.parse(Sisense.base_uri)
|
19
|
+
@http = Net::HTTP.new(uri.host, uri.port)
|
20
|
+
# @http.use_ssl = true
|
21
|
+
end
|
22
|
+
|
23
|
+
attr_reader :http
|
24
|
+
|
25
|
+
def get(path, params: {})
|
26
|
+
request :get, path, params
|
27
|
+
end
|
28
|
+
|
29
|
+
def post(path, params: {})
|
30
|
+
request :post, path, params
|
31
|
+
end
|
32
|
+
|
33
|
+
def put(path, params: {})
|
34
|
+
request :put, path, params
|
35
|
+
end
|
36
|
+
|
37
|
+
def patch(path, params: {})
|
38
|
+
request :patch, path, params
|
39
|
+
end
|
40
|
+
|
41
|
+
def delete(path)
|
42
|
+
request :delete, path
|
43
|
+
end
|
44
|
+
|
45
|
+
def parsed_response(response, object_class:)
|
46
|
+
response_hash = JSON.parse(response.body)
|
47
|
+
if collection?(response_hash)
|
48
|
+
response_hash.map { |json_item| object_class.new(json_item) }
|
49
|
+
else
|
50
|
+
object_class.new(response_hash)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def collection?(response_body)
|
57
|
+
response_body.is_a?(Array)
|
58
|
+
end
|
59
|
+
|
60
|
+
def request(method, path, params = {})
|
61
|
+
case method
|
62
|
+
when :get
|
63
|
+
request = VERB_MAP[method].new(encode_path(path, params), headers)
|
64
|
+
else
|
65
|
+
request = VERB_MAP[method].new(encode_path(path), headers)
|
66
|
+
request.body = parameterize(params).to_json
|
67
|
+
end
|
68
|
+
http.request(request)
|
69
|
+
end
|
70
|
+
|
71
|
+
def encode_path(path, params = nil)
|
72
|
+
encoded_path = URI.encode(path)
|
73
|
+
return path if params.nil?
|
74
|
+
|
75
|
+
encoded_params = URI.encode_www_form(params)
|
76
|
+
[encoded_path, encoded_params].join('?')
|
77
|
+
end
|
78
|
+
|
79
|
+
def headers
|
80
|
+
@headers ||= { 'Authorization' => "Bearer #{Sisense.access_token}", 'Content-Type' => 'application/json' }
|
81
|
+
end
|
82
|
+
|
83
|
+
def parameterize(object)
|
84
|
+
object.tap do |obj|
|
85
|
+
return object.map { |item| parameterize(item) } if object.is_a?(Array)
|
86
|
+
|
87
|
+
obj.keys.each do |key|
|
88
|
+
obj[key] = parameterize_object(obj[key]) unless obj[key].is_a?(String)
|
89
|
+
obj[key.to_s.camelize] = obj.delete(key)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def parameterize_object(object)
|
95
|
+
return parameterize(object.to_h) if Sisense::API::Resource.descendants.include?(object.class)
|
96
|
+
return parameterize(object) if object.is_a?(Hash)
|
97
|
+
return object.map { |item| item.is_a?(String) ? item : parameterize_object(item) } if object.is_a?(Array)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Sisense
|
2
|
+
module API
|
3
|
+
class NestedResource < Resource
|
4
|
+
def self.resource_base_path(use_legacy_api: false)
|
5
|
+
raise NotImplementedError, 'Sisense::API::NestedResource is an abstract class' if self == NestedResource
|
6
|
+
|
7
|
+
path_base = use_legacy_api ? '/api/' : '/api/v1/'
|
8
|
+
path_base + self::PARENT_CLASS::RESOURCE_NAME
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Sisense
|
2
|
+
module API
|
3
|
+
class Resource
|
4
|
+
def initialize(data = {})
|
5
|
+
convert_to_obj(data)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.api_client
|
9
|
+
@api_client ||= Sisense::API::Client.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.class_name
|
13
|
+
name.split('::')[-1]
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.resource_base_path(use_legacy_api: false)
|
17
|
+
raise NotImplementedError, 'Sisense::API::Resource is an abstract class' if self == Resource
|
18
|
+
|
19
|
+
path_base = use_legacy_api ? '/api/' : '/api/v1/'
|
20
|
+
path_base + self::RESOURCE_NAME
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.descendants
|
24
|
+
ObjectSpace.each_object(Class).select do |klass|
|
25
|
+
klass < self && klass != Sisense::API::NestedResource
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_h
|
30
|
+
instance_variables.each_with_object({}) do |instance_variable, h|
|
31
|
+
key = instance_variable[1..instance_variable.length]
|
32
|
+
value = instance_variable_get(instance_variable)
|
33
|
+
h[key.to_sym] = build_hash_value_from_attribute_value(value)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def build_hash_value_from_attribute_value(attr_value)
|
40
|
+
return attr_value.to_h if known_resource_class?(attr_value.class)
|
41
|
+
return attr_value.map(&:to_h) if collection_of_known_resource_class?(attr_value)
|
42
|
+
|
43
|
+
attr_value
|
44
|
+
end
|
45
|
+
|
46
|
+
def collection_of_known_resource_class?(object)
|
47
|
+
object.is_a?(Array) && object.all? { |item| known_resource_class?(item.class) }
|
48
|
+
end
|
49
|
+
|
50
|
+
def known_resource_class?(object_class)
|
51
|
+
Sisense.api_resources.value?(object_class)
|
52
|
+
end
|
53
|
+
|
54
|
+
def convert_to_obj(hash)
|
55
|
+
sanitized_hash(hash).each do |key, value|
|
56
|
+
object = build_object(key, value)
|
57
|
+
instance_variable_set("@#{key}", object)
|
58
|
+
self.class.send(:attr_accessor, key)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def build_object(key, value)
|
63
|
+
return build_resource_collection(key, value) if nested_resource_collection?(key, value)
|
64
|
+
return build_resource(key, value) if nested_resource?(key, value)
|
65
|
+
|
66
|
+
value
|
67
|
+
end
|
68
|
+
|
69
|
+
def build_resource_collection(key, value)
|
70
|
+
resource_collection = value.map { |resource_attributes| build_resource(key, resource_attributes) }
|
71
|
+
instance_variable_set("@#{key}", resource_collection)
|
72
|
+
end
|
73
|
+
|
74
|
+
def build_resource(key, resource_attributes)
|
75
|
+
resource_class(key).new(resource_attributes)
|
76
|
+
end
|
77
|
+
|
78
|
+
def nested_resource_collection?(key, value)
|
79
|
+
value.is_a?(Array) && value.all? { |obj| nested_resource?(key, obj) }
|
80
|
+
end
|
81
|
+
|
82
|
+
def nested_resource?(key, value)
|
83
|
+
Sisense.api_resources.key?(key) && value.is_a?(Hash)
|
84
|
+
end
|
85
|
+
|
86
|
+
def resource_class(resource)
|
87
|
+
Sisense.api_resources[resource]
|
88
|
+
end
|
89
|
+
|
90
|
+
def sanitized_hash(hash)
|
91
|
+
hash.tap do |h|
|
92
|
+
h.keys.each { |key| h[key.underscore] = h.delete(key) }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Sisense
|
2
|
+
class Elasticube < API::Resource
|
3
|
+
RESOURCE_NAME = 'elasticubes'.freeze
|
4
|
+
|
5
|
+
def self.list
|
6
|
+
path = [resource_base_path, 'getElasticubes'].join('/')
|
7
|
+
response = api_client.get(path)
|
8
|
+
api_client.parsed_response(response, object_class: self)
|
9
|
+
end
|
10
|
+
|
11
|
+
def datasecurity
|
12
|
+
@datasecurity ||= ElasticubeDatasecurity.list(params: { server: server, elasticube_title: title })
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Sisense
|
2
|
+
class ElasticubeDatasecurity < API::NestedResource
|
3
|
+
RESOURCE_NAME = 'datasecurity'.freeze
|
4
|
+
PARENT_CLASS = Sisense::Elasticube
|
5
|
+
|
6
|
+
def self.list(params: {})
|
7
|
+
server = params[:server]
|
8
|
+
title = params[:elasticube_title]
|
9
|
+
path = [resource_base_path(use_legacy_api: true), server, title, 'datasecurity'].join('/')
|
10
|
+
response = api_client.get(path)
|
11
|
+
api_client.parsed_response(response, object_class: self)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.create(params:)
|
15
|
+
path = [resource_base_path(use_legacy_api: true), 'datasecurity'].join('/')
|
16
|
+
response = api_client.post(path, params: params)
|
17
|
+
api_client.parsed_response(response, object_class: self)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.update(id:, params:)
|
21
|
+
path = [resource_base_path(use_legacy_api: true), 'datasecurity', id].join('/')
|
22
|
+
response = api_client.put(path, params: params)
|
23
|
+
api_client.parsed_response(response, object_class: self)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/sisense/user.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
module Sisense
|
2
|
+
class User < API::Resource
|
3
|
+
RESOURCE_NAME = 'users'.freeze
|
4
|
+
|
5
|
+
def self.list(params: nil)
|
6
|
+
path = resource_base_path
|
7
|
+
response = api_client.get(path, params: params)
|
8
|
+
api_client.parsed_response(response, object_class: self)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.retrieve(id:, params: nil)
|
12
|
+
path = [resource_base_path, id].join('/')
|
13
|
+
response = api_client.get(path, params: params)
|
14
|
+
api_client.parsed_response(response, object_class: self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.create(params:)
|
18
|
+
path = resource_base_path
|
19
|
+
response = api_client.post(path, params: params)
|
20
|
+
api_client.parsed_response(response, object_class: self)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.update(id:, params:)
|
24
|
+
path = [resource_base_path, id].join('/')
|
25
|
+
response = api_client.patch(path, params: params)
|
26
|
+
api_client.parsed_response(response, object_class: self)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.delete(id:)
|
30
|
+
path = [resource_base_path, id].join('/')
|
31
|
+
api_client.delete(path)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class String
|
2
|
+
def underscore
|
3
|
+
gsub(/::/, '/')
|
4
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
5
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
6
|
+
.tr('-', '_')
|
7
|
+
.downcase
|
8
|
+
end
|
9
|
+
|
10
|
+
def camelize
|
11
|
+
split('_').each_with_object([]).with_index do |(string_part, string_parts), index|
|
12
|
+
string_part.capitalize! if index > 0
|
13
|
+
string_parts << string_part
|
14
|
+
end.join
|
15
|
+
end
|
16
|
+
end
|
data/lib/sisense.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'sisense/utils/string'
|
2
|
+
require 'sisense/version'
|
3
|
+
require 'sisense/api/client'
|
4
|
+
require 'sisense/api/resource'
|
5
|
+
require 'sisense/api/nested_resource'
|
6
|
+
|
7
|
+
require 'sisense/alert'
|
8
|
+
require 'sisense/connection'
|
9
|
+
require 'sisense/dashboard'
|
10
|
+
require 'sisense/dataset'
|
11
|
+
require 'sisense/elasticube'
|
12
|
+
require 'sisense/elasticube_datasecurity'
|
13
|
+
require 'sisense/folder'
|
14
|
+
require 'sisense/group'
|
15
|
+
require 'sisense/share'
|
16
|
+
require 'sisense/translation'
|
17
|
+
require 'sisense/user'
|
18
|
+
require 'sisense/widget'
|
19
|
+
|
20
|
+
module Sisense
|
21
|
+
@access_token = nil
|
22
|
+
@base_uri = nil
|
23
|
+
|
24
|
+
class << self
|
25
|
+
attr_accessor :access_token, :base_uri
|
26
|
+
|
27
|
+
def api_resources
|
28
|
+
@api_resources ||= API::Resource.descendants.each_with_object({}) do |descendant, resources|
|
29
|
+
resources[descendant::RESOURCE_NAME] = descendant
|
30
|
+
end.freeze
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/sisense.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'sisense/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'sisense'
|
7
|
+
spec.version = Sisense::VERSION
|
8
|
+
spec.authors = ['Olivier Buffon']
|
9
|
+
spec.email = ['olivier@chronogolf.ca']
|
10
|
+
|
11
|
+
spec.summary = 'Sisense Ruby API Client'
|
12
|
+
spec.description = 'Light API client to communicate with Sisense API'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/})
|
17
|
+
end
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'pry'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec'
|
26
|
+
spec.add_development_dependency 'rubocop'
|
27
|
+
spec.add_development_dependency 'vcr'
|
28
|
+
spec.add_development_dependency 'webmock'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sisense
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Olivier Buffon
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-09-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
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: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
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: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
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: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
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: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Light API client to communicate with Sisense API
|
112
|
+
email:
|
113
|
+
- olivier@chronogolf.ca
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".travis.yml"
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/console
|
128
|
+
- bin/setup
|
129
|
+
- lib/sisense.rb
|
130
|
+
- lib/sisense/alert.rb
|
131
|
+
- lib/sisense/api/client.rb
|
132
|
+
- lib/sisense/api/nested_resource.rb
|
133
|
+
- lib/sisense/api/resource.rb
|
134
|
+
- lib/sisense/connection.rb
|
135
|
+
- lib/sisense/dashboard.rb
|
136
|
+
- lib/sisense/dataset.rb
|
137
|
+
- lib/sisense/elasticube.rb
|
138
|
+
- lib/sisense/elasticube_datasecurity.rb
|
139
|
+
- lib/sisense/folder.rb
|
140
|
+
- lib/sisense/group.rb
|
141
|
+
- lib/sisense/share.rb
|
142
|
+
- lib/sisense/translation.rb
|
143
|
+
- lib/sisense/user.rb
|
144
|
+
- lib/sisense/utils/string.rb
|
145
|
+
- lib/sisense/version.rb
|
146
|
+
- lib/sisense/widget.rb
|
147
|
+
- sisense.gemspec
|
148
|
+
homepage:
|
149
|
+
licenses:
|
150
|
+
- MIT
|
151
|
+
metadata: {}
|
152
|
+
post_install_message:
|
153
|
+
rdoc_options: []
|
154
|
+
require_paths:
|
155
|
+
- lib
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
requirements: []
|
167
|
+
rubyforge_project:
|
168
|
+
rubygems_version: 2.7.6
|
169
|
+
signing_key:
|
170
|
+
specification_version: 4
|
171
|
+
summary: Sisense Ruby API Client
|
172
|
+
test_files: []
|