vise 0.0.1.pre
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/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/vise.rb +4 -0
- data/lib/vise/binary.rb +43 -0
- data/lib/vise/shell_tools.rb +20 -0
- data/lib/vise/version.rb +3 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/vise_spec.rb +9 -0
- data/vise.gemspec +22 -0
- metadata +77 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Terence Lee
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Vise
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'vise'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install vise
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/vise.rb
ADDED
data/lib/vise/binary.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "vise/shell_tools"
|
2
|
+
require "tmpdir"
|
3
|
+
|
4
|
+
module Vise
|
5
|
+
# class assists in building binaries using anvil on Heroku.
|
6
|
+
class Binary
|
7
|
+
include ShellTools
|
8
|
+
|
9
|
+
# @param [String] path to the build dir
|
10
|
+
# @param [String] path to the cache dir
|
11
|
+
# ensures the following:
|
12
|
+
# * move the building scripts into /tmp
|
13
|
+
# * the script /tmp/build` is executable
|
14
|
+
# * build dir is clean
|
15
|
+
def initialize(build_dir, cache_dir)
|
16
|
+
@build_dir = build_dir
|
17
|
+
@cache_dir = cache_dir
|
18
|
+
pipe "mv #{@build_dir}/* /tmp"
|
19
|
+
pipe "chmod u+x /tmp/build"
|
20
|
+
pipe "rm -rf #{@build_dir}/*"
|
21
|
+
end
|
22
|
+
|
23
|
+
# this is the main compile method.
|
24
|
+
# pass a block to compile of what you want to run.
|
25
|
+
# the block gets the source dir to work in, and a
|
26
|
+
# build dir which is the dir that gets packaged.
|
27
|
+
def compile
|
28
|
+
tmpdir = Dir.mktmpdir
|
29
|
+
Dir.chdir(tmpdir) do |source_dir, build_dir|
|
30
|
+
yield source_dir, @build_dir
|
31
|
+
end
|
32
|
+
|
33
|
+
puts "Packaging the following files/dirs:"
|
34
|
+
pipe "ls #{@build_dir}"
|
35
|
+
ensure
|
36
|
+
if ENV['DEBUG']
|
37
|
+
puts "Source dir: #{tmpdir}"
|
38
|
+
else
|
39
|
+
FileUtils.rm_rf(tmpdir)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Vise
|
2
|
+
# convenience methods for interacting with the shell
|
3
|
+
# in ruby that can be used in your build program
|
4
|
+
module ShellTools
|
5
|
+
# run a shell command and stream the output
|
6
|
+
# @param [String] command to be run
|
7
|
+
def pipe(command)
|
8
|
+
output = ""
|
9
|
+
IO.popen(command) do |io|
|
10
|
+
until io.eof?
|
11
|
+
buffer = io.gets
|
12
|
+
output << buffer
|
13
|
+
puts buffer
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
output
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/vise/version.rb
ADDED
data/spec/spec_helper.rb
ADDED
data/spec/vise_spec.rb
ADDED
data/vise.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vise/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "vise"
|
8
|
+
gem.version = Vise::VERSION
|
9
|
+
gem.authors = ["Terence Lee"]
|
10
|
+
gem.email = ["hone02@gmail.com"]
|
11
|
+
gem.description = %q{Library to assist with building binaries using Heroku's anvil}
|
12
|
+
gem.summary = %q{Library to assist with building binaries using Heroku's anvil}
|
13
|
+
gem.homepage = ""
|
14
|
+
gem.license = "MIT"
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
gem.add_development_dependency "rake"
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vise
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.pre
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Terence Lee
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Library to assist with building binaries using Heroku's anvil
|
31
|
+
email:
|
32
|
+
- hone02@gmail.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- .gitignore
|
38
|
+
- .rspec
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE.txt
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- lib/vise.rb
|
44
|
+
- lib/vise/binary.rb
|
45
|
+
- lib/vise/shell_tools.rb
|
46
|
+
- lib/vise/version.rb
|
47
|
+
- spec/spec_helper.rb
|
48
|
+
- spec/vise_spec.rb
|
49
|
+
- vise.gemspec
|
50
|
+
homepage: ''
|
51
|
+
licenses:
|
52
|
+
- MIT
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>'
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.3.1
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 1.8.24
|
72
|
+
signing_key:
|
73
|
+
specification_version: 3
|
74
|
+
summary: Library to assist with building binaries using Heroku's anvil
|
75
|
+
test_files:
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
- spec/vise_spec.rb
|