brick_and_mortar 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brick_and_mortar/brick.rb +33 -43
- data/lib/brick_and_mortar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38982ab1b2b950c7dd5d1e0bc4fdb14f1a8eff6e
|
4
|
+
data.tar.gz: f67c443310b98bf9998901e5faa44c0c032084df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 179122ae559d97b8d214e0c7e815bb36076955c2239c25bc3aa09acfa95ec019a16d529a743bf331ac60c1634db3530db2e8536975770ecc84dcef8b5a668c6f
|
7
|
+
data.tar.gz: b4202d1925f387d5d362b62dcef884fb5c23f2969285acce04bb77c57eadf231d4def31ecbc149d744555701fa86416ab8c9379ba70efe4321bd143bb95c7f37
|
@@ -72,65 +72,55 @@ module BrickAndMortar
|
|
72
72
|
@version = data['version']
|
73
73
|
@location = Location.new(data['location'])
|
74
74
|
@destination = File.join(brick_store, name_with_version)
|
75
|
+
@verbose = verbose
|
76
|
+
end
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
def name_with_version
|
79
|
+
"#{@name}-#{@version}"
|
80
|
+
end
|
81
|
+
|
82
|
+
def exists?
|
83
|
+
File.exist? @destination
|
84
|
+
end
|
85
|
+
|
86
|
+
alias_method :exist?, :exists?
|
87
|
+
|
88
|
+
def create!
|
89
|
+
if exists?
|
90
|
+
if @verbose
|
91
|
+
puts "Using #{name_with_version} in #{@destination}"
|
81
92
|
end
|
82
93
|
else
|
83
94
|
case @location.method
|
84
95
|
when 'git'
|
85
|
-
|
86
|
-
|
87
|
-
puts "Installing #{name_with_version} to #{@destination} from #{@location.path} with git"
|
88
|
-
end
|
89
|
-
Git.clone_repo(@location.path, @destination)
|
96
|
+
if @verbose
|
97
|
+
puts "Installing #{name_with_version} to #{@destination} from #{@location.path} with git"
|
90
98
|
end
|
99
|
+
Git.clone_repo(@location.path, @destination)
|
91
100
|
when 'svn'
|
92
|
-
|
93
|
-
|
94
|
-
puts "Installing #{@name_with_version} to #{@destination} from #{@location.path} with svn"
|
95
|
-
end
|
96
|
-
Svn.checkout_repo(@location.path, @destination)
|
101
|
+
if @verbose
|
102
|
+
puts "Installing #{@name_with_version} to #{@destination} from #{@location.path} with svn"
|
97
103
|
end
|
104
|
+
Svn.checkout_repo(@location.path, @destination)
|
98
105
|
when 'download'
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
Download.get_and_unpack_tar_gz(@location.path, @destination)
|
108
|
-
end
|
109
|
-
else
|
110
|
-
ap @location.format
|
111
|
-
raise UnrecognizedFormat.new(@location.format)
|
106
|
+
if @verbose
|
107
|
+
puts "Installing #{@name_with_version} to #{@destination} from #{@location.path}"
|
108
|
+
end
|
109
|
+
if @location.format == Location::FORMATS[:zip]
|
110
|
+
Download.get_and_unpack_zip(@location.path, @destination)
|
111
|
+
elsif
|
112
|
+
if @location.format == Location::FORMATS[:tar_gz]
|
113
|
+
Download.get_and_unpack_tar_gz(@location.path, @destination)
|
112
114
|
end
|
115
|
+
else
|
116
|
+
raise UnrecognizedFormat.new(@location.format)
|
113
117
|
end
|
114
118
|
else
|
115
|
-
|
119
|
+
raise UnrecognizedRetrievalMethod.new(@location.method)
|
116
120
|
end
|
117
121
|
end
|
118
122
|
end
|
119
123
|
|
120
|
-
def name_with_version
|
121
|
-
"#{@name}-#{@version}"
|
122
|
-
end
|
123
|
-
|
124
|
-
def exists?
|
125
|
-
File.exist? @destination
|
126
|
-
end
|
127
|
-
|
128
|
-
alias_method :exist?, :exists?
|
129
|
-
|
130
|
-
def create!
|
131
|
-
@creation_closure.call
|
132
|
-
end
|
133
|
-
|
134
124
|
def laid?(project_vendor_dir)
|
135
125
|
File.exist? File.join(project_vendor_dir, name)
|
136
126
|
end
|