package_manager 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,4 @@
1
+ = package_manager - A package manager abstraction
2
+
3
+ Unifies the command interface for using yum and apt on Linux, Fink and MacPorts on OS X
4
+
data/Rakefile ADDED
@@ -0,0 +1,58 @@
1
+ require 'rubygems' if RUBY_VERSION < '1.9'
2
+ require 'rake'
3
+ require 'rake/gempackagetask'
4
+ require 'spec/rake/spectask'
5
+ require 'rake/rdoctask'
6
+ $:.unshift( File.dirname( __FILE__ ) + '/lib' )
7
+ require 'package_manager'
8
+
9
+ TITLE = 'A package manager abstraction'
10
+ ADMIN_FILES = FileList[ 'Rakefile', 'README.rdoc' ]
11
+ SOURCE_FILES = FileList[ 'bin/*', 'lib/**/*.rb' ]
12
+ SPEC_FILES = FileList[ 'spec/**/*' ]
13
+ RDOC_FILES = FileList[ 'README.rdoc' ] + SOURCE_FILES
14
+ RDOC_OPTS = [ '--quiet', '--main', 'README.rdoc', '--inline-source' ]
15
+
16
+ spec = Gem::Specification.new do |s|
17
+ s.name = 'package_manager'
18
+ s.summary = TITLE
19
+ s.description = 'Unifies the command interface for using yum and apt on Linux, Fink and MacPorts on OS X'
20
+ s.version = PackageManager::VERSION::STRING
21
+
22
+ s.homepage = 'http://github.com/joeyates/package_manager'
23
+ s.author = 'Joe Yates'
24
+ s.email = 'joe.g.yates@gmail.com'
25
+
26
+ s.files = ADMIN_FILES +
27
+ SOURCE_FILES
28
+ s.executables += [ 'pkg-find-available' ]
29
+ s.require_paths = [ 'lib' ]
30
+ s.add_dependency( 'rake', '>= 0.8.7' )
31
+
32
+ s.has_rdoc = true
33
+ s.rdoc_options += RDOC_OPTS
34
+ s.extra_rdoc_files = RDOC_FILES
35
+
36
+ s.test_files = SPEC_FILES
37
+ end
38
+
39
+ Rake::GemPackageTask.new( spec ) do |pkg|
40
+ end
41
+
42
+ Spec::Rake::SpecTask.new do |t|
43
+ t.spec_files = FileList[ 'spec/**/*_spec.rb' ]
44
+ t.spec_opts += [ '--color', '--format specdoc' ]
45
+ end
46
+
47
+ Spec::Rake::SpecTask.new( 'spec:rcov' ) do |t|
48
+ t.spec_files = FileList[ 'spec/**/*_spec.rb' ]
49
+ t.rcov = true
50
+ t.rcov_opts = [ '--exclude spec' ]
51
+ end
52
+
53
+ Rake::RDocTask.new do |rdoc|
54
+ rdoc.rdoc_dir = 'html'
55
+ rdoc.options += RDOC_OPTS
56
+ rdoc.title = TITLE
57
+ rdoc.rdoc_files.add RDOC_FILES
58
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'rubygems' if RUBY_VERSION < '1.9'
5
+
6
+ ROOT_PATH = File.dirname( File.dirname( File.expand_path( __FILE__ ) ) )
7
+ LIB_PATH = File.join( ROOT_PATH, 'lib' )
8
+ $:.unshift( LIB_PATH )
9
+ require 'package_manager'
10
+
11
+ OptionParser.new do | opts |
12
+ opts.banner = <<EOT
13
+ #{ $0 }: Find available packages matching a string
14
+ Usage: #{ $0 } [options]
15
+ EOT
16
+ end.parse!
17
+
18
+ pkg = PackageManager::Base.load
19
+ puts pkg.find_available( ARGV )
@@ -0,0 +1,23 @@
1
+ module PackageManager
2
+
3
+ class Base
4
+
5
+ attr_reader :name
6
+
7
+ def self.load
8
+ PackageManager::Port.new
9
+ end
10
+
11
+ def find_available( argv )
12
+ raise "You should supply a search pattern" if argv.size < 1
13
+ command = find_available_command
14
+ run_command( command, argv[ 0 ] )
15
+ end
16
+
17
+ def run_command( command, *args )
18
+ `#{ command } #{ args.join( ' ' ) }`
19
+ end
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,17 @@
1
+ module PackageManager
2
+
3
+ class Port < ::PackageManager::Base
4
+
5
+ def initialize
6
+ @name = 'port'
7
+ end
8
+
9
+ private
10
+
11
+ def find_available_command
12
+ 'port search'
13
+ end
14
+
15
+ end
16
+
17
+ end
@@ -0,0 +1,15 @@
1
+ require 'rubygems' if RUBY_VERSION < '1.9'
2
+ require 'package_manager/base'
3
+ require 'package_manager/port'
4
+
5
+ module PackageManager
6
+
7
+ module VERSION #:nodoc:
8
+ MAJOR = 0
9
+ MINOR = 0
10
+ TINY = 1
11
+
12
+ STRING = [ MAJOR, MINOR, TINY ].join('.')
13
+ end
14
+
15
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: package_manager
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Joe Yates
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-06 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rake
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 49
30
+ segments:
31
+ - 0
32
+ - 8
33
+ - 7
34
+ version: 0.8.7
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: Unifies the command interface for using yum and apt on Linux, Fink and MacPorts on OS X
38
+ email: joe.g.yates@gmail.com
39
+ executables:
40
+ - pkg-find-available
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - README.rdoc
45
+ - bin/pkg-find-available
46
+ - lib/package_manager/base.rb
47
+ - lib/package_manager/port.rb
48
+ - lib/package_manager.rb
49
+ files:
50
+ - Rakefile
51
+ - README.rdoc
52
+ - bin/pkg-find-available
53
+ - lib/package_manager/base.rb
54
+ - lib/package_manager/port.rb
55
+ - lib/package_manager.rb
56
+ has_rdoc: true
57
+ homepage: http://github.com/joeyates/package_manager
58
+ licenses: []
59
+
60
+ post_install_message:
61
+ rdoc_options:
62
+ - --quiet
63
+ - --main
64
+ - README.rdoc
65
+ - --inline-source
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
76
+ version: "0"
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ requirements: []
87
+
88
+ rubyforge_project:
89
+ rubygems_version: 1.3.7
90
+ signing_key:
91
+ specification_version: 3
92
+ summary: A package manager abstraction
93
+ test_files: []
94
+