mbrew 0.1.1 → 0.1.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/mbrew +0 -1
- data/lib/mbrew/mbrew.rb +26 -9
- data/lib/mbrew/version.rb +1 -1
- data/mbrew.sublime-project +0 -6
- 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: 0776be2a38063d2d3c53296f48004d38758948e1
|
|
4
|
+
data.tar.gz: afcc36df679f7b30328f2f382fd08bd7a6b79026
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 335704a915555c71fb09436a2ab1800052c7237a8fbb17941d852239c764b78028c9c92ac829e7b93108630f193c74fb1a11006d5d9a26eca0bdf3a8e73d08b4
|
|
7
|
+
data.tar.gz: 9a944959f05f507025d7471e829532e7196cffdf8add7f0b74bfe806dfb2880ad0610d00c0279bf655ad975f3762cd44f7f58d9709520be889cb2cd70d9955c4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MusicBrew is a combination of Spotify and [Homebrew](http://brew.sh/). Like a [p
|
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
For all kinds of documentation see [`mbrew(1)`](http://mbrew.fox21.at/
|
|
7
|
+
For all kinds of documentation see [`mbrew(1)`](http://mbrew.fox21.at/).
|
|
8
8
|
|
|
9
9
|
## License
|
|
10
10
|
Copyright (C) 2015 Christian Mayer <http://fox21.at>
|
data/bin/mbrew
CHANGED
data/lib/mbrew/mbrew.rb
CHANGED
|
@@ -15,12 +15,26 @@ module TheFox
|
|
|
15
15
|
class MBrew
|
|
16
16
|
|
|
17
17
|
def initialize(working_dir = '.')
|
|
18
|
-
|
|
18
|
+
puts "working_dir org: '#{working_dir}'"
|
|
19
|
+
|
|
20
|
+
working_dir ||= '.'
|
|
21
|
+
|
|
22
|
+
puts "working_dir alt: '#{working_dir}'"
|
|
19
23
|
|
|
20
24
|
@working_dir = File.realpath(working_dir)
|
|
21
25
|
@working_dir_pn = Pathname.new(@working_dir)
|
|
26
|
+
puts "working_dir: '#{@working_dir}'"
|
|
27
|
+
|
|
22
28
|
@dotmbrew_dir = "#{@working_dir}/.mbrew"
|
|
23
|
-
|
|
29
|
+
puts "dotmbrew_dir: '#{@dotmbrew_dir}'"
|
|
30
|
+
@is_a_mbrew_lib = Dir.exist?(@dotmbrew_dir)
|
|
31
|
+
|
|
32
|
+
@config_path = "#{@dotmbrew_dir}/config.yml"
|
|
33
|
+
puts "config path: '#{@config_path}'"
|
|
34
|
+
@config = nil
|
|
35
|
+
if @is_a_mbrew_lib && File.exist?(@config_path)
|
|
36
|
+
@config = YAML.load_file(@config_path)
|
|
37
|
+
end
|
|
24
38
|
|
|
25
39
|
# puts "working_dir: '#{@working_dir}'"
|
|
26
40
|
# puts "config: '#{@config}'"
|
|
@@ -604,7 +618,8 @@ module TheFox
|
|
|
604
618
|
private
|
|
605
619
|
|
|
606
620
|
def check_is_a_mbrew_lib
|
|
607
|
-
|
|
621
|
+
puts "check working dir: #{@working_dir}"
|
|
622
|
+
raise 'Not a mbrew library.' if !@is_a_mbrew_lib
|
|
608
623
|
end
|
|
609
624
|
|
|
610
625
|
def check_staged_file
|
|
@@ -621,12 +636,14 @@ module TheFox
|
|
|
621
636
|
end
|
|
622
637
|
|
|
623
638
|
def check_installed_file
|
|
624
|
-
|
|
625
|
-
Dir.chdir(
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
installed_yml
|
|
639
|
+
if @is_a_mbrew_lib
|
|
640
|
+
Dir.chdir(@working_dir) do
|
|
641
|
+
Dir.chdir('.mbrew') do
|
|
642
|
+
if !File.exist?('installed.yml')
|
|
643
|
+
installed_yml = YAML::Store.new('installed.yml')
|
|
644
|
+
installed_yml.transaction do
|
|
645
|
+
installed_yml['artists'] = []
|
|
646
|
+
end
|
|
630
647
|
end
|
|
631
648
|
end
|
|
632
649
|
end
|
data/lib/mbrew/version.rb
CHANGED
data/mbrew.sublime-project
CHANGED