sourmix 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae2ee642e11bf966d53ffa6f600688c4e08f7293
4
- data.tar.gz: 7a4059b0661c2315ceef17505c23f88abf37cdeb
3
+ metadata.gz: dbe4de7f0aa91eb5a6e0282d8234390571a64f63
4
+ data.tar.gz: 874cff5f4a135269cf4175c8f00759e0e3dda25a
5
5
  SHA512:
6
- metadata.gz: 872ca15d8c207e1bfcdb7f772627a6f71c71ff32e95209624e64d03dc6a94b8f450ffcc4d12a442bcd0e2f0c8a383dc1fde9275b941d06c2a510dfb31d35b542
7
- data.tar.gz: 4f30fe8cbbe30c7e207a2521e0213307075252abbeacac51b1cb23f4e7cd039710c1695183d16ec9454408fa8fe34f2eeb7ac15e9b9f4304f782bc079b68317d
6
+ metadata.gz: 7e7c52ace795278e896a89609a0f0c0308fba7043c9e649c3a1cde2fec724f6bb3d1dd15863edfba627d57bb972c748868a3faf3c59e247494f97018626a5d43
7
+ data.tar.gz: a43256ccce5f2f35cefed658377e31385c33952912e74a68d6479b48a6a11d128c65d94a2644b92b2619b4c5b3e5ac47b134bc1c460a19466cd11baab51c5d60
data/Readme.md CHANGED
@@ -43,6 +43,12 @@ You're probably most interested in the `go` command:
43
43
 
44
44
  ## Changelog
45
45
 
46
+ #### v1.0.1
47
+
48
+ - Set default date to one hour ago
49
+ - Allow setting date option via envionment variable
50
+ - Set default type (not configurable at this time)
51
+
46
52
  #### v1.0.0
47
53
 
48
54
  - Initial implementation
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -10,7 +10,7 @@ class Mjolnir < Thor
10
10
  log: {
11
11
  type: :string,
12
12
  aliases: %w[ -L ],
13
- desc: 'Log to file instead of STDERR',
13
+ desc: 'Log to file instead of STDOUT',
14
14
  default: ENV['SOURMIX_LOG'] || nil
15
15
  },
16
16
  debug: {
@@ -36,7 +36,7 @@ class Mjolnir < Thor
36
36
  return @logger if defined? @logger
37
37
  level = :info
38
38
  level = :debug if options.debug?
39
- device = options.log || $stderr
39
+ device = options.log || $stdout
40
40
  pretty = device.tty? rescue false
41
41
  @logger = Slog.new \
42
42
  out: device,
@@ -84,7 +84,17 @@ module SourMix
84
84
 
85
85
  ops = 1.0 * (nok + nerr) / elapsed_s
86
86
 
87
- log.info event: :process_dataset, okay: nok, errors: nerr, elapsed_s: elapsed_s, ops: ops, pages: results.size
87
+ info = {
88
+ event: :process_dataset,
89
+ elapsed_s: elapsed_s,
90
+ ops: ops,
91
+ pages: results.size
92
+ }
93
+
94
+ info[:okay] = nok unless nok.zero?
95
+ info[:errors] = nerr unless nerr.zero?
96
+
97
+ log.info info
88
98
 
89
99
  results
90
100
  end
@@ -162,12 +172,23 @@ module SourMix
162
172
 
163
173
 
164
174
  def sh command
165
- if options.debug
166
- puts command
167
- system command
175
+ output = if options.debug
176
+ $stderr.puts command
177
+ system "#{command} 1>&2"
168
178
  else
169
- `#{command} 2>&1`
179
+ `#{command} 1>&2`
170
180
  end
181
+
182
+ unless $?.exitstatus.zero?
183
+ log.fatal \
184
+ error: 'Command failed',
185
+ command: command,
186
+ status: $?.exitstatus,
187
+ output: output
188
+ raise 'Command "%s" failed' % command
189
+ end
190
+
191
+ output
171
192
  end
172
193
 
173
194
 
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuite name="TestSourMix" tests="1" time="0.000669" failures="1" errors="0" skipped="0" assertions="1" timestamp="2016-02-18T12:02:46-08:00">
3
+ <testcase name="test_fails" time="2.7547008357942104e-05" assertions="1">
4
+ <failure type="Minitest::Assertion" message="Failed assertion, no message given.">
5
+ Failed assertion, no message given. (Minitest::Assertion)
6
+ /Users/sclemmer/Projects/sourmix/test/test_sourmix.rb:17 </failure>
7
+ </testcase>
8
+ </testsuite>
@@ -0,0 +1,7 @@
1
+ require 'simplecov'
2
+ require 'simplecov-cobertura'
3
+ SimpleCov.formatters = [
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ SimpleCov::Formatter::CoberturaFormatter
6
+ ]
7
+ SimpleCov.start
@@ -0,0 +1,19 @@
1
+ require 'minitest/autorun'
2
+
3
+ require_relative 'test_helper'
4
+ require_relative '../lib/sourmix'
5
+
6
+ Thread.abort_on_exception = true
7
+
8
+
9
+ class TestSourMix < MiniTest::Test
10
+ def setup
11
+ end
12
+
13
+ def teardown
14
+ end
15
+
16
+ def test_fails
17
+ assert false
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourmix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slog
@@ -69,6 +69,9 @@ files:
69
69
  - lib/sourmix/mixpanel_client.rb
70
70
  - lib/sourmix/mjolnir.rb
71
71
  - lib/sourmix/perform.rb
72
+ - test/reports/TEST-TestSourMix.xml
73
+ - test/test_helper.rb
74
+ - test/test_sourmix.rb
72
75
  homepage: https://github.com/sczizzo/sourmix
73
76
  licenses:
74
77
  - ISC
@@ -93,4 +96,7 @@ rubygems_version: 2.4.5.1
93
96
  signing_key:
94
97
  specification_version: 4
95
98
  summary: Shove Mixpanel events into Kafka by way of Theon
96
- test_files: []
99
+ test_files:
100
+ - test/reports/TEST-TestSourMix.xml
101
+ - test/test_helper.rb
102
+ - test/test_sourmix.rb