project 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "project"
8
8
  gem.summary = "A streamlined approach to working with multiple projects and tasks."
9
- gem.description = ""
9
+ gem.description = "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."
10
10
  gem.email = "josh@josh-nesbitt.net"
11
11
  gem.homepage = "http://github.com/joshnesbitt/project"
12
12
  gem.authors = ["Josh Nesbitt"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.3
1
+ 1.0.0
data/lib/project.rb CHANGED
@@ -14,4 +14,5 @@ require 'project'
14
14
  require 'loader'
15
15
  require 'runner'
16
16
 
17
- Project::Loader.config_path(ENV["HOME"] + "/.project")
17
+ PROJECT_CONFIG = File.join(ENV["HOME"], '.project')
18
+ Project::Loader.config_path(PROJECT_CONFIG)
@@ -1,5 +1,3 @@
1
- # Core extensions
2
-
3
1
  class OpenStruct
4
2
 
5
3
  def [](key)
@@ -10,15 +10,25 @@ module Project
10
10
  path ? (@config_path = path) : @config_path
11
11
  end
12
12
  end
13
+ attr_reader :raw_config
14
+
15
+ def initialize
16
+ @template_path = File.join(ROOT, 'templates', 'example.yml')
17
+ end
13
18
 
14
19
  def load!
15
20
  if File.exists?(self.class.config_path)
16
- config = YAML.load_file(self.class.config_path)
17
- Project.load_from_hash(config[:projects]) unless config[:projects].nil?
18
- Workflow.load_from_hash(config[:workflows]) unless config[:workflows].nil?
21
+ @raw_config = YAML.load_file(self.class.config_path)
22
+
23
+ Project.load_from_hash(@raw_config[:projects]) unless @raw_config[:projects].nil?
24
+ Workflow.load_from_hash(@raw_config[:workflows]) unless @raw_config[:workflows].nil?
19
25
  else
20
- FileUtils.cp(ROOT + "/templates/example.yml", self.class.config_path, { :verbose => true })
21
- $stdout.puts "* No YAML file found at #{self.class.config_path}. One has been created for you, please edit it to your liking and try again."
26
+ FileUtils.cp(@template_path, self.class.config_path)
27
+
28
+ $stdout.puts "* No YAML configuration file found!",
29
+ "+ #{self.class.config_path}",
30
+ "* One has been created for you, please edit it to your liking and try again."
31
+
22
32
  Kernel.exit(1)
23
33
  end
24
34
  end
@@ -23,6 +23,10 @@ module Project
23
23
  end
24
24
  end
25
25
 
26
+ def clear_all
27
+ @store = {}
28
+ end
29
+
26
30
  protected
27
31
  def return_object(data)
28
32
  raise AbstractClassError, "this is an abstract class method and should not be called directly."
@@ -1,7 +1,7 @@
1
1
  module Project
2
2
  class Runner
3
3
  attr_accessor :key, :project, :workflow
4
-
4
+
5
5
  def initialize(key)
6
6
  exit_with "No project key given" if key.nil?
7
7
  self.key = key.chomp.to_sym
@@ -19,7 +19,7 @@ module Project
19
19
  say "* Opening project '#{self.key}' using workflow '#{self.project.workflow}'"
20
20
 
21
21
  self.workflow.each_with_index do |command, index|
22
- command = Template.new(command, self.project).parse
22
+ command = Template.new(command, self.project).parse!
23
23
  output = %x[ #{command} ].chomp
24
24
 
25
25
  unless output.empty?
@@ -1,22 +1,23 @@
1
1
  module Project
2
2
  class Template
3
3
  attr_accessor :subject, :replacements
4
- REGEX = /%([a-z|A-Z]*)?/
5
-
4
+ REGEX = /%([a-z|A-Z|_]*)?/
5
+
6
6
  def initialize(subject, replacements)
7
7
  self.subject = subject
8
8
  self.replacements = replacements
9
9
  end
10
-
11
- def parse
10
+
11
+ def parse!
12
12
  matches = self.subject.scan(REGEX)
13
13
  matches.flatten!
14
-
14
+
15
15
  matches.each do |match|
16
- raise MissingTemplateVariable, "No variable named %#{match} was specified in the project #{self.key}" if replacements[match].nil?
17
- self.subject.gsub!("%#{match}", replacements[match])
16
+ replacement = replacements[match.to_sym]
17
+ raise MissingTemplateVariable, "No variable named %#{match} was found on the specified project." if replacement.nil?
18
+ self.subject.gsub!("%#{match}", replacement)
18
19
  end
19
-
20
+
20
21
  self.subject
21
22
  end
22
23
  end
@@ -1,7 +1,7 @@
1
1
  module Project
2
2
  class Workflow < Lookup
3
3
  class << self
4
-
4
+
5
5
  protected
6
6
  def return_object(data)
7
7
  data
data/project.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{project}
8
- s.version = "0.9.3"
8
+ s.version = "1.0.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"]
12
- s.date = %q{2010-08-19}
13
- s.description = %q{}
12
+ s.date = %q{2010-08-21}
13
+ s.description = %q{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.}
14
14
  s.email = %q{josh@josh-nesbitt.net}
15
15
  s.executables = ["project", "project"]
16
16
  s.extra_rdoc_files = [
@@ -32,8 +32,15 @@ Gem::Specification.new do |s|
32
32
  "lib/project/template.rb",
33
33
  "lib/project/workflow.rb",
34
34
  "project.gemspec",
35
- "readme.rdoc",
35
+ "readme.textile",
36
+ "spec/fixtures/config.yml",
37
+ "spec/lib/core_ext_spec.rb",
38
+ "spec/lib/errors_spec.rb",
39
+ "spec/lib/loader_spec.rb",
36
40
  "spec/lib/lookup_spec.rb",
41
+ "spec/lib/project_spec.rb",
42
+ "spec/lib/template_spec.rb",
43
+ "spec/lib/workflow_spec.rb",
37
44
  "spec/spec_helper.rb",
38
45
  "spec/watch.rb",
39
46
  "templates/example.yml"
@@ -41,10 +48,16 @@ Gem::Specification.new do |s|
41
48
  s.homepage = %q{http://github.com/joshnesbitt/project}
42
49
  s.rdoc_options = ["--charset=UTF-8"]
43
50
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.6}
51
+ s.rubygems_version = %q{1.3.7}
45
52
  s.summary = %q{A streamlined approach to working with multiple projects and tasks.}
46
53
  s.test_files = [
47
- "spec/lib/lookup_spec.rb",
54
+ "spec/lib/core_ext_spec.rb",
55
+ "spec/lib/errors_spec.rb",
56
+ "spec/lib/loader_spec.rb",
57
+ "spec/lib/lookup_spec.rb",
58
+ "spec/lib/project_spec.rb",
59
+ "spec/lib/template_spec.rb",
60
+ "spec/lib/workflow_spec.rb",
48
61
  "spec/spec_helper.rb",
49
62
  "spec/watch.rb"
50
63
  ]
@@ -53,7 +66,7 @@ Gem::Specification.new do |s|
53
66
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
67
  s.specification_version = 3
55
68
 
56
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
69
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
70
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
58
71
  else
59
72
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
data/readme.textile ADDED
@@ -0,0 +1,114 @@
1
+ h1. Project
2
+
3
+ * Overview
4
+ * Installation
5
+ * Usage
6
+ * Bugs
7
+ * Note on Patches/Pull Requests
8
+
9
+
10
+
11
+ h2. Overview
12
+
13
+ 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.
14
+
15
+
16
+
17
+ h2. Installation
18
+
19
+ The project is hosted on "rubygems.org":http://rubygems.org. Getting it is simple:
20
+
21
+ pre. gem install project
22
+
23
+ Once the gem is installed run:
24
+
25
+ pre. project install
26
+
27
+ 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.
28
+
29
+
30
+
31
+ h2. Usage
32
+
33
+ Project uses a YAML file for its configuration. Edit the file located in at @~/.project@ to you liking.
34
+
35
+
36
+
37
+ h3. Projects
38
+
39
+ A project can be anything revolving around a particular context. A typical use case would be opening your default environment for a project. An example project configuration might look like this:
40
+
41
+ pre. :name:
42
+ :path: /path/to/project
43
+ :workflow: default
44
+
45
+ The only required key within a project is *workflow*. This is important as you need to tell the @project@ binary which workflow to apply against the project. Any other variables specified here will be passed through to a workflow (more on this below).
46
+
47
+
48
+
49
+ h3. Workflows
50
+
51
+ A workflow is a set of commands you want run against a particular project. An example workflow might look something like this:
52
+
53
+ pre. :default:
54
+ - mate %path
55
+ - cd %path && gitx
56
+
57
+ Which translates to:
58
+
59
+ * @mate /path/to/project@
60
+ * @cd /path/to/project && gitx@
61
+
62
+ A workflow is just a YAML array of templated commands. Any variable used in a workflow will get looked up on the project that's running it. In the example above the @%path@ variable is replaced by the path specified within the project. Using this method you can quickly build up a set of common workflows to use against many projects.
63
+
64
+ At the moment each command within a workflow is run inside it's own sub shell. This means that *every command is isolated from other commands within the same workflow*, so instead of doing two commands as @cd /some/path@ and @rake@ you would do @cd /some/path && rake@.
65
+
66
+ My default workflow looks something like this:
67
+
68
+ pre. :default:
69
+ - mate %path
70
+ - cd %path && gitx
71
+ - open 'http://%basecamp_url'
72
+ - open 'http://%app'
73
+ - cd %path && rails server
74
+
75
+ Which:
76
+
77
+ * opens a project in Textmate
78
+ * opens it's Git history
79
+ * opens the Basecamp project for the app
80
+ * starts the Rails server (and opens it up in the default browser)
81
+
82
+ *Note:* at the moment commands do not support being daemonised, hence why the call to @rails server@ is the last command executed.
83
+
84
+
85
+
86
+ h3. Running a project
87
+
88
+ Running a project is simple, just specify the name of the project you want to load and the workflow will run for it:
89
+
90
+ pre. project name
91
+
92
+
93
+
94
+ h2. Bugs
95
+
96
+ If you have any problems with Project, please file an "issue":http://github.com/joshnesbitt/project/issues.
97
+
98
+
99
+
100
+ h2. Note on Patches/Pull Requests
101
+
102
+ * Fork the project.
103
+ * Make your feature addition or bug fix.
104
+ * Add tests for it. This is important so I don't break it in a
105
+ future version unintentionally.
106
+ * Commit, do not mess with rakefile, version, or history.
107
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
108
+ * Send me a pull request. Bonus points for topic branches.
109
+
110
+
111
+
112
+ h2. Author
113
+
114
+ Josh Nesbitt / "josh@josh-nesbitt.net":mailto:josh@josh-nesbitt.net / "josh-nesbitt.net":http://josh-nesbitt.net
@@ -0,0 +1,7 @@
1
+ :workflows:
2
+ :default:
3
+ - mate %path
4
+ :projects:
5
+ :example:
6
+ :path: /a/path
7
+ :workflow: default
@@ -0,0 +1,13 @@
1
+ module Project
2
+ describe OpenStruct do
3
+
4
+ before do
5
+ @struct = OpenStruct.new(:one => "one", :two => "two", :three => "three")
6
+ end
7
+
8
+ it "should provide [] as an interface to the OpenStructs' attributes" do
9
+ @struct[:one].should == @struct.one # one
10
+ @struct[:four].should == @struct.four # nil
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ module Project
2
+ describe ProjectError do
3
+
4
+ it "should have a base error class" do
5
+ error = ProjectError.new("Error data")
6
+ error.data.should == "Error data"
7
+
8
+ ProjectError.ancestors.should include(StandardError)
9
+ end
10
+
11
+ it "should have the correct error classes available" do
12
+ data = "Error Data"
13
+
14
+ [ProjectError, AbstractClassError, MissingTemplateVariable].each do |klass|
15
+ error = klass.new(data)
16
+ error.data.should == data
17
+ klass.ancestors.should include(StandardError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,37 @@
1
+ module Project
2
+ describe Loader do
3
+
4
+ before do
5
+ @config_path = File.join(ROOT, 'spec', 'fixtures', 'config.yml')
6
+ Loader.config_path(@config_path)
7
+ end
8
+
9
+ it "should allow a config path to be set" do
10
+ path = "/my/path/.project"
11
+ Loader.config_path(path)
12
+ Loader.config_path.should == path
13
+ end
14
+
15
+ it "should create a configuration file on #load! if one does not exist" do
16
+ FileUtils.rm(@config_path) if File.exists?(@config_path)
17
+ File.exists?(@config_path).should == false
18
+
19
+ loader = Loader.new
20
+ lambda { loader.load! }.should raise_error(SystemExit)
21
+
22
+ File.exists?(@config_path).should == true
23
+ end
24
+
25
+ it "should load Project and Workflow configurations if a configuration exists" do
26
+ loader = Loader.new
27
+
28
+ unless File.exists?(@config_path)
29
+ lambda { loader.load! }.should raise_error(SystemExit)
30
+ File.exists?(@config_path).should == true
31
+ end
32
+
33
+ loader.load!
34
+ loader.raw_config.should_not be_nil
35
+ end
36
+ end
37
+ end
@@ -2,7 +2,18 @@ module Project
2
2
  describe Lookup do
3
3
 
4
4
  before do
5
- @data = { :age => 20 }
5
+ Lookup.clear_all
6
+
7
+ @data = {
8
+ :one => {
9
+ :workflow => :default,
10
+ :path => "/one/two/three"
11
+ },
12
+ :two => {
13
+ :workflow => :other,
14
+ :path => "/one/two/three/four"
15
+ }
16
+ }
6
17
  end
7
18
 
8
19
  it "should use a hash as a lookup object" do
@@ -10,14 +21,30 @@ module Project
10
21
  end
11
22
 
12
23
  it "should set a lookup key correctly" do
24
+ Lookup.set(:one, @data[:one])
25
+ Lookup.store[:one].should == @data[:one]
26
+ end
27
+
28
+ it "raise an abstract class error on trying to get a key directly from the Lookup class" do
29
+ Lookup.set(:one, @data[:one])
30
+ lambda { Lookup.get(:one) }.should raise_error(AbstractClassError)
31
+ end
32
+
33
+ it "should load a configuration from a hash" do
34
+ Lookup.load_from_hash(@data)
35
+ Lookup.store[:one].should == @data[:one]
13
36
 
14
- Lookup.set(:bob, @data)
15
- Lookup.store[:bob].should == @data
37
+ @data[:one].each_pair do |k, v|
38
+ Lookup.store[:one][k].should == v
39
+ end
16
40
  end
17
41
 
18
- it "raise an abstract class error on trying to get a key" do
19
- Lookup.set(:bob, @data)
20
- lambda { Lookup.get(:bob) }.should raise_error(AbstractClassError)
42
+ it "should support wiping the entire lookups' content" do
43
+ Lookup.store.should == {}
44
+ Lookup.load_from_hash(@data)
45
+ Lookup.store.should_not be_empty
46
+ Lookup.clear_all
47
+ Lookup.store.should be_empty
21
48
  end
22
49
  end
23
50
  end
@@ -0,0 +1,41 @@
1
+ module Project
2
+ describe Project do
3
+
4
+ before do
5
+ Project.clear_all
6
+
7
+ @data = {
8
+ :one => {
9
+ :workflow => :default,
10
+ :path => "/one/two/three"
11
+ },
12
+ :two => {
13
+ :workflow => :other,
14
+ :path => "/one/two/three/four"
15
+ }
16
+ }
17
+ end
18
+
19
+ it "should set a project" do
20
+ Project.set(:one, @data[:one])
21
+ Project.store[:one].should == @data[:one]
22
+ end
23
+
24
+ it "should get a projects data" do
25
+ Project.set(:one, @data[:one])
26
+ Project.get(:one).should == OpenStruct.new(@data[:one])
27
+ end
28
+
29
+ it "should load a configuration from a hash" do
30
+ Project.load_from_hash(@data)
31
+ Project.get(:one).should == OpenStruct.new(@data[:one])
32
+ end
33
+
34
+ it "should return an OpenStruct object as a keys data" do
35
+ Project.set(:one, @data[:one])
36
+
37
+ Project.get(:one).class.should == OpenStruct
38
+ Project.get(:one).should == OpenStruct.new(@data[:one])
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,25 @@
1
+ module Project
2
+ describe Template do
3
+
4
+ it "should successfully replace a strings variables with the replacements given" do
5
+ subject = "cd %path && echo '%text' && echo '%other_var'"
6
+ replacements = {
7
+ :path => "/some/path",
8
+ :text => "hello there",
9
+ :other_var => "something"
10
+ }
11
+
12
+ template = Template.new(subject, replacements)
13
+ result = template.parse!
14
+ result.should == "cd /some/path && echo 'hello there' && echo 'something'"
15
+ end
16
+
17
+ it "should raise an error on replacing a value that doesnt exist" do
18
+ subject = "cd %path"
19
+ replacements = {}
20
+
21
+ template = Template.new(subject, replacements)
22
+ lambda { template.parse! }.should raise_error(MissingTemplateVariable, "No variable named %path was found on the specified project.")
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,35 @@
1
+ module Project
2
+ describe Workflow do
3
+
4
+ before do
5
+ Workflow.clear_all
6
+
7
+ @data = {
8
+ :one => ['one', 'two', 'three'],
9
+ :two => ['one', 'two', 'three', 'four']
10
+ }
11
+ end
12
+
13
+ it "should set a workflow" do
14
+ Workflow.set(:one, @data[:one])
15
+ Workflow.store[:one].should == @data[:one]
16
+ end
17
+
18
+ it "should get a workflows data" do
19
+ Workflow.set(:one, @data[:one])
20
+ Workflow.get(:one).should == @data[:one]
21
+ end
22
+
23
+ it "should load a configuration from a hash" do
24
+ Workflow.load_from_hash(@data)
25
+ Workflow.get(:one).should == @data[:one]
26
+ end
27
+
28
+ it "should return an Array object as a keys data" do
29
+ Workflow.set(:one, @data[:one])
30
+
31
+ Workflow.get(:one).class.should == Array
32
+ Workflow.get(:one).should == @data[:one]
33
+ end
34
+ end
35
+ end
data/spec/spec_helper.rb CHANGED
@@ -2,3 +2,6 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'project'
4
4
  require 'spec'
5
+
6
+ # Silence output
7
+ $stdout = StringIO.new
metadata CHANGED
@@ -3,10 +3,10 @@ name: project
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
- - 9
8
- - 3
9
- version: 0.9.3
8
+ - 0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josh Nesbitt
@@ -14,13 +14,14 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-19 00:00:00 +01:00
17
+ date: 2010-08-21 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
24
25
  requirements:
25
26
  - - ">="
26
27
  - !ruby/object:Gem::Version
@@ -31,7 +32,7 @@ dependencies:
31
32
  version: 1.2.9
32
33
  type: :development
33
34
  version_requirements: *id001
34
- description: ""
35
+ description: 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.
35
36
  email: josh@josh-nesbitt.net
36
37
  executables:
37
38
  - project
@@ -56,8 +57,15 @@ files:
56
57
  - lib/project/template.rb
57
58
  - lib/project/workflow.rb
58
59
  - project.gemspec
59
- - readme.rdoc
60
+ - readme.textile
61
+ - spec/fixtures/config.yml
62
+ - spec/lib/core_ext_spec.rb
63
+ - spec/lib/errors_spec.rb
64
+ - spec/lib/loader_spec.rb
60
65
  - spec/lib/lookup_spec.rb
66
+ - spec/lib/project_spec.rb
67
+ - spec/lib/template_spec.rb
68
+ - spec/lib/workflow_spec.rb
61
69
  - spec/spec_helper.rb
62
70
  - spec/watch.rb
63
71
  - templates/example.yml
@@ -71,6 +79,7 @@ rdoc_options:
71
79
  require_paths:
72
80
  - lib
73
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
74
83
  requirements:
75
84
  - - ">="
76
85
  - !ruby/object:Gem::Version
@@ -78,6 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
87
  - 0
79
88
  version: "0"
80
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
81
91
  requirements:
82
92
  - - ">="
83
93
  - !ruby/object:Gem::Version
@@ -87,11 +97,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
97
  requirements: []
88
98
 
89
99
  rubyforge_project:
90
- rubygems_version: 1.3.6
100
+ rubygems_version: 1.3.7
91
101
  signing_key:
92
102
  specification_version: 3
93
103
  summary: A streamlined approach to working with multiple projects and tasks.
94
104
  test_files:
105
+ - spec/lib/core_ext_spec.rb
106
+ - spec/lib/errors_spec.rb
107
+ - spec/lib/loader_spec.rb
95
108
  - spec/lib/lookup_spec.rb
109
+ - spec/lib/project_spec.rb
110
+ - spec/lib/template_spec.rb
111
+ - spec/lib/workflow_spec.rb
96
112
  - spec/spec_helper.rb
97
113
  - spec/watch.rb
data/readme.rdoc DELETED
@@ -1,87 +0,0 @@
1
- = Project
2
-
3
- * Overview
4
- * Installation
5
- * Usage
6
- * Bugs
7
- * Note on Patches/Pull Requests
8
-
9
-
10
-
11
- == Overview
12
-
13
- 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.
14
-
15
-
16
-
17
- == Installation
18
-
19
- The project is hosted on rubygems.org. Getting it is simple:
20
-
21
- gem install project
22
-
23
- Once the gem is installed run:
24
-
25
- project install
26
-
27
- 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.
28
-
29
-
30
-
31
- == Usage
32
-
33
- Project uses a YAML file for its configuration. Edit the file located in at ~/.project to you liking.
34
-
35
-
36
-
37
- === Projects
38
-
39
- A project can be anything revolving around a particular context. A typical use case would be opening your default environment surrounding a particular project. An example project configuration might look like this:
40
-
41
- :name:
42
- :path: /path/to/project
43
- :workflow: default
44
-
45
- 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).
46
-
47
-
48
-
49
- ==== Workflows
50
-
51
- A workflow is a set of commands you want run against a particular project. An example workflow might look something like this:
52
-
53
- :default:
54
- - cd %path
55
-
56
- 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 specified within the project. Using this method you can quickly build up a set of common workflows to use against any project.
57
-
58
-
59
- === Running a project
60
-
61
- Running a project is simple, just specify the name of the project you want to load and the workflow will run for it:
62
-
63
- project name
64
-
65
-
66
-
67
- == Bugs
68
-
69
- If you have any problems with Project, please file an issue at http://github.com/joshnesbitt/project/issues.
70
-
71
-
72
-
73
- == Note on Patches/Pull Requests
74
-
75
- * Fork the project.
76
- * Make your feature addition or bug fix.
77
- * Add tests for it. This is important so I don't break it in a
78
- future version unintentionally.
79
- * Commit, do not mess with rakefile, version, or history.
80
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
81
- * Send me a pull request. Bonus points for topic branches.
82
-
83
-
84
-
85
- == Copyright
86
-
87
- Copyright (c) 2010 Josh Nesbitt <josh@josh-nesbitt.net>. See LICENSE for details.