capo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/capo +28 -0
- data/capo.gemspec +2 -0
- data/lib/capo/init.rb +23 -0
- data/lib/capo/version.rb +1 -1
- data/lib/capo.rb +4 -0
- metadata +22 -3
data/bin/capo
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require 'optparse'
|
3
|
+
require 'capo'
|
4
|
+
|
5
|
+
options = {}
|
6
|
+
|
7
|
+
option_parser = OptionParser.new do |option|
|
8
|
+
option.banner = 'Usage: capo COMMAND [OPTIONS]'
|
9
|
+
option.separator ''
|
10
|
+
option.separator 'Commands'
|
11
|
+
option.separator ' init: Clones and pulls the repository that contains the recipes'
|
12
|
+
option.separator ''
|
13
|
+
option.separator 'Options'
|
14
|
+
|
15
|
+
option.on('-h', '--help', 'help') do
|
16
|
+
@help = true
|
17
|
+
puts option_parser
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
option_parser.parse!
|
22
|
+
|
23
|
+
case ARGV[0]
|
24
|
+
when 'init'
|
25
|
+
Capo::Init.fetch_repository
|
26
|
+
else
|
27
|
+
puts option_parser unless @help
|
28
|
+
end
|
data/capo.gemspec
CHANGED
data/lib/capo/init.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'git'
|
2
|
+
|
3
|
+
module Capo
|
4
|
+
module Init
|
5
|
+
class << self
|
6
|
+
def fetch_repository
|
7
|
+
repository_path = File.expand_path '~/.capo'
|
8
|
+
repository_url = 'git://github.com/capoio/capo.git'
|
9
|
+
|
10
|
+
puts "Pulling changes from remote repository"
|
11
|
+
begin
|
12
|
+
repo = Git.open repository_path
|
13
|
+
puts repo.lib.send :command, 'pull' # repo.pull is broken in git-1.2.5, see: https://github.com/schacon/ruby-git/issues/32
|
14
|
+
rescue
|
15
|
+
puts "Reposito doesn't seem to exist yet..."
|
16
|
+
puts "Cloning repository from #{repository_url} to #{repository_path}"
|
17
|
+
Git.clone repository_url, repository_path
|
18
|
+
retry
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/capo/version.rb
CHANGED
data/lib/capo.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,11 +13,28 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
date: 2012-10-14 00:00:00.000000000 Z
|
16
|
-
dependencies:
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: git
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ! '>='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0'
|
25
|
+
type: :runtime
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
17
33
|
description: Command line utility to fetch and manage recipes
|
18
34
|
email:
|
19
35
|
- mail@capo.io
|
20
|
-
executables:
|
36
|
+
executables:
|
37
|
+
- capo
|
21
38
|
extensions: []
|
22
39
|
extra_rdoc_files: []
|
23
40
|
files:
|
@@ -26,8 +43,10 @@ files:
|
|
26
43
|
- LICENSE.txt
|
27
44
|
- README.md
|
28
45
|
- Rakefile
|
46
|
+
- bin/capo
|
29
47
|
- capo.gemspec
|
30
48
|
- lib/capo.rb
|
49
|
+
- lib/capo/init.rb
|
31
50
|
- lib/capo/version.rb
|
32
51
|
homepage: http://capo.io
|
33
52
|
licenses: []
|