cutest-cj 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cutest +14 -1
  3. data/lib/cutest.rb +8 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a68e884e7e86738b74f543cf51d04ea3317e8c77
4
- data.tar.gz: 8155aa435a1c9193a28fb93e410adfd4f83e702d
3
+ metadata.gz: 280690061c479c165d28f6005e7ca95aa1ce1b7e
4
+ data.tar.gz: 95f63fd81e7e6b7e98c8a5560cc4bcada717705e
5
5
  SHA512:
6
- metadata.gz: 50fd8d32c88a67c4c1adb9683436393e16572c52bb2244be9d7a6b169cbe135069358d96f25f0aecde655d39f176df02aed37211144862d4c52dd7ddbeb5f06f
7
- data.tar.gz: abd4cd45d72285f1fb6a345dfe3fbd400142dbdd5b4d54403d995fa758d95dcdb206b2f3c6e9415979a6ea3b1a5becf773913ef22e113df3b013656a1aa886d8
6
+ metadata.gz: 72dc85da58fc84e8585bfd38334a9684bf3e4af7309730714512a413d895dccc636685740bbee4d2c145ceb8eecc06dc911db1a5ca5090e96463a9eaf9684b77
7
+ data.tar.gz: 10c04b49a9b55524385de103d5d33bbb0f71e1bc51cc67361855538b6d21e3c63a421af2609118124af4e409ab5151b3a4649f7cfe060bb5f1180a9af54e3e53
data/bin/cutest CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ ENV['RACK_ENV'] ||= 'test'
4
+
3
5
  if ARGV.empty?
4
6
  puts "usage: cutest [-r lib] [-v] file [-b (backtrace) [-p (pry rescue)]]"
5
7
  exit
@@ -13,11 +15,22 @@ files = Clap.run ARGV,
13
15
  "-t" => lambda { |name| cutest[:only] = name },
14
16
  "-s" => lambda { |name| cutest[:scope] = name },
15
17
  "-b" => lambda { cutest[:backtrace] = true },
16
- "-p" => lambda { ENV['PRY_RESCUE'] = 'true'; cutest[:pry_rescue] = true },
18
+ "-p" => lambda {
19
+ ENV['PRY_RESCUE'] = 'true'; cutest[:pry_rescue] = true
20
+ },
17
21
  "-v" => lambda { puts Cutest::VERSION }
18
22
 
19
23
  if files.any?
20
24
  begin
25
+ env = '.env'
26
+ rack_env = ".#{ENV['RACK_ENV']}#{env}"
27
+
28
+ if File.file? rack_env
29
+ Cutest.load_envs rack_env
30
+ elsif File.file? env
31
+ Cutest.load_envs env
32
+ end
33
+
21
34
  success = Cutest.run(Dir[*files])
22
35
 
23
36
  exit(1) unless success
@@ -2,11 +2,18 @@ require 'benchmark'
2
2
 
3
3
  class Cutest
4
4
  unless defined?(VERSION)
5
- VERSION = "1.2.2"
5
+ VERSION = "1.2.3"
6
6
  FILTER = %r[/(ruby|jruby|rbx)[-/]([0-9\.])+]
7
7
  CACHE = Hash.new { |h, k| h[k] = File.readlines(k) }
8
8
  end
9
9
 
10
+ def self.load_envs env
11
+ File.foreach env do |line|
12
+ key, value = line.split "="
13
+ ENV[key] = value.gsub('\n', '').strip
14
+ end
15
+ end
16
+
10
17
  def self.run(files)
11
18
  status = files.all? do |file|
12
19
  run_file(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cutest-cj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Janowski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-21 00:00:00.000000000 Z
13
+ date: 2014-05-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry-rescue