ngauthier-aptinstaller 0.1.1 → 0.2.0

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/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ === v0.1.0
2
+ 2009-01-14
3
+
4
+ * Initial Release: Aptinstaller will scan your rails project's aptinstaller configuration file to install packages via apt-get.
data/Manifest.txt ADDED
@@ -0,0 +1,8 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/aptinstaller
6
+ aptinstaller.gemspec
7
+ lib/aptinstaller.rb
8
+ lib/aptinstaller/version.rb
data/README.txt ADDED
@@ -0,0 +1,54 @@
1
+ = aptinstaller
2
+
3
+ * http://github.com/ngauthier/aptinstaller/tree/master
4
+
5
+ == DESCRIPTION:
6
+ This gem installs packages through apt-get in a similar manner as geminstaller installs gems.
7
+
8
+ == Usage:
9
+ aptinstaller [/full/path/to/rails/project/root]
10
+
11
+ Note: to run on a particular environment, invoke the executable as such:
12
+
13
+ $> RAILS_ENV=staging aptinstaller /full/path/to/rails/project/root
14
+
15
+ == INCOMPLETE ==
16
+ * Currently it doesn't do anything. I'm just trying to rake the gem.
17
+
18
+ == SYNOPSIS:
19
+
20
+ FIX (code sample of usage)
21
+
22
+ == REQUIREMENTS:
23
+
24
+ * a rails app that requires apt packages
25
+
26
+ == INSTALL:
27
+
28
+ rake gem
29
+ sudo gem install pkg/aptinstaller-0.1.0.gem
30
+
31
+ == LICENSE:
32
+
33
+ (The MIT License)
34
+
35
+ Copyright (c) 2008 FIX
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining
38
+ a copy of this software and associated documentation files (the
39
+ 'Software'), to deal in the Software without restriction, including
40
+ without limitation the rights to use, copy, modify, merge, publish,
41
+ distribute, sublicense, and/or sell copies of the Software, and to
42
+ permit persons to whom the Software is furnished to do so, subject to
43
+ the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be
46
+ included in all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 2
3
+ :patch: 0
4
+ :major: 0
@@ -0,0 +1 @@
1
+ require File.join(File.dirname(__FILE__), 'aptinstaller', 'aptinstaller')
@@ -0,0 +1,39 @@
1
+ require 'yaml'
2
+
3
+ class AptInstaller
4
+
5
+ def self.autopkg(opts = {})
6
+ config_file = opts.delete(:config)
7
+ raise "Error reading config file, no :config parameter specified" unless config_file
8
+ begin
9
+ begin
10
+ config = File.new(config_file, 'r').read
11
+ rescue
12
+ config = File.new(File.join(RAILS_ROOT, config_file), 'r').read
13
+ end
14
+ rescue => ex
15
+ raise "Error reading config file at #{config_file}"
16
+ end
17
+ begin
18
+ config_yaml = YAML::load(config)
19
+ rescue => ex
20
+ raise "Error parsing YAML file: #{ex.to_s}"
21
+ end
22
+ errors = []
23
+ config_yaml['packages'].each do |package|
24
+ exec = package['executable']
25
+ pkg = package['package']
26
+ errors.push(package) if `which #{exec}`.size == 0
27
+ end
28
+ if errors.size > 0
29
+ $stderr.write "\nThe following packages are required by this program but not installed:\n\n"
30
+ errors.each do |package|
31
+ $stderr.write "\t* "+package['executable']+"\n"
32
+ end
33
+ $stderr.write "\nYou can install them by running:\n"
34
+ $stderr.write "\tapt-get install "
35
+ $stderr.write errors.collect{|p| p['package'] || p['executable']}.join(" ")
36
+ $stderr.write "\n\nor by running \"aptinstaller\" in the root of your project\n\n"
37
+ exit(1)
38
+ end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ngauthier-aptinstaller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Gauthier
@@ -22,7 +22,14 @@ extensions: []
22
22
  extra_rdoc_files: []
23
23
 
24
24
  files:
25
+ - VERSION.yml
26
+ - History.txt
27
+ - README.txt
28
+ - Manifest.txt
25
29
  - bin/aptinstaller
30
+ - lib/aptinstaller.rb
31
+ - lib/aptinstaller
32
+ - lib/aptinstaller/aptinstaller.rb
26
33
  has_rdoc: false
27
34
  homepage: http://github.com/ngauthier/aptinstaller
28
35
  post_install_message: