project 0.8.0 → 0.9.0
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/VERSION +1 -1
- data/lib/project/errors.rb +0 -3
- data/lib/project/loader.rb +1 -1
- data/lib/project/runner.rb +17 -4
- data/project.gemspec +1 -1
- data/readme.rdoc +25 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
data/lib/project/errors.rb
CHANGED
@@ -10,9 +10,6 @@ module Project
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class AbstractClassError < ProjectError; end
|
13
|
-
class MissingProjectKeyError < ProjectError; end
|
14
|
-
class MissingProjectError < ProjectError; end
|
15
|
-
class MissingWorkflowError < ProjectError; end
|
16
13
|
class MissingTemplateVariable < ProjectError; end
|
17
14
|
|
18
15
|
end
|
data/lib/project/loader.rb
CHANGED
data/lib/project/runner.rb
CHANGED
@@ -16,19 +16,32 @@ module Project
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def run!
|
19
|
-
|
19
|
+
say "* Opening project '#{self.key}' using workflow '#{self.project.workflow}'"
|
20
|
+
seperator
|
20
21
|
|
21
|
-
self.workflow.
|
22
|
+
self.workflow.each_with_index do |command, index|
|
22
23
|
command = Template.new(command, self.project).parse
|
24
|
+
output = %x[ #{command} ].chomp
|
23
25
|
|
24
|
-
|
26
|
+
unless output.empty?
|
27
|
+
say output
|
28
|
+
seperator unless index == (self.workflow.size - 1)
|
29
|
+
end
|
25
30
|
end
|
26
31
|
end
|
27
32
|
|
28
33
|
private
|
34
|
+
def say(*things)
|
35
|
+
$stdout.puts *things
|
36
|
+
end
|
37
|
+
|
29
38
|
def exit_with(message, code=1)
|
30
|
-
|
39
|
+
say message
|
31
40
|
Kernel.exit(code)
|
32
41
|
end
|
42
|
+
|
43
|
+
def seperator
|
44
|
+
say "", ("*" * 80), ""
|
45
|
+
end
|
33
46
|
end
|
34
47
|
end
|
data/project.gemspec
CHANGED
data/readme.rdoc
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
== Overview
|
11
11
|
|
12
|
-
|
12
|
+
Project aims to make working with multiple projects as simple as possible. By registering projects with workflows you can quickly create a set of commands that will be run against each project.
|
13
13
|
|
14
14
|
== Installation
|
15
15
|
|
@@ -17,11 +17,34 @@ The project is hosted on rubygems.org. Getting it is simple:
|
|
17
17
|
|
18
18
|
gem install project
|
19
19
|
|
20
|
-
|
20
|
+
Once the gem is installed run:
|
21
|
+
|
22
|
+
project install
|
23
|
+
|
24
|
+
Assuming you haven't already had the gem installed this will create a file at ~/.project. This is the main configuration file used to drive project.
|
21
25
|
|
22
26
|
== Usage
|
23
27
|
|
28
|
+
Project uses a YAML file for its configuration. Edit the file located in at ~/.project to you liking.
|
29
|
+
|
30
|
+
=== Projects
|
31
|
+
|
32
|
+
A project can be anything revolving around a particular context. A typical use would be opening your default environment surrounding a project. An example project configuration might look like this:
|
33
|
+
|
34
|
+
:name:
|
35
|
+
:path: /path/to/project
|
36
|
+
:workflow: default
|
37
|
+
|
38
|
+
The only required key within a project is *workflow*. This is important as you need to tell project which workflow to apply against the project. Any other variables specified here will be passed through to a workflow (more on this below).
|
39
|
+
|
40
|
+
==== Workflows
|
41
|
+
|
42
|
+
A workflow is a set of command you want run against a particular project. An example workflow might look something like this:
|
43
|
+
|
44
|
+
:default:
|
45
|
+
- cd %path
|
24
46
|
|
47
|
+
A workflow is just a YAML array of templated commands. Any variable used in a workflow will get looked up on the project that is running it. In the example above the %path variable has been replaced by the path variable specified within the project. Using this method you can quickly build up a set of common workflows to use against any project.
|
25
48
|
|
26
49
|
== Bugs
|
27
50
|
|