rails-talks 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +16 -2
- data/lib/rails-talks.rb +4 -0
- data/lib/rails-talks/runner.rb +9 -3
- data/lib/rails-talks/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
# Rails-talks gem — now your rails repo and applications can talk
|
1
|
+
# Rails-talks gem — now your rails repo and applications can talk
|
2
2
|
|
3
3
|
### This is beta now
|
4
4
|
|
5
5
|
This gem using base gem [talks](https://github.com/ruby-talks/talks). You can use it if you want to hear when your rails repo and applications
|
6
6
|
tasks start and when they end.
|
7
7
|
|
8
|
+
Sponsored by Evil Martians <http://evilmartians.com>
|
8
9
|
## Why?
|
9
10
|
|
10
11
|
This idea appears on reddotrubyconf just as is :) I just thought about slow specs in rails and decided that I want to hear when they end.
|
@@ -13,13 +14,26 @@ This idea appears on reddotrubyconf just as is :) I just thought about slow spec
|
|
13
14
|
|
14
15
|
This gem using gem `talks` and overwrites some of rails methods when you call `rails-talks` instead of `rake` from your command line.
|
15
16
|
|
16
|
-
### Using
|
17
|
+
### Using rails-talks
|
18
|
+
|
19
|
+
Now only `rails-talks test` function available. It runs `bundle exec rake test` with before and after `talks` hooks.
|
17
20
|
|
18
21
|
```bash
|
19
22
|
$ gem install rails-talks
|
20
23
|
$ rails-talks test # instead of just `bundle exec rake test`
|
21
24
|
```
|
22
25
|
|
26
|
+
You can work with `rails-talks test` just the same as with original `bundle exec rake test` - with some options and customizations:
|
27
|
+
|
28
|
+
`You are in .../rails/activesupport folder`
|
29
|
+
```bash
|
30
|
+
$ TEST_DIR=core_ext RUBYOPT=-W0 rails-talks test
|
31
|
+
# instead of
|
32
|
+
$ TEST_DIR=core_ext RUBYOPT=-W0 bundle exec rake test
|
33
|
+
```
|
34
|
+
|
35
|
+
How to customize voices for `talks` you can find in [talks](https://github.com/ruby-talks/talks) repo.
|
36
|
+
|
23
37
|
More info later
|
24
38
|
|
25
39
|
## Who?
|
data/lib/rails-talks.rb
CHANGED
data/lib/rails-talks/runner.rb
CHANGED
@@ -3,9 +3,15 @@ module RailsTalks
|
|
3
3
|
class << self
|
4
4
|
|
5
5
|
def run_tests(opts)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
run_rake(opts, 'Rails tests started', 'Rails tests ended')
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_rake(opts, before = nil, after = nil)
|
10
|
+
before ||= "Rake task '#{opts[0]}' started"
|
11
|
+
after ||= "Rake task '#{opts[0]}' ended"
|
12
|
+
Talks.info before
|
13
|
+
system "bundle exec rake #{opts[0..-1]}"
|
14
|
+
Talks.info after
|
9
15
|
end
|
10
16
|
|
11
17
|
end
|
data/lib/rails-talks/version.rb
CHANGED