srcpkg 0.1.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.
Files changed (3) hide show
  1. data/bin/srcpkg +26 -0
  2. data/lib/srcpkg.rb +38 -0
  3. metadata +48 -0
data/bin/srcpkg ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'srcpkg'
5
+
6
+ if ARGV.length > 0
7
+ srcpkg = Srcpkg.new;
8
+ actual_command = ARGV.shift
9
+ command = actual_command.gsub ':', '_'
10
+ if srcpkg.respond_to? command
11
+ srcpkg.send command, ARGV
12
+ else # ! srcpkg.respond_to? command
13
+ puts " err: unknown command #{actual_command}"
14
+ end#if
15
+ else # ARGV.length == 0
16
+
17
+ puts
18
+ puts <<eos
19
+ Commands
20
+ ------------------------------------------------------------------------------
21
+ srcpkg version - current version
22
+ srcpkg install - install packages at location
23
+
24
+ eos
25
+
26
+ end#if
data/lib/srcpkg.rb ADDED
@@ -0,0 +1,38 @@
1
+ class Srcpkg
2
+
3
+ VERSION = '0.1.0'
4
+
5
+ #### Commands ##################################################################
6
+
7
+ def version(args)
8
+ puts " #{Srcpkg::VERSION}"
9
+ end#def
10
+
11
+ def install(args)
12
+ msg "This tool is under development. Please check back later.\n"
13
+ msg "fin"
14
+ end#def
15
+
16
+ #### Helpers ###################################################################
17
+
18
+ def readable_time(time)
19
+ hours = (time / 3600).to_i
20
+ minutes = ((time - hours) / 60).to_i
21
+ seconds = time - hours * 3600 - minutes * 60
22
+ if hours != 0
23
+ return ('%02d' % hours) + ':' + ('%02d' % minutes) + ':' + ('%02d' % seconds)
24
+ else
25
+ return ('%02d' % minutes) + ':' + ('%02d' % seconds)
26
+ end
27
+ end#def
28
+
29
+ def err(msg)
30
+ puts " Err: #{msg}"
31
+ exit
32
+ end#def
33
+
34
+ def msg(msg)
35
+ puts " #{msg}"
36
+ end#def
37
+
38
+ end#class
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: srcpkg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - srcspider
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-06-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Single yml format for manging dependencies for different languages.
15
+ email: source.spider@gmail.com
16
+ executables:
17
+ - srcpkg
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/srcpkg.rb
22
+ - bin/srcpkg
23
+ homepage: http://rubygems.org/gems/srcpkg
24
+ licenses:
25
+ - MIT
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 1.8.28
45
+ signing_key:
46
+ specification_version: 3
47
+ summary: Universal Dependency Management
48
+ test_files: []