mason 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. data/README.md +34 -15
  2. data/lib/mason/cli.rb +8 -6
  3. data/lib/mason/version.rb +1 -1
  4. metadata +4 -4
data/README.md CHANGED
@@ -2,34 +2,34 @@
2
2
 
3
3
  Build things
4
4
 
5
- ## Instructions
5
+ $ gem install mason
6
6
 
7
7
  ### Install buildpacks locally
8
8
 
9
9
  $ mason buildpacks
10
10
  * buildpacks (~/.mason/buildpacks)
11
- = foo: https://github.com/ddollar/buildpack-foo.git
12
- = bar: https://github.com/ddollar/buildpack-bar.git
11
+ = nodejs: https://github.com/heroku/heroku-buildpack-nodejs.git
12
+ = ruby: https://github.com/ddollar/heroku-buildpack-ruby.git
13
13
 
14
- $ mason buildpacks:install https://github.com/ddollar/buildpack-baz.git
15
- * adding buildpack https://github.com/ddollar/buildpack-baz.git
14
+ $ mason buildpacks:install https://github.com/heroku/heroku-buildpack-python.git
15
+ * installing buildpack https://github.com/heroku/heroku-buildpack-python.git
16
16
 
17
17
  ### Use buildpacks to build things
18
18
 
19
19
  $ mason build /tmp/app
20
20
  * detecting buildpack... done
21
- = name: Baz
22
- = url: https://github.com/ddollar/buildpack-baz.git
21
+ = name: Ruby
22
+ = url: https://github.com/heroku/heroku-buildpack-ruby.git
23
23
  * compiling:
24
24
  ... COMPILE OUTPUT
25
25
  * packaging... done
26
- = type: squashfs
27
- = file: /tmp/app.img
26
+ = type: dir
27
+ = file: /tmp/mason.out
28
28
 
29
29
  $ mason build /tmp/app -t dir -o /tmp/compiledapp
30
30
  * detecting buildpack... done
31
- = name: Baz
32
- = url: https://github.com/ddollar/buildpack-baz.git
31
+ = name: Ruby
32
+ = url: https://github.com/heroku/heroku-buildpack-ruby.git
33
33
  * compiling...
34
34
  ... COMPILE OUTPUT
35
35
  * packaging... done
@@ -46,8 +46,27 @@ Build things
46
46
  = type: tgz
47
47
  = file: /tmp/app.tgz
48
48
 
49
- ### Use vagrant to build things for other platforms
49
+ ### Build things for other platforms using Vagrant
50
+
51
+ You will need [VirtualBox](https://www.virtualbox.org/wiki/Downloads) for Vagrant to function.
52
+
53
+ $ gem install vagrant
54
+
55
+ $ vagrant box add cedar http://path/to/cedar.box
50
56
 
51
- $ mason build /tmp/app -s cedar
52
- * booting vm for cedar
53
- ...
57
+ $ mason stacks:create cedar
58
+ * creating stack cedar... done
59
+
60
+ $ mason stacks:up VAGRANT_BOX_NAME
61
+ * booting stack cedar (this may take a while)... done
62
+
63
+ $ mason:build /tmp/app -t tgz -o /tmp/compiled.tgz
64
+ * booting stack cedar (this may take a while)... done
65
+ * detecting buildpack... done
66
+ = name: Baz
67
+ = url: https://github.com/ddollar/buildpack-baz.git
68
+ * compiling...
69
+ ... COMPILE OUTPUT
70
+ * packaging... done
71
+ = type: tgz
72
+ = dir: /tmp/compiled.tgz
@@ -33,7 +33,9 @@ class Mason::CLI < Thor
33
33
 
34
34
  type = File.extname(output)[1..-1] if !type && output
35
35
  output = "#{app}.#{type}" if !output && type
36
- type ||= "dir"
36
+
37
+ type ||= "dir"
38
+ output ||= "/tmp/mason.out"
37
39
 
38
40
  raise "no such output format: #{type}" unless %w( dir img tgz ).include?(type)
39
41
 
@@ -88,7 +90,7 @@ class Mason::CLI < Thor
88
90
  system %{ tar czf "#{output}" . }
89
91
  end
90
92
  when :img then
91
- puts "not yet"
93
+ raise "img not supported yet"
92
94
  when :dir then
93
95
  FileUtils.rm_rf output
94
96
  FileUtils.cp_r compile_dir, output
@@ -129,14 +131,14 @@ class Mason::CLI < Thor
129
131
  desc "buildpacks:install URL", "install a buildpack"
130
132
 
131
133
  def install(url)
132
- puts "* adding buildpack #{url}"
134
+ puts "* installing buildpack #{url}"
133
135
  Mason::Buildpacks.install url
134
136
  end
135
137
 
136
138
  desc "buildpacks:uninstall NAME", "uninstall a buildpack"
137
139
 
138
140
  def uninstall(name)
139
- puts "* removing buildpack #{name}"
141
+ puts "* uninstalling buildpack #{name}"
140
142
  Mason::Buildpacks.uninstall name
141
143
  end
142
144
 
@@ -226,8 +228,8 @@ class Mason::CLI < Thor
226
228
  end
227
229
 
228
230
  klass.start(args)
229
- # rescue StandardError => ex
230
- # raise Mason::CommandFailed, ex.message
231
+ rescue StandardError => ex
232
+ raise Mason::CommandFailed, ex.message
231
233
  end
232
234
 
233
235
  private
@@ -1,3 +1,3 @@
1
1
  module Mason
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mason
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-18 00:00:00.000000000 Z
12
+ date: 2012-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70148573564580 !ruby/object:Gem::Requirement
16
+ requirement: &70215443015460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70148573564580
24
+ version_requirements: *70215443015460
25
25
  description: Build things
26
26
  email: ddollar@gmail.com
27
27
  executables: