bowie 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bowie +5 -0
- data/lib/bowie.rb +12 -0
- data/lib/bowie/utils.rb +16 -0
- data/lib/bowie/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66a2796cd8d8d57857968670dbd961835eef5c45
|
4
|
+
data.tar.gz: 55389b1254b14a5b1f157e09a2a8512fd64dbf26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d29fff3ded65c449929219f8abfe5e659f63577073851a0c5181aebe59e26857c6bf60a55f232646ee8e3462de3db15d2822c1f170daf4f8d9840be1afeb23fe
|
7
|
+
data.tar.gz: 65a99deb50dd94068b997d3d354e060344ccde5adbdacfcbacd7a7f6d84ca29ba62e54bc52fbe776efd61be693713ecdb17593b2d073c7a3bce17494076472c0
|
data/bin/bowie
CHANGED
@@ -29,6 +29,11 @@ class BowieCLI < Thor
|
|
29
29
|
results = Bowie.search(song)
|
30
30
|
results.each { |key, values| puts "#{values['name']}:\n #{values['description']}" }
|
31
31
|
end
|
32
|
+
|
33
|
+
desc "prune", "remove all the packages not included in songs.yml"
|
34
|
+
def prune
|
35
|
+
Bowie.prune
|
36
|
+
end
|
32
37
|
end
|
33
38
|
|
34
39
|
BowieCLI.start(ARGV)
|
data/lib/bowie.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "bowie/version"
|
2
|
+
require "bowie/utils"
|
2
3
|
require "yaml"
|
3
4
|
require "open-uri"
|
4
5
|
require "fileutils"
|
@@ -113,4 +114,15 @@ module Bowie
|
|
113
114
|
end
|
114
115
|
end
|
115
116
|
|
117
|
+
# Remove all the packages not included in songs.yml
|
118
|
+
def self.prune
|
119
|
+
@local_songs = self.get_local_songs
|
120
|
+
|
121
|
+
Utils.get_songs_dirs.each do |dir|
|
122
|
+
unless @local_songs.include? dir
|
123
|
+
FileUtils.rm_rf("bowie_songs/#{dir}")
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
116
128
|
end
|
data/lib/bowie/utils.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Bowie
|
2
|
+
module Utils
|
3
|
+
|
4
|
+
# Return an array with all the direcotry inside bowye_songs
|
5
|
+
def self.get_songs_dirs
|
6
|
+
result = []
|
7
|
+
Dir.foreach('bowie_songs') do |el|
|
8
|
+
unless (el == "." or el == ".." or el == "lyrics.yml")
|
9
|
+
result.push el
|
10
|
+
end
|
11
|
+
end
|
12
|
+
result
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/lib/bowie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Moretti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- bin/bowie
|
83
83
|
- bowie.gemspec
|
84
84
|
- lib/bowie.rb
|
85
|
+
- lib/bowie/utils.rb
|
85
86
|
- lib/bowie/version.rb
|
86
87
|
homepage: http://axyz.github.io/bowie/
|
87
88
|
licenses:
|