spout 0.6.0.beta7 → 0.6.0.rc

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
  SHA1:
3
- metadata.gz: 8321e511c49c9c76cdda7d8be1e289190888a05b
4
- data.tar.gz: 831e1f22202f30316a79c51e8ed93971600b4225
3
+ metadata.gz: bbef72d6ca54c940ae287a25f94bd794a7ea7eb1
4
+ data.tar.gz: ab4f7c2e9b7ed6261f1307ac01902f1d76841bf7
5
5
  SHA512:
6
- metadata.gz: 74529bff8848f4aff638e9b3a5bf0086dcd408e9b2988f2eaad48777c3feeab149c7dcef319f67de058351bd55ae9c8caa7e80322c6c31e4129c60c4834d58b6
7
- data.tar.gz: 905223a0af8901f51167aa3a0c1e269a18b7919b0ef7b807eb62562ee393b59beb1a0e962276be5614fa961432c3eb180a9fbcf525a405eb376e60294fbc13a9
6
+ metadata.gz: ae5344b68426a94036f75ed40d99cc13fb73eb180d5ecdfedc864acb6b7910fa1f46cc9371f58d2501f5ff536debef735bbc307248689693717e65fc27d2a5d0
7
+ data.tar.gz: 7d5bd440cf67393263bc339feb575876e9be618fdc0c83caf1c263abe9fa323bd88b41ca7af00811b72dad44360d1b6633032a6ac1ccbd9822d8f838031365a1
data/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ## 0.6.0
2
2
 
3
3
  ### Enhancement
4
- - Added `spout match` command that generates a coverage report of how well a dataset matches the data dictionary
5
- - Spout Match generates a viewable report in `dd\index.html` that shows which columns are covered in CSVs located in `dd\csvs`
6
- - Spout Match checks that all collected values for a variable with a domain exist in the associated domain
4
+ - Added `spout coverage` command that generates a coverage report of how well a dataset matches the data dictionary
5
+ - Generates a viewable report in `<project_name>/coverage/index.html` that shows which columns are covered in CSVs located in `<project_name>/csvs/`
6
+ - Checks that all collected values for a variable with a domain exist in the associated domain
7
7
  - **Gem Changes**
8
8
  - Updated to colorize 0.6.0
9
9
 
data/README.md CHANGED
@@ -120,6 +120,18 @@ end
120
120
  Then run either `spout test` or `bundle exec rake` to run your tests.
121
121
 
122
122
 
123
+ ### Test your data dictionary coverage of your dataset
124
+
125
+ Spout lets you generate a nice visual coverage report that displays how well the data dictionary covers your dataset. Place your dataset csvs into `./csvs/` and then run the following Spout command:
126
+
127
+ ```
128
+ spout coverage
129
+ ```
130
+
131
+ This will generate an `index.html` file that can be opened and viewed in any browser.
132
+
133
+ Spout coverage validates that values stored in your dataset match up with variables and domains defined in your data dictionary.
134
+
123
135
  ### Create a CSV Data Dictionary from your JSON repository
124
136
 
125
137
  Provide an optional version parameter to name the folder the CSVs will be generated in, defaults to what is in `VERSION` file, or if that does not exist `1.0.0`.
data/lib/spout/actions.rb CHANGED
@@ -19,8 +19,8 @@ module Spout
19
19
  new_data_dictionary_export(argv)
20
20
  when 'hybrid', '-hybrid', '--hybrid', 'y', 'hy', '-y', '-hy'
21
21
  new_data_dictionary_export(argv, 'hybrid')
22
- when 'dataset', '-dataset', '--dataset', 'd', '-d', 'match', '-match', '--match', 'm', '-m', 'coverage', '-coverage', '--coverage', 'c', '-c'
23
- match_dataset_report(argv)
22
+ when 'coverage', '-coverage', '--coverage', 'c', '-c'
23
+ coverage_report(argv)
24
24
  else
25
25
  help
26
26
  end
@@ -42,7 +42,7 @@ EOT
42
42
  def import_from_csv(argv, type = "")
43
43
  csv_file = File.join(argv[1].to_s.strip)
44
44
  if File.exists?(csv_file)
45
- system "bundle exec rake dd:import CSV=#{csv_file} #{'TYPE='+type if type.to_s != ''}"
45
+ system "bundle exec rake spout:import CSV=#{csv_file} #{'TYPE='+type if type.to_s != ''}"
46
46
  else
47
47
  puts csv_usage
48
48
  end
@@ -55,15 +55,17 @@ Usage: spout COMMAND [ARGS]
55
55
 
56
56
  The most common spout commands are:
57
57
  [n]ew Create a new Spout dictionary.
58
- "spout new my_dd" creates a new data
59
- dictionary called MyDD in "./my_dd"
58
+ `spout new <project_name>` creates a new
59
+ data dictionary in `./<project_name>`
60
60
  [t]est Run tests and show failing tests
61
61
  [tv] Run the tests and show passing and failing
62
62
  tests
63
- [i]mport Import a CSV file into the JSON repository
64
- [e]xport [1.0.0] Export the JSON respository to a CSV
65
- h[y]brid [1.0.0] Export the JSON repository in the Hybrid
66
- Dictionary format
63
+ [i]mport Import a CSV file into the JSON dictionary
64
+ [e]xport [1.0.0] Export the JSON dictionary to a CSV
65
+ h[y]brid [1.0.0] Export the JSON dictionary in the Hybrid
66
+ dictionary format
67
+ [c]overage Coverage report, requires dataset CSVs
68
+ in `<project_name>/csvs/`
67
69
  [v]ersion Returns the version of Spout
68
70
 
69
71
  Commands can be referenced by the first letter:
@@ -77,7 +79,7 @@ EOT
77
79
  version = argv[1].to_s.gsub(/[^a-zA-Z0-9\.-]/, '_').strip
78
80
  version_string = (version == '' ? "" : "VERSION=#{version}")
79
81
  type_string = type.to_s == '' ? "" : "TYPE=#{type}"
80
- system "bundle exec rake dd:create #{version_string} #{type_string}"
82
+ system "bundle exec rake spout:create #{version_string} #{type_string}"
81
83
  end
82
84
 
83
85
  def new_template_dictionary(argv)
@@ -114,8 +116,8 @@ EOT
114
116
  system "bundle install"
115
117
  end
116
118
 
117
- def match_dataset_report(argv)
118
- system "bundle exec rake dd:coverage"
119
+ def coverage_report(argv)
120
+ system "bundle exec rake spout:coverage"
119
121
  end
120
122
 
121
123
  private
@@ -8,9 +8,9 @@ Rake::TestTask.new do |t|
8
8
  t.verbose = true
9
9
  end
10
10
 
11
- task :default => :test
11
+ task default: :test
12
12
 
13
- namespace :dd do
13
+ namespace :spout do
14
14
  require 'csv'
15
15
  require 'fileutils'
16
16
  require 'rubygems'
@@ -60,7 +60,7 @@ namespace :dd do
60
60
  value_hash = {}
61
61
  csv_names = []
62
62
 
63
- Dir.glob("dd/csvs/*.csv").each do |csv_file|
63
+ Dir.glob("csvs/*.csv").each do |csv_file|
64
64
  csv_name = csv_file.split('/').last.to_s
65
65
  csv_names << csv_name
66
66
  puts "\nParsing: #{csv_name}"
@@ -104,8 +104,10 @@ namespace :dd do
104
104
  @coverage_results << [ csv_name, total_column_count, mapped_column_count ]
105
105
  end
106
106
 
107
- coverage_file = File.join(Dir.pwd, 'dd', 'index.html')
108
- puts "\nGenerating: index.html\n\n"
107
+ coverage_folder = File.join(Dir.pwd, 'coverage')
108
+ FileUtils.mkpath coverage_folder
109
+ coverage_file = File.join(coverage_folder, 'index.html')
110
+ print "\nGenerating: index.html\n\n"
109
111
 
110
112
  File.open(coverage_file, 'w+') do |file|
111
113
  name = 'index.html'
@@ -6,3 +6,5 @@
6
6
 
7
7
  # Data Dictionary folders
8
8
  /dd
9
+ /coverage
10
+ /csvs
data/lib/spout/version.rb CHANGED
@@ -3,7 +3,7 @@ module Spout
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
5
  TINY = 0
6
- BUILD = "beta7" # nil, "pre", "rc", "rc2"
6
+ BUILD = "rc" # nil, "pre", "rc", "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.beta7
4
+ version: 0.6.0.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake