thor_tasks 0.0.7 → 0.0.8
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.
- data/README.rdoc +23 -2
- data/lib/tasks/spec.thor +16 -3
- data/lib/thor_tasks/version.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
== Installation
|
2
2
|
|
3
|
+
=== Install in a Rails app
|
4
|
+
|
3
5
|
Add the gem to your Gemfile:
|
4
6
|
gem 'thor_tasks'
|
5
7
|
Run bundle, and install the tasks into your app:
|
@@ -7,7 +9,15 @@ Run bundle, and install the tasks into your app:
|
|
7
9
|
rails g thor_tasks:install
|
8
10
|
You can see a list of all the available tasks by running:
|
9
11
|
thor list
|
10
|
-
|
12
|
+
|
13
|
+
=== Install system-wide
|
14
|
+
|
15
|
+
Clone the repository and install them using `thor install'
|
16
|
+
git clone git://github.com/travishaynes/thor_tasks.git thor_tasks
|
17
|
+
thor install thor_tasks/lib/tasks/mongo.thor
|
18
|
+
thor install thor_tasks/lib/tasks/spec.thor
|
19
|
+
thor install thor_tasks/lib/tasks/spork.thor
|
20
|
+
|
11
21
|
== Spork tasks
|
12
22
|
|
13
23
|
These tasks allow you to start, stop, and restart Spork as a background process
|
@@ -35,6 +45,16 @@ The following tasks are helpers for running your RSpecs:
|
|
35
45
|
thor spec:view [CONTROLLER] [ACTION]
|
36
46
|
thor spec:list [TYPE]
|
37
47
|
|
48
|
+
You can also use these aliases:
|
49
|
+
thor spec:a # => thor spec:all
|
50
|
+
thor spec:c # => thor spec:controlleer
|
51
|
+
thor spec:h # => thor spec:helper
|
52
|
+
thor spec:m # => thor spec:model
|
53
|
+
thor spec:t # => thor spec:request
|
54
|
+
thor spec:r # => thor spec:routing
|
55
|
+
thor spec:v # => thor spec:view
|
56
|
+
thor spec:l # => thor spec:list
|
57
|
+
|
38
58
|
Running any spec task without any options will run all the specs for that
|
39
59
|
category, with the exception of the list spec, which will list all the available
|
40
60
|
spec files. For the spec:view task, you can specify a controller, and an action.
|
@@ -49,9 +69,10 @@ or, you can use the abbreviated option:
|
|
49
69
|
== Mongo tasks
|
50
70
|
|
51
71
|
These tasks allow you to start, stop, and restart MongoDB as a background
|
52
|
-
process
|
72
|
+
process, and repair all Mongo databases.
|
53
73
|
|
54
74
|
The tasks are:
|
75
|
+
thor mongo:repair
|
55
76
|
thor mongo:start
|
56
77
|
thor mongo:restart
|
57
78
|
thor mongo:stop
|
data/lib/tasks/spec.thor
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
class Spec < Thor
|
2
2
|
include Thor::Actions
|
3
3
|
|
4
|
-
|
4
|
+
map "a" => :all,
|
5
|
+
"c" => :controller,
|
6
|
+
"h" => :helper,
|
7
|
+
"l" => :list,
|
8
|
+
"m" => :model,
|
9
|
+
"t" => :request,
|
10
|
+
"r" => :routing,
|
11
|
+
"v" => :view
|
12
|
+
|
13
|
+
no_tasks do
|
14
|
+
def available_types
|
15
|
+
['controllers', 'helpers', 'models', 'requests', 'routing', 'views']
|
16
|
+
end
|
17
|
+
end
|
5
18
|
|
6
19
|
desc "all", "runs all your specs"
|
7
20
|
method_option :bundle, :type => :boolean, :aliases => "-b"
|
@@ -57,14 +70,14 @@ class Spec < Thor
|
|
57
70
|
def list(name = "*")
|
58
71
|
if options[:help]
|
59
72
|
puts "Available types for thor spec:list are"
|
60
|
-
|
73
|
+
available_types.each do |t|
|
61
74
|
puts " #{t}"
|
62
75
|
end
|
63
76
|
puts "Running thor spec:list without specifying a type will list all specs from all types."
|
64
77
|
return
|
65
78
|
end
|
66
79
|
|
67
|
-
paths = Dir["spec/#{name}/**/"].sort.reject { |p| p if !
|
80
|
+
paths = Dir["spec/#{name}/**/"].sort.reject { |p| p if !available_types.include?(p.split("/")[1]) }
|
68
81
|
paths.each do |p|
|
69
82
|
path = p.split("/")
|
70
83
|
l = path.length
|
data/lib/thor_tasks/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 8
|
9
|
+
version: 0.0.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Travis Haynes
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-06-
|
17
|
+
date: 2011-06-30 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|