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 CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.9.0
@@ -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
@@ -1,5 +1,5 @@
1
- require 'fileutils'
2
1
  module Project
2
+ require 'fileutils'
3
3
  require 'yaml'
4
4
 
5
5
  class Loader
@@ -16,19 +16,32 @@ module Project
16
16
  end
17
17
 
18
18
  def run!
19
- $stdout.puts "* Opening project '#{self.key}' using workflow '#{self.project.workflow}'"
19
+ say "* Opening project '#{self.key}' using workflow '#{self.project.workflow}'"
20
+ seperator
20
21
 
21
- self.workflow.each do |command|
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
- %x[ #{command} ]
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
- $stdout.puts message
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{project}
8
- s.version = "0.8.0"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Nesbitt"]
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
- # Install notes
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
 
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 8
7
+ - 9
8
8
  - 0
9
- version: 0.8.0
9
+ version: 0.9.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josh Nesbitt