bpm 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/Gemfile +0 -13
- data/TODO.md +1 -0
- data/bpm.gemspec +8 -3
- data/lib/bpm/cli/base.rb +22 -20
- data/lib/bpm/generator.rb +3 -3
- data/lib/bpm/libgems_ext/dependency_installer.rb +4 -4
- data/lib/bpm/libgems_ext/installer.rb +1 -1
- data/lib/bpm/package.rb +13 -9
- data/lib/bpm/pipeline/generated_asset.rb +30 -3
- data/lib/bpm/pipeline/transport_processor.rb +20 -12
- data/lib/bpm/pipeline.rb +17 -9
- data/lib/bpm/project.rb +42 -10
- data/lib/bpm/server.rb +5 -0
- data/lib/bpm/version.rb +1 -1
- data/lib/bpm.rb +2 -0
- data/lib/vendored_sprockets.rb +7 -0
- data/spec/cli/add_spec.rb +40 -37
- data/spec/cli/build_spec.rb +5 -5
- data/spec/cli/new_spec.rb +49 -23
- data/spec/cli/push_spec.rb +5 -5
- data/spec/cli/unpack_spec.rb +14 -14
- data/spec/fixtures/{badrake-0.8.7.spd → badrake-0.8.7.bpkg} +0 -0
- data/spec/fixtures/{builder-3.0.0.spd → builder-3.0.0.bpkg} +0 -0
- data/spec/fixtures/{bundler-1.1.pre.spd → bundler-1.1.pre.bpkg} +0 -0
- data/spec/fixtures/{coffee-1.0.1.pre.spd → coffee-1.0.1.pre.bpkg} +0 -0
- data/spec/fixtures/{core-test-0.4.9.spd → core-test-0.4.9.bpkg} +0 -0
- data/spec/fixtures/{custom_generator-1.0.spd → custom_generator-1.0.bpkg} +0 -0
- data/spec/fixtures/custom_name/MyProject.json +4 -0
- data/spec/fixtures/hello_world/css/dummy.css +3 -0
- data/spec/fixtures/{highline-1.6.1.spd → highline-1.6.1.bpkg} +0 -0
- data/spec/fixtures/{ivory-0.0.1.spd → ivory-0.0.1.bpkg} +0 -0
- data/spec/fixtures/{jquery-1.4.3.spd → jquery-1.4.3.bpkg} +0 -0
- data/spec/fixtures/minitest/assets/bpm_packages.js +1 -0
- data/spec/fixtures/minitest/assets/bpm_styles.css +0 -0
- data/spec/fixtures/minitest/assets/minitest/app_package.js +1 -0
- data/spec/fixtures/minitest/lib/main.js +1 -0
- data/spec/fixtures/minitest/minitest.json +22 -0
- data/spec/fixtures/minitest/packages/uglyduck/lib/main.js +1 -0
- data/spec/fixtures/minitest/packages/uglyduck/minifier/main.js +4 -0
- data/spec/fixtures/minitest/packages/uglyduck/package.json +21 -0
- data/spec/fixtures/{optparse-1.0.1.spd → optparse-1.0.1.bpkg} +0 -0
- data/spec/fixtures/{rake-0.8.6.spd → rake-0.8.6.bpkg} +0 -0
- data/spec/fixtures/{rake-0.8.7.spd → rake-0.8.7.bpkg} +0 -0
- data/spec/fixtures/{spade-0.5.0.spd → spade-0.5.0.bpkg} +0 -0
- data/spec/fixtures/transporter/packages/transport/lib/main.js +1 -0
- data/spec/fixtures/transporter/packages/transport/package.json +1 -1
- data/spec/fixtures/transporter/packages/transport/transports/wrapper.js +5 -0
- data/spec/gauntlet_spec.rb +2 -2
- data/spec/package_spec.rb +3 -3
- data/spec/pipeline_spec.rb +175 -54
- data/spec/project_spec.rb +19 -3
- data/spec/support/fake_gem_server.rb +4 -4
- data/templates/init/project.json +3 -1
- data/templates/project/index.html +1 -1
- data/vendor/sprockets/.gitignore +7 -0
- data/vendor/sprockets/.travis.yml +6 -0
- data/vendor/sprockets/Gemfile +8 -0
- data/vendor/sprockets/LICENSE +20 -0
- data/vendor/sprockets/README.md +22 -0
- data/vendor/sprockets/Rakefile +8 -0
- data/vendor/sprockets/lib/sprockets/asset.rb +203 -0
- data/vendor/sprockets/lib/sprockets/asset_attributes.rb +161 -0
- data/vendor/sprockets/lib/sprockets/base.rb +147 -0
- data/vendor/sprockets/lib/sprockets/bundled_asset.rb +222 -0
- data/vendor/sprockets/lib/sprockets/cache/file_store.rb +41 -0
- data/vendor/sprockets/lib/sprockets/caching.rb +121 -0
- data/vendor/sprockets/lib/sprockets/charset_normalizer.rb +41 -0
- data/vendor/sprockets/lib/sprockets/context.rb +191 -0
- data/vendor/sprockets/lib/sprockets/digest.rb +73 -0
- data/vendor/sprockets/lib/sprockets/directive_processor.rb +380 -0
- data/vendor/sprockets/lib/sprockets/eco_template.rb +39 -0
- data/vendor/sprockets/lib/sprockets/ejs_template.rb +38 -0
- data/vendor/sprockets/lib/sprockets/engines.rb +92 -0
- data/vendor/sprockets/lib/sprockets/environment.rb +93 -0
- data/vendor/sprockets/lib/sprockets/errors.rb +17 -0
- data/vendor/sprockets/lib/sprockets/index.rb +80 -0
- data/vendor/sprockets/lib/sprockets/jst_processor.rb +26 -0
- data/vendor/sprockets/lib/sprockets/processing.rb +310 -0
- data/vendor/sprockets/lib/sprockets/processor.rb +32 -0
- data/vendor/sprockets/lib/sprockets/safety_colons.rb +28 -0
- data/vendor/sprockets/lib/sprockets/server.rb +270 -0
- data/vendor/sprockets/lib/sprockets/static_asset.rb +87 -0
- data/vendor/sprockets/lib/sprockets/static_compilation.rb +82 -0
- data/vendor/sprockets/lib/sprockets/trail.rb +122 -0
- data/vendor/sprockets/lib/sprockets/utils.rb +67 -0
- data/vendor/sprockets/lib/sprockets/version.rb +3 -0
- data/vendor/sprockets/lib/sprockets.rb +31 -0
- data/vendor/sprockets/sprockets.gemspec +30 -0
- data/vendor/sprockets/test/fixtures/asset/POW.png +0 -0
- data/vendor/sprockets/test/fixtures/asset/application.js +6 -0
- data/vendor/sprockets/test/fixtures/asset/bar-utf8.css +2 -0
- data/vendor/sprockets/test/fixtures/asset/charset.css +2 -0
- data/vendor/sprockets/test/fixtures/asset/circle/a.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/circle/b.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/circle/c.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/compat.js +4 -0
- data/vendor/sprockets/test/fixtures/asset/constants.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/constants.yml +1 -0
- data/vendor/sprockets/test/fixtures/asset/default_mime_type.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/filename.js.erb +1 -0
- data/vendor/sprockets/test/fixtures/asset/foo-utf8.css +2 -0
- data/vendor/sprockets/test/fixtures/asset/included_header.js +4 -0
- data/vendor/sprockets/test/fixtures/asset/jquery.tmpl.min.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/mismatch.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/multiple.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/multipleengine.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/noengine.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/noformat.coffee +1 -0
- data/vendor/sprockets/test/fixtures/asset/one.css +1 -0
- data/vendor/sprockets/test/fixtures/asset/oneengine.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/project.css +1 -0
- data/vendor/sprockets/test/fixtures/asset/project.js.erb +4 -0
- data/vendor/sprockets/test/fixtures/asset/relative/include.js +4 -0
- data/vendor/sprockets/test/fixtures/asset/relative/require.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/relative/require_outside_path.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/require_self.css +9 -0
- data/vendor/sprockets/test/fixtures/asset/require_self_twice.css +8 -0
- data/vendor/sprockets/test/fixtures/asset/semicolons/bar.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/semicolons/index.js +5 -0
- data/vendor/sprockets/test/fixtures/asset/sprite.css.erb +12 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/b/c/d.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/b/c/e.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/b/c.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/b.css +2 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/b.js.erb +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/d/c.js.coffee +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all/d/e.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all_with_require.js +7 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all_with_require_directory.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/all_with_require_tree.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/tree/directory/application.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/tree/directory/bar.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/directory/foo.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/tree/application.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/tree/tree/bar.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/tree/foo.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/with_logical_path/a/a.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/with_logical_path/require_tree_with_logical_path.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/without_argument/a.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/without_argument/b.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/tree/without_argument/require_tree_without_argument.js +1 -0
- data/vendor/sprockets/test/fixtures/asset/two.css +1 -0
- data/vendor/sprockets/test/fixtures/asset/unicode.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/unknownexts.min.js +2 -0
- data/vendor/sprockets/test/fixtures/asset/users.js.erb.str +4 -0
- data/vendor/sprockets/test/fixtures/context/POW.png +0 -0
- data/vendor/sprockets/test/fixtures/context/application.js.yml +3 -0
- data/vendor/sprockets/test/fixtures/context/bar.js +1 -0
- data/vendor/sprockets/test/fixtures/context/foo.js +2 -0
- data/vendor/sprockets/test/fixtures/context/helpers.css.erb +3 -0
- data/vendor/sprockets/test/fixtures/context/properties.js.erb +7 -0
- data/vendor/sprockets/test/fixtures/context/require_glob.js +1 -0
- data/vendor/sprockets/test/fixtures/context/resolve_content_type.js.erb +4 -0
- data/vendor/sprockets/test/fixtures/context/sprite.css.embed +3 -0
- data/vendor/sprockets/test/fixtures/default/application.js.coffee +4 -0
- data/vendor/sprockets/test/fixtures/default/coffee/foo.coffee +1 -0
- data/vendor/sprockets/test/fixtures/default/coffee/index.js +3 -0
- data/vendor/sprockets/test/fixtures/default/empty +0 -0
- data/vendor/sprockets/test/fixtures/default/gallery.css.erb +3 -0
- data/vendor/sprockets/test/fixtures/default/gallery.js +1 -0
- data/vendor/sprockets/test/fixtures/default/goodbye.jst.eco +1 -0
- data/vendor/sprockets/test/fixtures/default/hello.jst.ejs +1 -0
- data/vendor/sprockets/test/fixtures/default/hello.txt +1 -0
- data/vendor/sprockets/test/fixtures/default/interpolation.js +1 -0
- data/vendor/sprockets/test/fixtures/default/missing_require.js +1 -0
- data/vendor/sprockets/test/fixtures/default/mobile/a.js +1 -0
- data/vendor/sprockets/test/fixtures/default/mobile/b.js +1 -0
- data/vendor/sprockets/test/fixtures/default/mobile/c.css +1 -0
- data/vendor/sprockets/test/fixtures/default/mobile/d.css +1 -0
- data/vendor/sprockets/test/fixtures/default/mobile/index.css +3 -0
- data/vendor/sprockets/test/fixtures/default/mobile/index.js +1 -0
- data/vendor/sprockets/test/fixtures/default/noreturn.js +1 -0
- data/vendor/sprockets/test/fixtures/default/project.js.coffee.erb +2 -0
- data/vendor/sprockets/test/fixtures/directives/code_before_comment +3 -0
- data/vendor/sprockets/test/fixtures/directives/comment_without_directives +6 -0
- data/vendor/sprockets/test/fixtures/directives/directive_word_splitting +6 -0
- data/vendor/sprockets/test/fixtures/directives/directives_after_header +16 -0
- data/vendor/sprockets/test/fixtures/directives/double_slash +9 -0
- data/vendor/sprockets/test/fixtures/directives/hash +8 -0
- data/vendor/sprockets/test/fixtures/directives/no_header +2 -0
- data/vendor/sprockets/test/fixtures/directives/slash_star +10 -0
- data/vendor/sprockets/test/fixtures/directives/slash_star_single +4 -0
- data/vendor/sprockets/test/fixtures/directives/space_between_directive_word +2 -0
- data/vendor/sprockets/test/fixtures/directives/triple_hash +10 -0
- data/vendor/sprockets/test/fixtures/encoding/ascii.js +1 -0
- data/vendor/sprockets/test/fixtures/encoding/ascii_utf8.js +2 -0
- data/vendor/sprockets/test/fixtures/encoding/utf16.js +0 -0
- data/vendor/sprockets/test/fixtures/encoding/utf8.js +1 -0
- data/vendor/sprockets/test/fixtures/encoding/utf8_bom.js +1 -0
- data/vendor/sprockets/test/fixtures/engines/hello.alert +1 -0
- data/vendor/sprockets/test/fixtures/engines/moo.js.str +1 -0
- data/vendor/sprockets/test/fixtures/public/compiled-digest-0aa2105d29558f3eb790d411d7d8fb66.js +3 -0
- data/vendor/sprockets/test/fixtures/public/compiled-digest-1c41eb0cf934a0c76babe875f982f9d1.js +1 -0
- data/vendor/sprockets/test/fixtures/server/app/javascripts/application.js +5 -0
- data/vendor/sprockets/test/fixtures/server/app/javascripts/bar.js +1 -0
- data/vendor/sprockets/test/fixtures/server/app/javascripts/foo.js +1 -0
- data/vendor/sprockets/test/fixtures/server/app/javascripts/hello.txt +2 -0
- data/vendor/sprockets/test/fixtures/server/app/javascripts/tree.js +1 -0
- data/vendor/sprockets/test/fixtures/server/vendor/javascripts/missing_require.js +1 -0
- data/vendor/sprockets/test/fixtures/server/vendor/stylesheets/missing_require.css +1 -0
- data/vendor/sprockets/test/sprockets_test.rb +56 -0
- data/vendor/sprockets/test/test_asset.rb +593 -0
- data/vendor/sprockets/test/test_asset_attributes.rb +86 -0
- data/vendor/sprockets/test/test_caching.rb +62 -0
- data/vendor/sprockets/test/test_context.rb +115 -0
- data/vendor/sprockets/test/test_directive_processor.rb +124 -0
- data/vendor/sprockets/test/test_encoding.rb +65 -0
- data/vendor/sprockets/test/test_engines.rb +73 -0
- data/vendor/sprockets/test/test_environment.rb +610 -0
- data/vendor/sprockets/test/test_server.rb +227 -0
- metadata +258 -54
- data/spec/fixtures/transporter/packages/transport/lib/wrapper.js +0 -5
data/spec/cli/add_spec.rb
CHANGED
@@ -2,14 +2,14 @@ require 'spec_helper'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
describe 'bpm add' do
|
5
|
-
|
5
|
+
|
6
6
|
before do
|
7
7
|
goto_home
|
8
8
|
set_host
|
9
9
|
start_fake(FakeGemServer.new)
|
10
10
|
FileUtils.cp_r(fixtures('hello_world'), '.')
|
11
11
|
cd home('hello_world')
|
12
|
-
|
12
|
+
|
13
13
|
bpm 'compile'
|
14
14
|
wait
|
15
15
|
end
|
@@ -19,93 +19,93 @@ describe 'bpm add' do
|
|
19
19
|
bpm "add", "jquery", :track_stderr => true
|
20
20
|
stderr.read.should include("inside of a bpm project")
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
it "should add a new hard dependency" do
|
24
24
|
bpm 'add', 'jquery'
|
25
25
|
wait
|
26
|
-
|
26
|
+
|
27
27
|
output = stdout.read
|
28
28
|
output.should include("Added package 'jquery' (1.4.3)")
|
29
29
|
has_dependency 'jquery', '1.4.3'
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
it "adds multiple package dependencies" do
|
33
33
|
bpm "add", "jquery", "rake"
|
34
|
-
|
34
|
+
|
35
35
|
output = stdout.read
|
36
|
-
|
36
|
+
|
37
37
|
%w(jquery:1.4.3 rake:0.8.7).each do |pkg|
|
38
38
|
pkg_name, pkg_version = pkg.split ':'
|
39
39
|
output.should include("Added package '#{pkg_name}' (#{pkg_version})")
|
40
40
|
has_dependency pkg_name, pkg_version
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
it "installs hard and soft dependencies" do
|
45
45
|
bpm 'add', 'coffee', '--pre'
|
46
46
|
wait
|
47
|
-
|
47
|
+
|
48
48
|
output = stdout.read
|
49
|
-
|
49
|
+
|
50
50
|
output.should include("Added package 'coffee' (1.0.1.pre)")
|
51
51
|
output.should include("Added package 'jquery' (1.4.3)")
|
52
|
-
|
52
|
+
|
53
53
|
has_dependency 'coffee', '1.0.1.pre', '>= 0-pre'
|
54
54
|
has_soft_dependency 'jquery', '1.4.3'
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
it "adds no packages when any are invalid" do
|
58
58
|
bpm "add", "jquery", "fake", :track_stderr => true
|
59
|
-
|
60
|
-
stderr.read.should
|
61
|
-
|
59
|
+
|
60
|
+
stderr.read.should == "Could not find eligable package for 'fake' (>= 0)\n"
|
61
|
+
|
62
62
|
no_dependency 'jquery'
|
63
63
|
no_dependency 'fake'
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
it "fails when adding invalid package" do
|
67
67
|
bpm "add", "fake", :track_stderr => true
|
68
|
-
|
69
|
-
stderr.read.should
|
68
|
+
|
69
|
+
stderr.read.should == "Could not find eligable package for 'fake' (>= 0)\n"
|
70
70
|
no_dependency 'fake'
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
it "fails if bpm can't write to the json or packages directory" do
|
74
74
|
FileUtils.mkdir_p home('hello_world', 'packages')
|
75
75
|
FileUtils.chmod 0555, home('hello_world', 'packages')
|
76
76
|
FileUtils.chmod 0555, home('hello_world', 'hello_world.json')
|
77
|
-
|
77
|
+
|
78
78
|
bpm "add", "jquery", :track_stderr => true
|
79
79
|
exit_status.should_not be_success
|
80
80
|
no_dependency 'jquery'
|
81
|
-
|
81
|
+
|
82
82
|
FileUtils.chmod 0755, home('hello_world', 'packages')
|
83
83
|
FileUtils.chmod 0755, home('hello_world', 'hello_world.json')
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
it "adds packages with different versions" do
|
87
87
|
bpm "add", "rake", "-v", "0.8.6"
|
88
|
-
|
88
|
+
|
89
89
|
stdout.read.should include("Added package 'rake' (0.8.6)")
|
90
90
|
has_dependency 'rake', '0.8.6', '0.8.6'
|
91
91
|
end
|
92
|
-
|
92
|
+
|
93
93
|
it "updates a package to latest version" do
|
94
94
|
bpm 'add', 'rake', '-v', '0.8.6'
|
95
95
|
wait
|
96
96
|
has_dependency 'rake', '0.8.6', '0.8.6' # precond
|
97
|
-
|
97
|
+
|
98
98
|
output = stdout.read
|
99
99
|
bpm 'add', 'rake'
|
100
100
|
wait
|
101
|
-
|
101
|
+
|
102
102
|
output = stdout.read
|
103
103
|
output.should_not include('Fetched spade') # not required 2nd time
|
104
104
|
output.should_not include("Added package 'spade' (0.5.0)")
|
105
105
|
output.should include("Added package 'rake' (0.8.7)")
|
106
106
|
has_dependency 'rake', '0.8.7'
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
it "adds a valid prerelease package" do
|
110
110
|
bpm "add", "bundler", "--pre", "--verbose"
|
111
111
|
wait
|
@@ -113,24 +113,24 @@ describe 'bpm add' do
|
|
113
113
|
output.should include("Added package 'bundler' (1.1.pre)")
|
114
114
|
has_dependency 'bundler', '1.1.pre', '>= 0-pre'
|
115
115
|
end
|
116
|
-
|
116
|
+
|
117
117
|
it "does not add the normal package when asking for a prerelease" do
|
118
118
|
bpm "add", "rake", "--pre", :track_stderr => true
|
119
119
|
wait
|
120
|
-
stderr.read.should
|
120
|
+
stderr.read.should == "Could not find eligable package for 'rake' (>= 0-pre)\n"
|
121
121
|
no_dependency 'rake'
|
122
122
|
end
|
123
|
-
|
123
|
+
|
124
124
|
it "requires at least one package to add" do
|
125
125
|
bpm "add", :track_stderr => true
|
126
126
|
stderr.read.should include("at least one package")
|
127
127
|
end
|
128
|
-
|
128
|
+
|
129
129
|
it "should make a soft dependency a hard dependency" do
|
130
130
|
bpm 'compile'
|
131
131
|
wait
|
132
132
|
has_soft_dependency 'ivory', '0.0.1' # precond
|
133
|
-
|
133
|
+
|
134
134
|
bpm 'add', 'ivory'
|
135
135
|
wait
|
136
136
|
has_dependency 'ivory', '0.0.1'
|
@@ -138,22 +138,25 @@ describe 'bpm add' do
|
|
138
138
|
|
139
139
|
it "should use local package if available" do
|
140
140
|
no_dependency 'custom_package'
|
141
|
-
|
141
|
+
|
142
142
|
bpm "add", "custom_package"
|
143
143
|
output = stdout.read
|
144
|
-
|
144
|
+
|
145
145
|
output.should include("Using local package 'custom_package'")
|
146
146
|
has_dependency 'custom_package', '2.0.0'
|
147
147
|
has_soft_dependency 'rake', '0.8.6'
|
148
148
|
end
|
149
|
-
|
149
|
+
|
150
150
|
it "should fail if local package version is not compatible" do
|
151
151
|
bpm "add", "custom_package", "-v", "3.0.0", :track_stderr => true
|
152
152
|
output = stderr.read
|
153
153
|
output.should include("'custom_package' (2.0.0) is not compatible")
|
154
154
|
no_dependency 'custom_package'
|
155
155
|
end
|
156
|
-
|
156
|
+
|
157
157
|
it "should verify working with config-less projects"
|
158
|
-
|
158
|
+
|
159
|
+
it "should work with .bpkg file"
|
160
|
+
# i.e. `bpm add package.bpkg`
|
161
|
+
|
159
162
|
end
|
data/spec/cli/build_spec.rb
CHANGED
@@ -16,9 +16,9 @@ describe "bpm build when logged in" do
|
|
16
16
|
|
17
17
|
exit_status.should be_success
|
18
18
|
output = stdout.read
|
19
|
-
output.should include("Successfully built package: core-test-0.4.9.
|
19
|
+
output.should include("Successfully built package: core-test-0.4.9.bpkg")
|
20
20
|
|
21
|
-
package = LibGems::Format.from_file_by_path("core-test-0.4.9.
|
21
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
22
22
|
package.spec.name.should == "core-test"
|
23
23
|
package.spec.version.should == LibGems::Version.new("0.4.9")
|
24
24
|
package.spec.email.should == email
|
@@ -37,7 +37,7 @@ describe "bpm build without logging in" do
|
|
37
37
|
|
38
38
|
exit_status.should be_success
|
39
39
|
|
40
|
-
package = LibGems::Format.from_file_by_path("core-test-0.4.9.
|
40
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
41
41
|
package.spec.name.should == "core-test"
|
42
42
|
package.spec.version.should == LibGems::Version.new("0.4.9")
|
43
43
|
end
|
@@ -49,7 +49,7 @@ describe "bpm build without logging in" do
|
|
49
49
|
exit_status.should be_success
|
50
50
|
|
51
51
|
cd 'core-test'
|
52
|
-
package = LibGems::Format.from_file_by_path("core-test-0.4.9.
|
52
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
53
53
|
package.spec.name.should == "core-test"
|
54
54
|
package.spec.version.should == LibGems::Version.new("0.4.9")
|
55
55
|
end
|
@@ -62,7 +62,7 @@ describe "bpm build without logging in" do
|
|
62
62
|
exit_status.should be_success
|
63
63
|
output = stdout.read
|
64
64
|
|
65
|
-
package = LibGems::Format.from_file_by_path("core-test-0.4.9.
|
65
|
+
package = LibGems::Format.from_file_by_path("core-test-0.4.9.bpkg")
|
66
66
|
package.spec.name.should == "core-test"
|
67
67
|
package.spec.version.should == LibGems::Version.new("0.4.9")
|
68
68
|
package.spec.email.should == "lucy@allen.com"
|
data/spec/cli/new_spec.rb
CHANGED
@@ -48,41 +48,67 @@ describe "bpm new" do
|
|
48
48
|
|
49
49
|
describe "package templates" do
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
describe "with custom generator" do
|
52
|
+
|
53
|
+
before do
|
54
|
+
goto_home
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
56
|
+
# Install package
|
57
|
+
cd fixtures
|
58
|
+
with_env do
|
59
|
+
BPM::Remote.new.install("custom_generator-1.0.bpkg", ">= 0", false)
|
60
|
+
end
|
61
|
+
cd home
|
58
62
|
end
|
59
|
-
cd home
|
60
|
-
end
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
+
it "should create custom files" do
|
65
|
+
bpm 'new', 'BpmTest', '--package=custom_generator'
|
64
66
|
|
65
|
-
|
67
|
+
files = %w(lib lib/main.js app.js BpmTest.json assets assets/bpm_packages.js assets/bpm_styles.css)
|
66
68
|
|
67
|
-
|
68
|
-
|
69
|
+
# output without coloration
|
70
|
+
output = stdout.read.gsub(/\e\[\d+m/,'')
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
-
|
72
|
+
files.each do |file|
|
73
|
+
output.should =~ /create\s+#{file}$/
|
74
|
+
home("bpm_test", file).should exist
|
75
|
+
end
|
73
76
|
end
|
74
|
-
end
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
+
it "should create custom app.js with explicit generator" do
|
79
|
+
bpm 'new', 'BpmTest', '--package=custom_generator' and wait
|
80
|
+
|
81
|
+
File.read(home("bpm_test", "app.js")).should == "require('BpmTest/main.js')\n"
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should create custom project.json without explicit generator" do
|
85
|
+
bpm 'new', 'BpmTest', '--package=custom_generator' and wait
|
86
|
+
|
87
|
+
File.read(home("bpm_test", "BpmTest.json")).should =~ /"spade": ">= 0"/
|
88
|
+
end
|
78
89
|
|
79
|
-
File.read(home("bpm_test", "app.js")).should == "require('BpmTest/main.js')\n"
|
80
90
|
end
|
81
91
|
|
82
|
-
|
83
|
-
|
92
|
+
describe "with custom generator" do
|
93
|
+
|
94
|
+
before do
|
95
|
+
goto_home
|
96
|
+
|
97
|
+
# Install package
|
98
|
+
cd fixtures
|
99
|
+
with_env do
|
100
|
+
installed = BPM::Remote.new.install("jquery-1.4.3.bpkg", ">= 0", false)
|
101
|
+
puts installed.inspect
|
102
|
+
end
|
103
|
+
cd home
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should add package as a dependency even if it doesn't have custom generator" do
|
107
|
+
bpm 'new', 'BpmTest', '--package=jquery' and wait
|
108
|
+
|
109
|
+
File.read(home("bpm_test", "BpmTest.json")).should =~ /"dependencies": {\n\s+"jquery": "1.4.3"\n\s+}/
|
110
|
+
end
|
84
111
|
|
85
|
-
File.read(home("bpm_test", "BpmTest.json")).should =~ /"spade": ">= 0"/
|
86
112
|
end
|
87
113
|
|
88
114
|
it "should install the package if it doesn't exist locally"
|
data/spec/cli/push_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe "bpm push" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "registers a gem when sent with the right api key" do
|
19
|
-
bpm "push", "../../spec/fixtures/rake-0.8.7.
|
19
|
+
bpm "push", "../../spec/fixtures/rake-0.8.7.bpkg"
|
20
20
|
|
21
21
|
stdout.read.should include("Successfully registered rake (0.8.7)")
|
22
22
|
end
|
@@ -25,7 +25,7 @@ describe "bpm push" do
|
|
25
25
|
it "shows rejection message if wrong api key is supplied" do
|
26
26
|
write_api_key("beefbeef")
|
27
27
|
|
28
|
-
bpm "push", "../../spec/fixtures/rake-0.8.7.
|
28
|
+
bpm "push", "../../spec/fixtures/rake-0.8.7.bpkg"
|
29
29
|
|
30
30
|
stdout.read.should include("One cannot simply walk into Mordor!")
|
31
31
|
end
|
@@ -40,13 +40,13 @@ describe "bpm push without api key" do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "ignores files that don't exist" do
|
43
|
-
bpm "push", "rake-1.0.0.
|
43
|
+
bpm "push", "rake-1.0.0.bpkg"
|
44
44
|
|
45
45
|
stdout.read.should include("No such file")
|
46
46
|
end
|
47
47
|
|
48
48
|
it "must push a valid gem" do
|
49
|
-
bpm "push", "../../spec/fixtures/badrake-0.8.7.
|
49
|
+
bpm "push", "../../spec/fixtures/badrake-0.8.7.bpkg"
|
50
50
|
|
51
51
|
stdout.read.should include("There was a problem opening your package.")
|
52
52
|
end
|
@@ -66,7 +66,7 @@ describe "bpm push without api key" do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it "asks for login first if api key does not exist" do
|
69
|
-
bpm "push", "../../spec/fixtures/rake-0.8.7.
|
69
|
+
bpm "push", "../../spec/fixtures/rake-0.8.7.bpkg"
|
70
70
|
|
71
71
|
stdout.read.should include("Please login first with `bpm login`")
|
72
72
|
end
|
data/spec/cli/unpack_spec.rb
CHANGED
@@ -6,8 +6,8 @@ describe "bpm unpack" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "builds a gem from a given package.json" do
|
9
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.
|
10
|
-
bpm "unpack", "coffee-1.0.1.pre.
|
9
|
+
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
10
|
+
bpm "unpack", "coffee-1.0.1.pre.bpkg"
|
11
11
|
|
12
12
|
exit_status.should be_success
|
13
13
|
output = stdout.read
|
@@ -22,8 +22,8 @@ describe "bpm unpack" do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "can unpack to a different directory" do
|
25
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.
|
26
|
-
bpm "unpack", "coffee-1.0.1.pre.
|
25
|
+
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
26
|
+
bpm "unpack", "coffee-1.0.1.pre.bpkg", "--target", "star/bucks"
|
27
27
|
|
28
28
|
exit_status.should be_success
|
29
29
|
output = stdout.read
|
@@ -33,9 +33,9 @@ describe "bpm unpack" do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "can unpack more than one package" do
|
36
|
-
FileUtils.cp fixtures("coffee-1.0.1.pre.
|
37
|
-
FileUtils.cp fixtures("jquery-1.4.3.
|
38
|
-
bpm "unpack", "coffee-1.0.1.pre.
|
36
|
+
FileUtils.cp fixtures("coffee-1.0.1.pre.bpkg"), "."
|
37
|
+
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
38
|
+
bpm "unpack", "coffee-1.0.1.pre.bpkg", "jquery-1.4.3.bpkg"
|
39
39
|
|
40
40
|
exit_status.should be_success
|
41
41
|
output = stdout.read
|
@@ -49,24 +49,24 @@ describe "bpm unpack" do
|
|
49
49
|
it "shows a friendly error message if bpm can't write to the given directory" do
|
50
50
|
FileUtils.mkdir_p(home("bad"))
|
51
51
|
cd(home("bad"))
|
52
|
-
FileUtils.cp fixtures("jquery-1.4.3.
|
52
|
+
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
53
53
|
FileUtils.chmod 0555, "."
|
54
|
-
bpm "unpack", "jquery-1.4.3.
|
54
|
+
bpm "unpack", "jquery-1.4.3.bpkg", :track_stderr => true
|
55
55
|
|
56
56
|
exit_status.should_not be_success
|
57
57
|
output = stderr.read
|
58
|
-
output.should include("There was a problem unpacking jquery-1.4.3.
|
58
|
+
output.should include("There was a problem unpacking jquery-1.4.3.bpkg:")
|
59
59
|
output.should include("Permission denied")
|
60
60
|
end
|
61
61
|
|
62
62
|
it "shows a friendly error message if bpm can't read the package" do
|
63
|
-
FileUtils.cp fixtures("jquery-1.4.3.
|
64
|
-
FileUtils.chmod 0000, "jquery-1.4.3.
|
65
|
-
bpm "unpack", "jquery-1.4.3.
|
63
|
+
FileUtils.cp fixtures("jquery-1.4.3.bpkg"), "."
|
64
|
+
FileUtils.chmod 0000, "jquery-1.4.3.bpkg"
|
65
|
+
bpm "unpack", "jquery-1.4.3.bpkg", :track_stderr => true
|
66
66
|
|
67
67
|
exit_status.should_not be_success
|
68
68
|
output = stderr.read
|
69
|
-
output.should include("There was a problem unpacking jquery-1.4.3.
|
69
|
+
output.should include("There was a problem unpacking jquery-1.4.3.bpkg:")
|
70
70
|
output.should include("Permission denied")
|
71
71
|
end
|
72
72
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
// TEST
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
// APP
|
@@ -0,0 +1 @@
|
|
1
|
+
// MAIN
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "minitest",
|
3
|
+
"version": "2.0.0",
|
4
|
+
"bpm": "0.1.0",
|
5
|
+
|
6
|
+
"description": "DESCRIPTION HERE",
|
7
|
+
"author": "YOUR NAME HERE",
|
8
|
+
"homepage": "URL",
|
9
|
+
|
10
|
+
"directories": {
|
11
|
+
"lib": "lib"
|
12
|
+
},
|
13
|
+
|
14
|
+
"dependencies": {
|
15
|
+
"uglyduck": "1.0.0"
|
16
|
+
},
|
17
|
+
|
18
|
+
"pipeline": {
|
19
|
+
"minifier": "uglyduck"
|
20
|
+
}
|
21
|
+
|
22
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
//UGLY DUCK
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "uglyduck",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"bpm": "0.1.0",
|
5
|
+
|
6
|
+
"description": "DESCRIPTION HERE",
|
7
|
+
"author": "YOUR NAME HERE",
|
8
|
+
"homepage": "URL",
|
9
|
+
|
10
|
+
"directories": {
|
11
|
+
"lib": "lib",
|
12
|
+
"minifier": "minifier",
|
13
|
+
"test": "tests"
|
14
|
+
},
|
15
|
+
|
16
|
+
"dependencies": {
|
17
|
+
},
|
18
|
+
|
19
|
+
"plugin:minifier": "uglyduck/~minifier/main"
|
20
|
+
|
21
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
// TRANSPORT DEMO
|
data/spec/gauntlet_spec.rb
CHANGED
@@ -25,8 +25,8 @@ describe "bpm build the gauntlet" do
|
|
25
25
|
bpm "build"
|
26
26
|
|
27
27
|
exit_status.should be_success
|
28
|
-
stdout.read.should include("Successfully built package: #{package}-#{version}.
|
29
|
-
File.exist?(tmp.join(package, "#{package}-#{version}.
|
28
|
+
stdout.read.should include("Successfully built package: #{package}-#{version}.bpkg")
|
29
|
+
File.exist?(tmp.join(package, "#{package}-#{version}.bpkg"))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
=end
|
data/spec/package_spec.rb
CHANGED
@@ -91,8 +91,8 @@ describe BPM::Package, "#to_spec" do
|
|
91
91
|
expand_sort(subject.test_files).should == expand_sort(test_files)
|
92
92
|
end
|
93
93
|
|
94
|
-
it "hacks the file name to return .
|
95
|
-
subject.file_name.should == "core-test-0.4.9.
|
94
|
+
it "hacks the file name to return .bpkg" do
|
95
|
+
subject.file_name.should == "core-test-0.4.9.bpkg"
|
96
96
|
end
|
97
97
|
|
98
98
|
it "sets the rubyforge_project to appease older versions of rubygems" do
|
@@ -122,7 +122,7 @@ describe BPM::Package, "converting" do
|
|
122
122
|
|
123
123
|
subject do
|
124
124
|
package = BPM::Package.new
|
125
|
-
package.bpkg = fixtures("core-test-0.4.9.
|
125
|
+
package.bpkg = fixtures("core-test-0.4.9.bpkg")
|
126
126
|
package.as_json
|
127
127
|
end
|
128
128
|
|