Skip to content

Commit

Permalink
add dev path option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigish Patel committed Jul 10, 2012
1 parent c6ffc6b commit 9d2ddac
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/quilt.rb
Expand Up @@ -25,6 +25,7 @@ def initialize(config = "quilt", log = Logger.new(STDOUT))
config_prefix = config ? "#{config}:" : ""
@config = {
:local_path => Ecology.property("#{config_prefix}local_path", :as => String),
:dev_path => Ecology.property("#{config_prefix}dev_path", :as => String),
:remote_host => Ecology.property("#{config_prefix}remote_host", :as => String),
:remote_path => Ecology.property("#{config_prefix}remote_path", :as => String),
:remote_port => Ecology.property("#{config_prefix}remote_port", :as => String),
Expand Down Expand Up @@ -240,6 +241,9 @@ def resolve_dependancies(position, modules, version, all_modules = {})

def get_version(name)
return @versions[name] if @versions[name]
if (name == 'dev' && @config[:dev_path])
return load_version(@config[:dev_path], '')
end
# check local path
# sleep at most 10 seconds to wait until a version is fetched and untared
@@fetching_versions[name] ||= Mutex.new
Expand Down
2 changes: 1 addition & 1 deletion ruby-quilt.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'ruby-quilt'
s.version = '0.2.4'
s.version = '0.2.5'
s.summary = "A File stitcher"
s.description = "A file stitcher that maintains versions and can fetch additional versions from a server."
s.authors = ["Jigish Patel"]
Expand Down
1 change: 1 addition & 0 deletions test/mock/dev/1.js
@@ -0,0 +1 @@
1
1 change: 1 addition & 0 deletions test/mock/dev/2.js
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions test/mock/dev/3.js
@@ -0,0 +1 @@
3
1 change: 1 addition & 0 deletions test/mock/dev/4.js
@@ -0,0 +1 @@
4
1 change: 1 addition & 0 deletions test/mock/dev/5.js
@@ -0,0 +1 @@
5
1 change: 1 addition & 0 deletions test/mock/dev/6.js
@@ -0,0 +1 @@
6
1 change: 1 addition & 0 deletions test/mock/dev/7.js
@@ -0,0 +1 @@
7
1 change: 1 addition & 0 deletions test/mock/dev/8.js
@@ -0,0 +1 @@
8
1 change: 1 addition & 0 deletions test/mock/dev/9.js
@@ -0,0 +1 @@
9
1 change: 1 addition & 0 deletions test/mock/dev/common/c.js
@@ -0,0 +1 @@
c
1 change: 1 addition & 0 deletions test/mock/dev/common/c2.js
@@ -0,0 +1 @@
c2
1 change: 1 addition & 0 deletions test/mock/dev/f.js
@@ -0,0 +1 @@
f1.0.0
1 change: 1 addition & 0 deletions test/mock/dev/h.js
@@ -0,0 +1 @@
DEVh
20 changes: 20 additions & 0 deletions test/mock/dev/manifest.json
@@ -0,0 +1,20 @@
{
"header": "./h.js",
"footer": "./f.js",
"common": [
"./common/c.js",
{"./common/c2.js" : "before_common"}
],
"optional": {
"./optional/0.js": [ "8.js" ],
"./1.js": [ "7.js", "9.js" ],
"2.js": { "dependancies" : [ "8.js" ] },
"./3.js": [],
"./4.js": [],
"./5.js": { "dependancies" : [], "position" : "before_header"},
"./6.js": { "position" : "after_header"},
"./7.js": [],
"./8.js": [],
"./9.js": []
}
}
1 change: 1 addition & 0 deletions test/mock/dev/optional/0.js
@@ -0,0 +1 @@
0
3 changes: 2 additions & 1 deletion test/mock/ecologies/noremote.ecology
@@ -1,6 +1,7 @@
{
"quilt": {
"lru_size": 10,
"local_path": "./test/mock/good_project"
"local_path": "./test/mock/good_project",
"dev_path": "./test/mock/dev"
}
}
1 change: 1 addition & 0 deletions test/mock/ecologies/test.ecology
Expand Up @@ -2,6 +2,7 @@
"quilt": {
"lru_size": 10,
"local_path": "./test/mock/good_project",
"dev_path": "./test/mock/dev",
"remote_host": "localhost",
"remote_port": 1337,
"remote_path": "/"
Expand Down
3 changes: 3 additions & 0 deletions test/quilt_test.rb
Expand Up @@ -411,6 +411,9 @@ class QuiltTest < Scope::TestCase
:after_footer => '[af]'
})
end
should "properly stitch dev version" do
assert_equal "DEVh\nc2\nc\n8\n0\nf1.0.0\n", @quilt.stitch(['0.js'], 'dev')
end
end

context "health" do
Expand Down

0 comments on commit 9d2ddac

Please sign in to comment.