tconsole 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -97,6 +97,8 @@ module TConsole
97
97
  send_message(:run_info)
98
98
  elsif args[0] == "set"
99
99
  send_message(:set, args[1], args[2])
100
+ elsif args[0].start_with?(".")
101
+ send_message(:shell, command[1, command.length - 1])
100
102
  elsif @config.file_sets.has_key?(args[0])
101
103
  send_message(:run_file_set, args[0])
102
104
  else
@@ -122,6 +124,7 @@ module TConsole
122
124
  puts "!failed # Runs the last set of failing tests"
123
125
  puts "!timings [limit] # Lists the timings for the last test run, sorted."
124
126
  puts "[filename] [test_pattern] # Run the tests contained in the given file"
127
+ puts ".[command] # Executes the given command in a subshell"
125
128
  puts
126
129
  puts "Running file sets"
127
130
  puts
@@ -270,5 +270,25 @@ module TConsole
270
270
  puts
271
271
  end
272
272
  end
273
+
274
+ # Internal: Runs the given command in the shell.
275
+ #
276
+ # command - the command to execute
277
+ #
278
+ # Examples
279
+ #
280
+ # shell("ls -la")
281
+ def shell(command)
282
+ system(command)
283
+
284
+ result = $?
285
+
286
+ puts
287
+ if result.exitstatus == 0
288
+ puts ::Term::ANSIColor.green + "Command exited with status code: 0" + ::Term::ANSIColor.reset
289
+ else
290
+ puts ::Term::ANSIColor.red + "Command exited with status code: #{result.exitstatus}" + ::Term::ANSIColor.reset
291
+ end
292
+ end
273
293
  end
274
294
  end
@@ -1,3 +1,3 @@
1
1
  module TConsole
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tconsole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor
16
- requirement: &70093296478000 !ruby/object:Gem::Requirement
16
+ requirement: &70161656712100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70093296478000
24
+ version_requirements: *70161656712100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70093296477000 !ruby/object:Gem::Requirement
27
+ requirement: &70161656711380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 3.3.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70093296477000
35
+ version_requirements: *70161656711380
36
36
  description: ! " tconsole allows Rails developers to easily and quickly run their
37
37
  tests as a whole or in subsets. It forks the testing processes from\n a preloaded
38
38
  test environment to ensure that developers don't have to reload their entire Rails