bpm 1.0.0.beta.6 → 1.0.0.beta.8
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/CHANGELOG.md +26 -0
- data/TODO.md +0 -3
- data/lib/bpm/cli/base.rb +3 -3
- data/lib/bpm/default.json +5 -1
- data/lib/bpm/errors.rb +8 -0
- data/lib/bpm/generator.rb +8 -0
- data/lib/bpm/init_generator.rb +1 -1
- data/lib/bpm/package.rb +113 -11
- data/lib/bpm/pipeline/format_processor.rb +28 -0
- data/lib/bpm/pipeline/generated_asset.rb +2 -2
- data/lib/bpm/pipeline/package_pipeline.rb +79 -0
- data/lib/bpm/pipeline/plugin_asset.rb +7 -8
- data/lib/bpm/pipeline/plugin_processor.rb +52 -0
- data/lib/bpm/pipeline.rb +89 -26
- data/lib/bpm/project.rb +55 -29
- data/lib/bpm/version.rb +1 -1
- data/lib/bpm.rb +3 -1
- data/spec/cli/list_spec.rb +1 -0
- data/spec/cli/pack_spec.rb +125 -103
- data/spec/fixtures/projects/coffee/coffee.json +17 -0
- data/spec/fixtures/projects/coffee/index.html.handlebars +1 -0
- data/spec/fixtures/projects/coffee/lib/main.coffee +1 -0
- data/spec/fixtures/projects/coffee/packages/coffee-script/compiler.js +4 -0
- data/spec/fixtures/projects/coffee/packages/coffee-script/lib/main.js +1 -0
- data/spec/fixtures/projects/coffee/packages/coffee-script/package.json +15 -0
- data/spec/fixtures/projects/coffee/packages/handlebars/format.js +6 -0
- data/spec/fixtures/projects/coffee/packages/handlebars/lib/main.js +2 -0
- data/spec/fixtures/projects/coffee/packages/handlebars/package.json +16 -0
- data/spec/fixtures/projects/coffee/packages/spade/lib/main.js +1 -0
- data/spec/fixtures/projects/coffee/packages/spade/package.json +14 -0
- data/spec/fixtures/projects/coffee/packages/spade/transport.js +3 -0
- data/spec/fixtures/projects/coffee/templates/section.handlebars +1 -0
- data/spec/fixtures/projects/minitrans/packages/transport/package.json +5 -1
- data/spec/fixtures/projects/transporter/packages/transport/package.json +5 -1
- data/spec/package_pipeline_spec.rb +30 -0
- data/spec/package_spec.rb +328 -316
- data/spec/plugins/format_spec.rb +38 -0
- data/spec/plugins/transport_spec.rb +1 -1
- data/spec/support/matchers.rb +1 -2
- metadata +57 -24
data/lib/bpm/project.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'set'
|
2
3
|
require 'bpm/version'
|
3
4
|
|
4
5
|
module BPM
|
@@ -49,7 +50,7 @@ module BPM
|
|
49
50
|
end
|
50
51
|
|
51
52
|
@name = name || File.basename(root_path)
|
52
|
-
@json_path = project_file
|
53
|
+
@json_path = project_file || File.join(root_path, "#{File.basename(root_path)}.json")
|
53
54
|
|
54
55
|
load_json && validate
|
55
56
|
end
|
@@ -88,8 +89,12 @@ module BPM
|
|
88
89
|
File.join([@root_path, BPM_DIR, 'packages', package_name].compact)
|
89
90
|
end
|
90
91
|
|
92
|
+
def assets_path
|
93
|
+
'assets'
|
94
|
+
end
|
95
|
+
|
91
96
|
def assets_root(*paths)
|
92
|
-
File.join @root_path,
|
97
|
+
File.join @root_path, assets_path, *paths
|
93
98
|
end
|
94
99
|
|
95
100
|
def preview_root(*paths)
|
@@ -174,7 +179,7 @@ module BPM
|
|
174
179
|
all_hard_deps = all_dependencies.merge(new_deps)
|
175
180
|
exp_deps = find_non_local_dependencies(all_hard_deps, true)
|
176
181
|
|
177
|
-
|
182
|
+
say "Fetching packages from remote..." if verbose
|
178
183
|
core_fetch_dependencies(exp_deps, verbose)
|
179
184
|
|
180
185
|
if development
|
@@ -187,7 +192,7 @@ module BPM
|
|
187
192
|
|
188
193
|
local_deps.each do |dep|
|
189
194
|
next if old_deps.find { |pkg| (pkg.name == dep.name) && (pkg.version == dep.version) }
|
190
|
-
|
195
|
+
say "Added #{development ? "development " : ""}package '#{dep.name}' (#{dep.version})"
|
191
196
|
end
|
192
197
|
|
193
198
|
save!
|
@@ -213,7 +218,7 @@ module BPM
|
|
213
218
|
|
214
219
|
old_deps.each do |dep|
|
215
220
|
next if local_deps.find { |pkg| (pkg.name == dep.name) && (pkg.version == dep.version) }
|
216
|
-
|
221
|
+
say "Removed package '#{dep.name}' (#{dep.version})"
|
217
222
|
end
|
218
223
|
|
219
224
|
save!
|
@@ -234,7 +239,7 @@ module BPM
|
|
234
239
|
# Get dependencies from server if not installed
|
235
240
|
|
236
241
|
def fetch_dependencies(verbose=false)
|
237
|
-
|
242
|
+
say "Fetching packages from remote..." if verbose
|
238
243
|
exp_deps = find_non_local_dependencies(all_dependencies, true)
|
239
244
|
core_fetch_dependencies(exp_deps, verbose)
|
240
245
|
end
|
@@ -246,7 +251,7 @@ module BPM
|
|
246
251
|
|
247
252
|
verify_and_repair mode, verbose
|
248
253
|
|
249
|
-
|
254
|
+
say "Building static assets..." if verbose
|
250
255
|
|
251
256
|
report_package_locations if verbose
|
252
257
|
|
@@ -264,7 +269,7 @@ module BPM
|
|
264
269
|
FileUtils.mkdir_p File.dirname(dst_path)
|
265
270
|
|
266
271
|
if asset.kind_of? Sprockets::StaticAsset
|
267
|
-
|
272
|
+
say "~ Copying #{asset.logical_path}" if verbose
|
268
273
|
FileUtils.rm dst_path if File.exists? dst_path
|
269
274
|
FileUtils.cp asset.pathname, dst_path
|
270
275
|
else
|
@@ -278,7 +283,7 @@ module BPM
|
|
278
283
|
end
|
279
284
|
end
|
280
285
|
|
281
|
-
|
286
|
+
say "\n" if verbose
|
282
287
|
end
|
283
288
|
|
284
289
|
|
@@ -286,7 +291,7 @@ module BPM
|
|
286
291
|
# package is removed from the project to cleanup any assets
|
287
292
|
|
288
293
|
def unbuild(verbose=false)
|
289
|
-
|
294
|
+
say "Removing stale assets..." if verbose
|
290
295
|
|
291
296
|
pipeline = BPM::Pipeline.new self
|
292
297
|
asset_root = File.join root_path, 'assets'
|
@@ -294,7 +299,7 @@ module BPM
|
|
294
299
|
next if asset.logical_path =~ /^bpm_/
|
295
300
|
asset_path = File.join asset_root, asset.logical_path
|
296
301
|
next unless File.exists? asset_path
|
297
|
-
|
302
|
+
say "~ Removing #{asset.logical_path}" if verbose
|
298
303
|
FileUtils.rm asset_path
|
299
304
|
|
300
305
|
# cleanup empty directories
|
@@ -302,12 +307,12 @@ module BPM
|
|
302
307
|
asset_path = File.dirname asset_path
|
303
308
|
FileUtils.rmdir(asset_path) if File.directory?(asset_path)
|
304
309
|
if verbose && !File.exists?(asset_path)
|
305
|
-
|
310
|
+
say "~ Removed empty directory #{File.basename asset_path}"
|
306
311
|
end
|
307
312
|
end
|
308
313
|
end
|
309
314
|
|
310
|
-
|
315
|
+
say "\n" if verbose
|
311
316
|
end
|
312
317
|
|
313
318
|
|
@@ -400,6 +405,12 @@ module BPM
|
|
400
405
|
@local_deps ||= build_local_dependency_list
|
401
406
|
end
|
402
407
|
|
408
|
+
def map_to_packages(deps)
|
409
|
+
Array(deps).map do |dep_name, vers|
|
410
|
+
local_deps.find { |x| x.name==dep_name }
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
403
414
|
# List of local dependency names in order of dependency
|
404
415
|
|
405
416
|
def sorted_deps
|
@@ -477,12 +488,23 @@ module BPM
|
|
477
488
|
|
478
489
|
def load_json
|
479
490
|
return super if has_json?
|
480
|
-
FIELDS.keys.each
|
491
|
+
(FIELDS.keys + %w(description summary homepage)).each do |f|
|
492
|
+
send("#{c2u(f)}=", DEFAULT_CONFIG[f])
|
493
|
+
end
|
494
|
+
|
481
495
|
self.name = File.basename(@json_path, '.json')
|
482
496
|
self.version = "0.0.1"
|
483
497
|
true
|
484
498
|
end
|
485
499
|
|
500
|
+
# Tell if package is vendored
|
501
|
+
|
502
|
+
def has_local_package?(package_name)
|
503
|
+
!!locate_local_package(package_name)
|
504
|
+
end
|
505
|
+
|
506
|
+
|
507
|
+
|
486
508
|
|
487
509
|
private
|
488
510
|
|
@@ -570,7 +592,7 @@ module BPM
|
|
570
592
|
end
|
571
593
|
|
572
594
|
installed.each do |i|
|
573
|
-
|
595
|
+
say "~ Fetched #{i.name} (#{i.version}) from remote" if verbose
|
574
596
|
end
|
575
597
|
|
576
598
|
end
|
@@ -595,13 +617,6 @@ module BPM
|
|
595
617
|
end
|
596
618
|
end
|
597
619
|
|
598
|
-
# Tell if package is vendored
|
599
|
-
|
600
|
-
def has_local_package?(package_name)
|
601
|
-
!!locate_local_package(package_name)
|
602
|
-
end
|
603
|
-
|
604
|
-
|
605
620
|
# Tell if given version is satisfied by the passed version
|
606
621
|
|
607
622
|
def satisfied_by?(req_vers, new_vers)
|
@@ -612,7 +627,7 @@ module BPM
|
|
612
627
|
|
613
628
|
|
614
629
|
# Get list of dependencies, searching only the project and fetched
|
615
|
-
# packages.
|
630
|
+
# packages. Raises if not found or
|
616
631
|
# conflicting.
|
617
632
|
def find_dependencies(deps=nil, verbose=false)
|
618
633
|
|
@@ -621,7 +636,11 @@ module BPM
|
|
621
636
|
search_list = Array(deps)
|
622
637
|
found = []
|
623
638
|
ret = []
|
624
|
-
|
639
|
+
|
640
|
+
# if we discover a new local package via indirect dependencies then
|
641
|
+
# it's dependencies will be fetchable one time.
|
642
|
+
fetchable = Set.new
|
643
|
+
|
625
644
|
until search_list.empty?
|
626
645
|
name, version = search_list.shift
|
627
646
|
|
@@ -632,17 +651,24 @@ module BPM
|
|
632
651
|
end
|
633
652
|
|
634
653
|
pkg = locate_package(name, version, verbose)
|
654
|
+
if pkg.nil? && fetchable.include?(name)
|
655
|
+
fetchable.reject! { |x| x == name }
|
656
|
+
core_fetch_dependency(name, version, :runtime, true)
|
657
|
+
pkg = locate_package name, version, verbose
|
658
|
+
end
|
659
|
+
|
635
660
|
raise PackageNotFoundError.new(name, version) unless pkg
|
636
661
|
|
637
662
|
found << pkg
|
638
663
|
|
639
664
|
# Look up dependencies of dependencies
|
640
|
-
|
641
|
-
search_list += Array(pkg.dependencies_build)
|
642
|
-
|
665
|
+
new_deps = Array(pkg.dependencies) + Array(pkg.dependencies_build)
|
643
666
|
if has_local_package? pkg.name
|
644
|
-
|
667
|
+
new_deps += Array(pkg.dependencies_development)
|
668
|
+
new_deps.each { |dep| fetchable.add dep.first }
|
645
669
|
end
|
670
|
+
|
671
|
+
search_list += new_deps
|
646
672
|
|
647
673
|
ret << pkg
|
648
674
|
end
|
@@ -685,7 +711,7 @@ module BPM
|
|
685
711
|
deps ||= local_deps
|
686
712
|
deps.each do |dep|
|
687
713
|
is_local = has_local_package?(dep.name) ? 'local' : 'fetched'
|
688
|
-
|
714
|
+
say "~ Using #{is_local} package '#{dep.name}' (#{dep.version})"
|
689
715
|
end
|
690
716
|
end
|
691
717
|
|
data/lib/bpm/version.rb
CHANGED
data/lib/bpm.rb
CHANGED
@@ -16,10 +16,12 @@ module BPM
|
|
16
16
|
autoload :Pipeline, 'bpm/pipeline'
|
17
17
|
autoload :DirectiveProcessor, 'bpm/pipeline/directive_processor'
|
18
18
|
autoload :GeneratedAsset, 'bpm/pipeline/generated_asset'
|
19
|
-
autoload :TransportProcessor, 'bpm/pipeline/transport_processor'
|
20
19
|
autoload :SourceURLProcessor, 'bpm/pipeline/source_url_processor'
|
21
20
|
autoload :PluginAsset, 'bpm/pipeline/plugin_asset'
|
22
21
|
autoload :PluginContext, 'bpm/pipeline/plugin_context'
|
22
|
+
autoload :PackagePipeline, 'bpm/pipeline/package_pipeline'
|
23
|
+
autoload :FormatProcessor, 'bpm/pipeline/format_processor'
|
24
|
+
autoload :PluginProcessor, 'bpm/pipeline/plugin_processor'
|
23
25
|
end
|
24
26
|
|
25
27
|
# The BPM constants need to be defined first
|
data/spec/cli/list_spec.rb
CHANGED
data/spec/cli/pack_spec.rb
CHANGED
@@ -1,118 +1,140 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "libgems/format"
|
3
3
|
|
4
|
-
describe "bpm pack
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
output = stdout.read
|
19
|
-
output.should include("Successfully built package: core-test-0.4.9.bpkg")
|
20
|
-
|
21
|
-
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
22
|
-
package.spec.name.should == "core-test"
|
23
|
-
package.spec.version.should == LibGems::Version.new("0.4.9")
|
24
|
-
package.spec.email.should == email
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "bpm pack without logging in" do
|
29
|
-
before do
|
30
|
-
goto_home
|
31
|
-
end
|
32
|
-
|
33
|
-
it "pack a bpm from a given package.json" do
|
34
|
-
FileUtils.cp_r package_fixture("core-test"), "."
|
35
|
-
cd "core-test"
|
36
|
-
bpm "pack", "-e", "joe@example.com"
|
37
|
-
|
38
|
-
exit_status.should be_success
|
4
|
+
describe "bpm pack" do
|
5
|
+
|
6
|
+
describe "when logged in" do
|
7
|
+
let(:email) { "who@example.com" }
|
8
|
+
|
9
|
+
before do
|
10
|
+
goto_home
|
11
|
+
write_creds(email, "deadbeef")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "builds a bpm from a given package.json" do
|
15
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
16
|
+
cd "core-test"
|
17
|
+
bpm "pack"
|
39
18
|
|
40
|
-
|
41
|
-
|
42
|
-
|
19
|
+
exit_status.should be_success
|
20
|
+
output = stdout.read
|
21
|
+
output.should include("Successfully built package: core-test-0.4.9.bpkg")
|
22
|
+
|
23
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
24
|
+
package.spec.name.should == "core-test"
|
25
|
+
package.spec.version.should == LibGems::Version.new("0.4.9")
|
26
|
+
package.spec.email.should == email
|
27
|
+
end
|
43
28
|
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
29
|
+
|
30
|
+
describe "without logging in" do
|
31
|
+
before do
|
32
|
+
goto_home
|
33
|
+
end
|
34
|
+
|
35
|
+
it "pack a bpm from a given package.json" do
|
36
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
37
|
+
cd "core-test"
|
38
|
+
bpm "pack", "-e", "joe@example.com"
|
39
|
+
|
40
|
+
exit_status.should be_success
|
41
|
+
|
42
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
43
|
+
package.spec.name.should == "core-test"
|
44
|
+
package.spec.version.should == LibGems::Version.new("0.4.9")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "builds a bpm when given a path to a package" do
|
48
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
49
|
+
bpm "pack", "core-test", "-e", "joe@example.com"
|
50
|
+
|
51
|
+
exit_status.should be_success
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
describe "bpm pack with an invalid package.json" do
|
73
|
-
before do
|
74
|
-
goto_home
|
75
|
-
write_api_key("deadbeef")
|
76
|
-
end
|
77
|
-
|
78
|
-
it "reports error messages" do
|
79
|
-
FileUtils.touch "package.json"
|
80
|
-
bpm "pack", :track_stderr => true
|
81
|
-
|
82
|
-
exit_status.should_not be_success
|
83
|
-
output = stderr.read
|
84
|
-
output.should include("There was a problem parsing package.json")
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe "bpm pack npm-compatible package" do
|
89
|
-
before do
|
90
|
-
FileUtils.cp_r package_fixture("backbone"), "."
|
91
|
-
cd "backbone"
|
92
|
-
bpm "pack", :track_stderr => true and wait
|
93
|
-
end
|
94
|
-
|
95
|
-
it "successfully packs" do
|
96
|
-
exit_status.should be_success
|
97
|
-
end
|
98
|
-
|
99
|
-
it "implies the summary field" do
|
100
|
-
package = LibGems::Format.from_file_by_path("backbone-0.5.1.bpkg")
|
101
|
-
package.spec.summary.should == package.spec.description
|
53
|
+
cd 'core-test'
|
54
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
55
|
+
package.spec.name.should == "core-test"
|
56
|
+
package.spec.version.should == LibGems::Version.new("0.4.9")
|
57
|
+
end
|
58
|
+
|
59
|
+
it "sets the email address if one is given" do
|
60
|
+
FileUtils.cp_r package_fixture("core-test"), "."
|
61
|
+
cd "core-test"
|
62
|
+
bpm "pack", "-e", "lucy@allen.com"
|
63
|
+
|
64
|
+
exit_status.should be_success
|
65
|
+
output = stdout.read
|
66
|
+
|
67
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
68
|
+
package.spec.name.should == "core-test"
|
69
|
+
package.spec.version.should == LibGems::Version.new("0.4.9")
|
70
|
+
package.spec.email.should == "lucy@allen.com"
|
71
|
+
end
|
102
72
|
end
|
103
73
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
74
|
+
describe "with an invalid package.json" do
|
75
|
+
before do
|
76
|
+
goto_home
|
77
|
+
write_api_key("deadbeef")
|
78
|
+
end
|
79
|
+
|
80
|
+
it "reports error messages" do
|
81
|
+
FileUtils.touch "package.json"
|
82
|
+
bpm "pack", :track_stderr => true
|
83
|
+
|
84
|
+
exit_status.should_not be_success
|
85
|
+
output = stderr.read
|
86
|
+
output.should include("There was a problem parsing package.json")
|
87
|
+
end
|
108
88
|
end
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
89
|
+
|
90
|
+
describe "npm-compatible package" do
|
91
|
+
before do
|
92
|
+
goto_home
|
93
|
+
FileUtils.cp_r package_fixture("backbone"), "."
|
94
|
+
cd home("backbone")
|
95
|
+
bpm "pack", :track_stderr => true and wait
|
96
|
+
end
|
97
|
+
|
98
|
+
it "successfully packs" do
|
99
|
+
exit_status.should be_success
|
100
|
+
end
|
101
|
+
|
102
|
+
it "implies the summary field" do
|
103
|
+
package = LibGems::Format.from_file_by_path("backbone-0.5.1.bpkg")
|
104
|
+
package.spec.summary.should == package.spec.description
|
105
|
+
end
|
106
|
+
|
107
|
+
it "gets name and version" do
|
108
|
+
package = LibGems::Format.from_file_by_path("backbone-0.5.1.bpkg")
|
109
|
+
package.spec.name.should == "backbone"
|
110
|
+
package.spec.version.should == LibGems::Version.new("0.5.1")
|
111
|
+
end
|
112
|
+
|
113
|
+
it "gets the homepage" do
|
114
|
+
package = LibGems::Format.from_file_by_path("backbone-0.5.1.bpkg")
|
115
|
+
package.spec.homepage.should == 'http://documentcloud.github.com/backbone/'
|
116
|
+
end
|
117
|
+
|
113
118
|
end
|
114
119
|
|
120
|
+
describe "package with plugins" do
|
121
|
+
before do
|
122
|
+
goto_home
|
123
|
+
FileUtils.cp_r project_fixture('coffee', 'packages'), '.'
|
124
|
+
end
|
115
125
|
|
126
|
+
it "should pack transports" do
|
127
|
+
cd home('packages', 'spade')
|
128
|
+
bpm "pack" and wait
|
129
|
+
puts stdout.read
|
130
|
+
exit_status.should be_success
|
131
|
+
|
132
|
+
package = LibGems::Format.from_file_by_path 'spade-1.0.0.bpkg'
|
133
|
+
package.spec.files.should include('lib/main.js')
|
134
|
+
package.spec.files.should include('transport.js')
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
116
138
|
end
|
117
139
|
|
118
140
|
|
@@ -0,0 +1 @@
|
|
1
|
+
{{INDEX}}
|
@@ -0,0 +1 @@
|
|
1
|
+
//coffee/lib/main
|
@@ -0,0 +1 @@
|
|
1
|
+
//coffee-script/lib/main
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "coffee-script",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "DESC",
|
5
|
+
"summary": "SUMMARY",
|
6
|
+
"author": "AUTHOR",
|
7
|
+
"homepage": "HOMEPAGE",
|
8
|
+
|
9
|
+
"bpm:provides": {
|
10
|
+
"format:coffee": {
|
11
|
+
"mime:default": "application/javascript",
|
12
|
+
"main": "coffee-script/compiler"
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "handlebars",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "DESC",
|
5
|
+
"summary": "SUMMARY",
|
6
|
+
"author": "AUTHOR",
|
7
|
+
"homepage": "HOMEPAGE",
|
8
|
+
|
9
|
+
"bpm:provides": {
|
10
|
+
"format:handlebars": {
|
11
|
+
"mime:default": "application/javascript",
|
12
|
+
"main": "handlebars/format"
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
//spade/lib/main
|
@@ -0,0 +1 @@
|
|
1
|
+
//coffee/templates/section
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BPM::PackagePipeline do
|
4
|
+
|
5
|
+
before do
|
6
|
+
goto_home
|
7
|
+
set_host
|
8
|
+
start_fake(FakeGemServer.new)
|
9
|
+
FileUtils.cp_r(project_fixture('coffee'), '.')
|
10
|
+
cd home('coffee')
|
11
|
+
end
|
12
|
+
|
13
|
+
subject do
|
14
|
+
project = BPM::Project.new home('coffee')
|
15
|
+
BPM::Pipeline.new project
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should get package pipelines for each package" do
|
19
|
+
names = subject.package_pipelines.map { |pipeline| pipeline.package.name }
|
20
|
+
names.sort.should == %w(coffee coffee-script handlebars spade)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should get an asset for the coffee file" do
|
24
|
+
asset = subject.find_asset 'coffee/lib/main.js'
|
25
|
+
asset.should_not be_nil
|
26
|
+
asset.pathname.should == home('coffee', 'lib', 'main.coffee')
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|