brick_and_mortar 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a41abd8e89cdf6492f322222a500251e83ceba1
4
- data.tar.gz: 8075c07583a84d068bc29f0a0bb72859223eb72f
3
+ metadata.gz: 38982ab1b2b950c7dd5d1e0bc4fdb14f1a8eff6e
4
+ data.tar.gz: f67c443310b98bf9998901e5faa44c0c032084df
5
5
  SHA512:
6
- metadata.gz: 0c86c4ef885f2f5f4d967d4623644fc86ed0a10fc4e20a31a8dd1bd4ab9d3fc141a32496540c16e653e01a1bebe4e1c635e0873c47a93186935755fea3100794
7
- data.tar.gz: ff8e252416bea7ec06f14867f3a0c3693c5eb1c2e32efb2569a9959bf1bf0a6118140dd5c1ad630361f442d288e5b4d078ae8a9fecc02100996361da2ca27fd9
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
- @creation_closure = if exists?
77
- if verbose
78
- -> { puts "Using #{name_with_version} in #{@destination}" }
79
- else
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
- -> do
86
- if verbose
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
- -> do
93
- if verbose
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
- -> do
100
- if verbose
101
- puts "Installing #{@name_with_version} to #{@destination} from #{@location.path}"
102
- end
103
- if @location.format == Location::FORMATS[:zip]
104
- Download.get_and_unpack_zip(@location.path, @destination)
105
- elsif
106
- if @location.format == Location::FORMATS[:tar_gz]
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
- -> { raise UnrecognizedRetrievalMethod.new(@location.method) }
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
@@ -1,3 +1,3 @@
1
1
  module BrickAndMortar
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brick_and_mortar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill