public
Fork of KirinDave/fuzed
Description: A new revision of Fuzed, the Erlang-based frontend for web apps.
Clone URL: git://github.com/mojombo/fuzed.git
Search Repo:
Chassis uses details instead of packages
mojombo (author)
Fri May 02 23:14:59 -0700 2008
commit  a2147a174b058b9be1b7f3cc7eb1e84050daf5e3
tree    155e36cb77a112ef94f0215076203151594fd4ce
parent  683cba41580e5dade5f2577602f5234c7d10e5dd
...
1
2
3
4
5
6
7
8
...
44
45
46
47
48
49
50
51
 
 
52
53
54
55
 
 
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
72
73
74
...
419
420
421
422
423
 
424
425
426
...
616
617
618
619
620
621
622
 
623
624
625
...
650
651
652
653
654
655
656
 
657
658
659
...
1
2
 
3
4
5
6
7
...
43
44
45
 
 
 
 
 
46
47
48
49
 
 
50
51
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
54
55
56
...
401
402
403
 
 
404
405
406
407
...
597
598
599
 
 
 
 
600
601
602
603
...
628
629
630
 
 
 
 
631
632
633
634
0
@@ -1,6 +1,5 @@
0
 require 'rubygems'
0
 require 'optparse'
0
-require 'rpm_interface'
0
 require 'erlectricity'
0
 require 'json'
0
 
0
0
0
@@ -44,31 +43,14 @@
0
     Chassis.node_kind = name
0
   end
0
   
0
- # Specify package dependencies for the details list. If this is called
0
- # more than once, the first list that contains a full match for installed
0
- # packages will be used.
0
- # +names+ is a list of package names (their dependencies will be
0
- # traced automatically)
0
+ # Specify details that will be used for matching incoming requests
0
+ # +details+ is a Hash of primitives
0
   #
0
   # Returns nothing
0
- def self.packages(*names)
0
- return if !Chassis.pkgs.empty?
0
+ def self.details(details)
0
+ raise("details() has already been called") unless Chassis.pkgs.empty?
0
     
0
- fully_installed = names.all? do |package|
0
- Powerset::PowerPack.installed?(package)
0
- end
0
-
0
- if fully_installed
0
- deps = names.inject([]) do |acc, package|
0
- acc << package
0
- acc.concat Powerset::PowerPack.check(package).package_dependencies
0
- acc
0
- end
0
-
0
- packs = Powerset::PowerPack.check_packages(deps.uniq)
0
-
0
- Chassis.pkgs = packs.compact.map { |p| [p.name, self.limit_version(p.version)] }
0
- end
0
+ Chassis.pkgs = details.to_a
0
   end
0
   
0
   def self.config(&block)
0
@@ -419,8 +401,7 @@
0
   class Awesome < Chassis
0
     kind "awesome"
0
     
0
- packages "failboat"
0
- packages "powerset_ruby", "tk"
0
+ details "failboat" => "sinking"
0
     
0
     config do
0
       ["grammar", "/tmp/awesome.lfg"]
0
@@ -616,10 +597,7 @@
0
     # packages
0
     
0
     def test_packages
0
- packages = [["powerset_ruby", [1, 8, 5, 9999]],
0
- ["tk", [8, 4, 14, 0]],
0
- ["readline", [5, 1, 4, 0]],
0
- ["tcl", [8, 4, 14, 0]]]
0
+ packages = [["failboat", "sinking"]]
0
       assert_equal packages, Chassis.pkgs
0
     end
0
     
0
@@ -650,10 +628,7 @@
0
       ARGV.concat(["--tags=foo,bar", "--roles=production", "--", "--tags=baz,qux"])
0
       Chassis.pull_cli_args
0
       
0
- config = [["powerset_ruby", [1, 8, 5, 9999]],
0
- ["tk", [8, 4, 14, 0]],
0
- ["readline", [5, 1, 4, 0]],
0
- ["tcl", [8, 4, 14, 0]],
0
+ config = [["failboat", "sinking"],
0
                ["tags", "foo", "bar"],
0
                ["roles", "production"],
0
                ["kind", "awesome"],

Comments

    No one has commented yet.