menagerie 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aaa70271836892fa6a5cd0df65acde73b24c903a
4
- data.tar.gz: 785a77161e044b1c17512a7cd575de96ca3f91a7
3
+ metadata.gz: bbf78ed959e39be50004b49801ec0b406c1d7a3c
4
+ data.tar.gz: 24c340b7d9fab6465dbef45b57ff073740d0b35c
5
5
  SHA512:
6
- metadata.gz: 764516cd7d4f9e6863bf63db2deef7eb9e05f1df0fe8be9db37195c905370e24f0d1334a6f2d2961fab9af9218dff40b374e875ce329ff0ef0de2d9c80781f17
7
- data.tar.gz: b389ae5e10d0a40ae639fb10a10316b72928d070fc18f0cf0f89eb6b84533b8f71639713d888d9dea81bf3224a1189678f71e1ecc0e2a08f4b76ad11f1abff33
6
+ metadata.gz: 9a17c2cd269ef75e28a596b3e9adfdbe584942690ac1900ed9d7687d5bb1c5d604b284cfb898676b057a666f3a07fd2f9055583e49ce79234855061ceafcbfe8
7
+ data.tar.gz: 6fbb56e25c3c450f9c26a125594b5059f1a962c2b6ec657ff24b2fdeb1cc7688443d3ce31b7c85e5e0b2ddd7a6c7fd9e18b298cbe4bf1fd20226a9e2b44fe94a
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ RSpec::Core::RakeTask.new(:spec)
7
7
 
8
8
  desc 'Run Rubocop on the gem'
9
9
  RuboCop::RakeTask.new(:rubocop) do |task|
10
- task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
10
+ task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'bin/*']
11
11
  task.fail_on_error = true
12
12
  end
13
13
 
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'menagerie'
4
+
5
+ data = Menagerie.new
6
+
7
+ data.releases.sort.each do |release|
8
+ puts "Release: #{release.id}"
9
+ release.artifacts.each do |artifact|
10
+ puts " #{artifact.name}: #{artifact.version}"
11
+ end
12
+ end
@@ -17,6 +17,13 @@ module Menagerie
17
17
  end
18
18
  end
19
19
 
20
+ def orphans
21
+ keepers = releases.map(&:artifacts).flatten.map(&:path).uniq
22
+ Dir.glob("#{@paths[:artifacts]}/*/*").reject do |artifact|
23
+ keepers.include? artifact
24
+ end
25
+ end
26
+
20
27
  def create(artifacts)
21
28
  rotate
22
29
  Release.new artifacts: Cymbal.symbolize(artifacts), paths: @paths
@@ -34,10 +41,7 @@ module Menagerie
34
41
  end
35
42
 
36
43
  def reap
37
- keepers = releases.map(&:artifacts).flatten.map(&:path).uniq
38
- Dir.glob("#{@paths[:artifacts]}/*/*").each do |artifact|
39
- FileUtils.rm_f(artifact) unless keepers.include? artifact
40
- end
44
+ orphans.each { |orphan| FileUtils.rm_f orphan }
41
45
  end
42
46
 
43
47
  def link_latest
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'menagerie'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
 
6
6
  s.summary = ''
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: menagerie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-25 00:00:00.000000000 Z
11
+ date: 2014-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cymbal
@@ -108,6 +108,7 @@ files:
108
108
  - LICENSE
109
109
  - README.md
110
110
  - Rakefile
111
+ - bin/menagerie
111
112
  - lib/menagerie.rb
112
113
  - lib/menagerie/artifact.rb
113
114
  - lib/menagerie/collection.rb