bpm 1.0.0.beta.6 → 1.0.0.beta.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/CHANGELOG.md +26 -0
  2. data/TODO.md +0 -3
  3. data/lib/bpm/cli/base.rb +3 -3
  4. data/lib/bpm/default.json +5 -1
  5. data/lib/bpm/errors.rb +8 -0
  6. data/lib/bpm/generator.rb +8 -0
  7. data/lib/bpm/init_generator.rb +1 -1
  8. data/lib/bpm/package.rb +113 -11
  9. data/lib/bpm/pipeline/format_processor.rb +28 -0
  10. data/lib/bpm/pipeline/generated_asset.rb +2 -2
  11. data/lib/bpm/pipeline/package_pipeline.rb +79 -0
  12. data/lib/bpm/pipeline/plugin_asset.rb +7 -8
  13. data/lib/bpm/pipeline/plugin_processor.rb +52 -0
  14. data/lib/bpm/pipeline.rb +89 -26
  15. data/lib/bpm/project.rb +55 -29
  16. data/lib/bpm/version.rb +1 -1
  17. data/lib/bpm.rb +3 -1
  18. data/spec/cli/list_spec.rb +1 -0
  19. data/spec/cli/pack_spec.rb +125 -103
  20. data/spec/fixtures/projects/coffee/coffee.json +17 -0
  21. data/spec/fixtures/projects/coffee/index.html.handlebars +1 -0
  22. data/spec/fixtures/projects/coffee/lib/main.coffee +1 -0
  23. data/spec/fixtures/projects/coffee/packages/coffee-script/compiler.js +4 -0
  24. data/spec/fixtures/projects/coffee/packages/coffee-script/lib/main.js +1 -0
  25. data/spec/fixtures/projects/coffee/packages/coffee-script/package.json +15 -0
  26. data/spec/fixtures/projects/coffee/packages/handlebars/format.js +6 -0
  27. data/spec/fixtures/projects/coffee/packages/handlebars/lib/main.js +2 -0
  28. data/spec/fixtures/projects/coffee/packages/handlebars/package.json +16 -0
  29. data/spec/fixtures/projects/coffee/packages/spade/lib/main.js +1 -0
  30. data/spec/fixtures/projects/coffee/packages/spade/package.json +14 -0
  31. data/spec/fixtures/projects/coffee/packages/spade/transport.js +3 -0
  32. data/spec/fixtures/projects/coffee/templates/section.handlebars +1 -0
  33. data/spec/fixtures/projects/minitrans/packages/transport/package.json +5 -1
  34. data/spec/fixtures/projects/transporter/packages/transport/package.json +5 -1
  35. data/spec/package_pipeline_spec.rb +30 -0
  36. data/spec/package_spec.rb +328 -316
  37. data/spec/plugins/format_spec.rb +38 -0
  38. data/spec/plugins/transport_spec.rb +1 -1
  39. data/spec/support/matchers.rb +1 -2
  40. metadata +57 -24
@@ -0,0 +1,38 @@
1
+ require "spec_helper"
2
+
3
+ describe BPM::Pipeline, 'format' do
4
+
5
+ before do
6
+ goto_home
7
+ set_host
8
+ reset_libgems bpm_dir.to_s
9
+ start_fake(FakeGemServer.new)
10
+
11
+ FileUtils.cp_r project_fixture('coffee'), '.'
12
+ cd home('coffee')
13
+
14
+ bpm 'rebuild'
15
+ wait
16
+ end
17
+
18
+ subject do
19
+ File.read home('coffee', 'assets', 'bpm_libs.js')
20
+ end
21
+
22
+ it "should compile coffee file and wrap with transport" do
23
+ subject.should include("spade(COFFEE(//coffee/lib/main\n))")
24
+ end
25
+
26
+ it "should compile handlebars template with transport" do
27
+ subject.should include("spade(HANDLEBARS(//coffee/templates/section\n RUNTIME))")
28
+ end
29
+
30
+ it "should include coffeescript runtime" do
31
+ subject.should include("//coffee-script/lib/main")
32
+ end
33
+
34
+ it "should include spade runtime" do
35
+ subject.should include("//spade/lib/main")
36
+ end
37
+
38
+ end
@@ -23,7 +23,7 @@ describe BPM::Pipeline, 'transport processor' do
23
23
  it "should wrap the project's main.js" do
24
24
  asset = subject.find_asset 'transporter/lib/main.js'
25
25
  exp_path = home('transporter', 'lib', 'main.js')
26
- asset.to_s.should == "define_transport(function() {\n//TRANSPORT\ntransporter();\n//TRANSPORT\n\n}), 'transporter', 'main', '#{exp_path}');\n\n"
26
+ asset.to_s.should == "define_transport(function() {\n//TRANSPORT\ntransporter();\n//TRANSPORT\n\n}), 'transporter', 'main', '#{exp_path}');"
27
27
  asset.pathname.to_s.should == File.join(Dir.pwd, 'lib', 'main.js')
28
28
  end
29
29
 
@@ -20,8 +20,7 @@ end
20
20
  RSpec::Matchers.define :have_error do |error|
21
21
  match do |package|
22
22
  package.valid? == false &&
23
- package.errors.size.should == 1 &&
24
- package.errors.first.include?(error) == true
23
+ package.errors.include?(error) == true
25
24
  end
26
25
  end
27
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.6
4
+ version: 1.0.0.beta.8
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-07-22 00:00:00.000000000Z
13
+ date: 2011-07-27 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: libgems
17
- requirement: &70197152775220 !ruby/object:Gem::Requirement
17
+ requirement: &70212473971080 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.0.5
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70197152775220
25
+ version_requirements: *70212473971080
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: gemcutter
28
- requirement: &70197152774720 !ruby/object:Gem::Requirement
28
+ requirement: &70212473970580 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.6.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70197152774720
36
+ version_requirements: *70212473970580
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: highline
39
- requirement: &70197152774260 !ruby/object:Gem::Requirement
39
+ requirement: &70212473970120 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.6.1
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70197152774260
47
+ version_requirements: *70212473970120
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: json_pure
50
- requirement: &70197152773800 !ruby/object:Gem::Requirement
50
+ requirement: &70212473969660 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.4.6
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70197152773800
58
+ version_requirements: *70212473969660
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: thor
61
- requirement: &70197152773340 !ruby/object:Gem::Requirement
61
+ requirement: &70212473969200 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 0.14.3
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70197152773340
69
+ version_requirements: *70212473969200
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: therubyracer
72
- requirement: &70197152772880 !ruby/object:Gem::Requirement
72
+ requirement: &70212473968740 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 0.9.2
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *70197152772880
80
+ version_requirements: *70212473968740
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: hike
83
- requirement: &70197152772420 !ruby/object:Gem::Requirement
83
+ requirement: &70212473968280 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '1.1'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *70197152772420
91
+ version_requirements: *70212473968280
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: rack
94
- requirement: &70197152771960 !ruby/object:Gem::Requirement
94
+ requirement: &70212473967820 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '1.0'
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *70197152771960
102
+ version_requirements: *70212473967820
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: tilt
105
- requirement: &70197152771460 !ruby/object:Gem::Requirement
105
+ requirement: &70212473967320 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -113,10 +113,10 @@ dependencies:
113
113
  version: 1.3.0
114
114
  type: :runtime
115
115
  prerelease: false
116
- version_requirements: *70197152771460
116
+ version_requirements: *70212473967320
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: rspec
119
- requirement: &70197152770820 !ruby/object:Gem::Requirement
119
+ requirement: &70212473966680 !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements:
122
122
  - - ! '>='
@@ -124,10 +124,10 @@ dependencies:
124
124
  version: '0'
125
125
  type: :development
126
126
  prerelease: false
127
- version_requirements: *70197152770820
127
+ version_requirements: *70212473966680
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: rack
130
- requirement: &70197152770280 !ruby/object:Gem::Requirement
130
+ requirement: &70212473966140 !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements:
133
133
  - - ~>
@@ -135,7 +135,7 @@ dependencies:
135
135
  version: 1.2.1
136
136
  type: :development
137
137
  prerelease: false
138
- version_requirements: *70197152770280
138
+ version_requirements: *70212473966140
139
139
  description: Browser Package Manager
140
140
  email:
141
141
  - charles@sproutcore.com
@@ -331,9 +331,12 @@ files:
331
331
  - lib/bpm/package.rb
332
332
  - lib/bpm/pipeline.rb
333
333
  - lib/bpm/pipeline/directive_processor.rb
334
+ - lib/bpm/pipeline/format_processor.rb
334
335
  - lib/bpm/pipeline/generated_asset.rb
336
+ - lib/bpm/pipeline/package_pipeline.rb
335
337
  - lib/bpm/pipeline/plugin_asset.rb
336
338
  - lib/bpm/pipeline/plugin_context.rb
339
+ - lib/bpm/pipeline/plugin_processor.rb
337
340
  - lib/bpm/pipeline/source_url_processor.rb
338
341
  - lib/bpm/pipeline/transport_processor.rb
339
342
  - lib/bpm/project.rb
@@ -591,6 +594,19 @@ files:
591
594
  - spec/fixtures/packages/uglify-js/package.json
592
595
  - spec/fixtures/packages/uglify-js/plugins/minifier.js
593
596
  - spec/fixtures/packages/uglify-js/uglify-js.js
597
+ - spec/fixtures/projects/coffee/coffee.json
598
+ - spec/fixtures/projects/coffee/index.html.handlebars
599
+ - spec/fixtures/projects/coffee/lib/main.coffee
600
+ - spec/fixtures/projects/coffee/packages/coffee-script/compiler.js
601
+ - spec/fixtures/projects/coffee/packages/coffee-script/lib/main.js
602
+ - spec/fixtures/projects/coffee/packages/coffee-script/package.json
603
+ - spec/fixtures/projects/coffee/packages/handlebars/format.js
604
+ - spec/fixtures/projects/coffee/packages/handlebars/lib/main.js
605
+ - spec/fixtures/projects/coffee/packages/handlebars/package.json
606
+ - spec/fixtures/projects/coffee/packages/spade/lib/main.js
607
+ - spec/fixtures/projects/coffee/packages/spade/package.json
608
+ - spec/fixtures/projects/coffee/packages/spade/transport.js
609
+ - spec/fixtures/projects/coffee/templates/section.handlebars
594
610
  - spec/fixtures/projects/custom_name/MyProject.json
595
611
  - spec/fixtures/projects/hello2/LICENSE
596
612
  - spec/fixtures/projects/hello2/README.md
@@ -663,8 +679,10 @@ files:
663
679
  - spec/fixtures/projects/transporter/packages/transport/transports/wrapper.js
664
680
  - spec/fixtures/projects/transporter/transporter.json
665
681
  - spec/gauntlet_spec.rb
682
+ - spec/package_pipeline_spec.rb
666
683
  - spec/package_spec.rb
667
684
  - spec/pipeline_spec.rb
685
+ - spec/plugins/format_spec.rb
668
686
  - spec/plugins/minifier_spec.rb
669
687
  - spec/plugins/transport_spec.rb
670
688
  - spec/project_spec.rb
@@ -940,6 +958,19 @@ test_files:
940
958
  - spec/fixtures/packages/uglify-js/package.json
941
959
  - spec/fixtures/packages/uglify-js/plugins/minifier.js
942
960
  - spec/fixtures/packages/uglify-js/uglify-js.js
961
+ - spec/fixtures/projects/coffee/coffee.json
962
+ - spec/fixtures/projects/coffee/index.html.handlebars
963
+ - spec/fixtures/projects/coffee/lib/main.coffee
964
+ - spec/fixtures/projects/coffee/packages/coffee-script/compiler.js
965
+ - spec/fixtures/projects/coffee/packages/coffee-script/lib/main.js
966
+ - spec/fixtures/projects/coffee/packages/coffee-script/package.json
967
+ - spec/fixtures/projects/coffee/packages/handlebars/format.js
968
+ - spec/fixtures/projects/coffee/packages/handlebars/lib/main.js
969
+ - spec/fixtures/projects/coffee/packages/handlebars/package.json
970
+ - spec/fixtures/projects/coffee/packages/spade/lib/main.js
971
+ - spec/fixtures/projects/coffee/packages/spade/package.json
972
+ - spec/fixtures/projects/coffee/packages/spade/transport.js
973
+ - spec/fixtures/projects/coffee/templates/section.handlebars
943
974
  - spec/fixtures/projects/custom_name/MyProject.json
944
975
  - spec/fixtures/projects/hello2/LICENSE
945
976
  - spec/fixtures/projects/hello2/README.md
@@ -1012,8 +1043,10 @@ test_files:
1012
1043
  - spec/fixtures/projects/transporter/packages/transport/transports/wrapper.js
1013
1044
  - spec/fixtures/projects/transporter/transporter.json
1014
1045
  - spec/gauntlet_spec.rb
1046
+ - spec/package_pipeline_spec.rb
1015
1047
  - spec/package_spec.rb
1016
1048
  - spec/pipeline_spec.rb
1049
+ - spec/plugins/format_spec.rb
1017
1050
  - spec/plugins/minifier_spec.rb
1018
1051
  - spec/plugins/transport_spec.rb
1019
1052
  - spec/project_spec.rb