dataset_explorer 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
  SHA256:
3
- metadata.gz: d8d37acf8dbd69347ee5d469c4c6ee4a70b3c8a86a74ec30e7d92518a2b2943f
4
- data.tar.gz: 291900362c27de4d230b492e58983a9f8ac3c44b0a52cdcabd28636ee5536416
3
+ metadata.gz: 788e4dd9aa7ed70db9482c9eb8c5cc35fabae5039232dc2c10e0276fa97caf14
4
+ data.tar.gz: 0d14ebb6e7ae2363dfe47236b1a89565fbda381fecb4dc8732448dd27fbe82bf
5
5
  SHA512:
6
- metadata.gz: 9aff0c19a1a1fdaae24faa517a488e7611c26f445d80db30da997f3aa60a1ee583d30f4215cb3b48076b5bc8c51d166f01724cc322c77e2cedcc0ef5adec32be
7
- data.tar.gz: 007b2822c83146392d54429f63b43038ce5cf09e3d41b9e51d8bc81592fc617022c4b6af5e8e29617b928328badb4bbb205397f41bcd08452e8efff29aee2711
6
+ metadata.gz: eae4397828a7fb6c88da601ed429292893a9925089e37c4b7be57d3879c664605bcdeb40736e27da2522c7a8e1fdd587d91419d59b22fb5912d4b96523a0b1f2
7
+ data.tar.gz: c41ee84d680ce45f9d22e46b732bf31fc6490b0ded9f18f7ad721df4d91b9670747a83d375fcf78128e7e06e78993f93d5874870882d668940d37e02316d782d
data/README.md CHANGED
@@ -34,10 +34,12 @@ end
34
34
 
35
35
  # somewhere
36
36
 
37
- p DatasetExplorer::Collector.explain('type-of-request')
38
- p DatasetExplorer::Collector.explain_all
37
+ DatasetExplorer::Collector.explain('type-of-request')
38
+ # or
39
+ DatasetExplorer::Collector.explain_all
39
40
  ```
40
41
 
42
+ Example:
41
43
 
42
44
  ```ruby
43
45
  require 'bundler/setup'
@@ -68,70 +70,72 @@ Explanation will be:
68
70
 
69
71
  ```ruby
70
72
  {
71
- github: %w[
72
- jekyll
73
- jekyll-sass-converter
74
- kramdown
75
- jekyll-commonmark-ghpages
76
- liquid
77
- rouge
78
- github-pages-health-check
79
- jekyll-redirect-from
80
- jekyll-sitemap
81
- jekyll-feed
82
- jekyll-gist
83
- jekyll-paginate
84
- jekyll-coffeescript
85
- jekyll-seo-tag
86
- jekyll-github-metadata
87
- jekyll-avatar
88
- jekyll-remote-theme
89
- jemoji
90
- jekyll-mentions
91
- jekyll-relative-links
92
- jekyll-optional-front-matter
93
- jekyll-readme-index
94
- jekyll-default-layout
95
- jekyll-titles-from-headings
96
- jekyll-swiss
97
- minima
98
- jekyll-theme-primer
99
- jekyll-theme-architect
100
- jekyll-theme-cayman
101
- jekyll-theme-dinky
102
- jekyll-theme-hacker
103
- jekyll-theme-leap-day
104
- jekyll-theme-merlot
105
- jekyll-theme-midnight
106
- jekyll-theme-minimal
107
- jekyll-theme-modernist
108
- jekyll-theme-slate
109
- jekyll-theme-tactile
110
- jekyll-theme-time-machine
111
- ruby
112
- github-pages
113
- html-pipeline
114
- sass
115
- safe_yaml
116
- nokogiri
73
+ github: [
74
+ "jekyll",
75
+ "jekyll-sass-converter",
76
+ "kramdown",
77
+ "jekyll-commonmark-ghpages",
78
+ "liquid",
79
+ "rouge",
80
+ "github-pages-health-check",
81
+ "jekyll-redirect-from",
82
+ "jekyll-sitemap",
83
+ "jekyll-feed",
84
+ "jekyll-gist",
85
+ "jekyll-paginate",
86
+ "jekyll-coffeescript",
87
+ "jekyll-seo-tag",
88
+ "jekyll-github-metadata",
89
+ "jekyll-avatar",
90
+ "jekyll-remote-theme",
91
+ "jemoji",
92
+ "jekyll-mentions",
93
+ "jekyll-relative-links",
94
+ "jekyll-optional-front-matter",
95
+ "jekyll-readme-index",
96
+ "jekyll-default-layout",
97
+ "jekyll-titles-from-headings",
98
+ "jekyll-swiss",
99
+ "minima",
100
+ "jekyll-theme-primer",
101
+ "jekyll-theme-architect",
102
+ "jekyll-theme-cayman",
103
+ "jekyll-theme-dinky",
104
+ "jekyll-theme-hacker",
105
+ "jekyll-theme-leap-day",
106
+ "jekyll-theme-merlot",
107
+ "jekyll-theme-midnight",
108
+ "jekyll-theme-minimal",
109
+ "jekyll-theme-modernist",
110
+ "jekyll-theme-slate",
111
+ "jekyll-theme-tactile",
112
+ "jekyll-theme-time-machine",
113
+ "ruby",
114
+ "github-pages",
115
+ "html-pipeline",
116
+ "sass",
117
+ "safe_yaml",
118
+ "nokogiri",
117
119
  ],
118
120
  github_repo: [
119
- 'name',
120
- 'path',
121
- 'sha',
122
- 'size',
123
- 'url',
124
- 'html_url',
125
- 'git_url',
126
- 'download_url',
127
- 'type',
128
- '_links.self',
129
- '_links.git',
130
- '_links.html'
121
+ "name",
122
+ "path",
123
+ "sha",
124
+ "size",
125
+ "url",
126
+ "html_url",
127
+ "git_url",
128
+ "download_url",
129
+ "type",
130
+ "_links.self",
131
+ "_links.git",
132
+ "_links.html"
131
133
  ]
132
134
  }
133
135
  ```
134
136
 
137
+ Or if you try like this
138
+
135
139
  ```ruby
136
140
  data = {
137
141
  user: {
@@ -163,8 +167,6 @@ result = DatasetExplorer::Collector.explain_all(:achievements)
163
167
  ]
164
168
  ```
165
169
 
166
- Or if you try like this
167
-
168
170
  ## Development
169
171
 
170
172
  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.
@@ -9,16 +9,26 @@ module DatasetExplorer
9
9
  attr_reader :values
10
10
 
11
11
  def add(item)
12
+ unless item.is_a?(Array)
13
+ return add_item(item)
14
+ end
15
+
16
+ item.each do |i|
17
+ add_item(i, '[]')
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def add_item(item, prefix = nil)
12
24
  new_values = item.keys.map do |key|
13
- map_keys(item[key], key)
25
+ map_keys(item[key], key, prefix)
14
26
  end.flatten.map(&:to_s).uniq
15
27
 
16
28
  @values << new_values
17
29
  @values = @values.flatten.uniq
18
30
  end
19
31
 
20
- private
21
-
22
32
  # rubocop:disable Metrics/MethodLength
23
33
  def map_keys(value, key = nil, prefix = nil)
24
34
  prefix = [prefix, key].compact.join('.')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatasetExplorer
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dataset_explorer
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
  - Marcelo Jacobus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-23 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Explore and maps fields from a dataset - I.E. Api response
14
14
  email: