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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 524fdbdd29962d1ec1ca01d61fb868f2d238fbef
4
- data.tar.gz: 3fd0a930998360d10ec1e2f48bdf8cd24e23c46c
3
+ metadata.gz: 0776be2a38063d2d3c53296f48004d38758948e1
4
+ data.tar.gz: afcc36df679f7b30328f2f382fd08bd7a6b79026
5
5
  SHA512:
6
- metadata.gz: 603d7782d19e24d722d5fdeb56b2ec728d7ead12792b5d5bbf1d85b52e8ff2bb26aafa3bc26b74e31224b1aafa8085cd8664690885d28eba6a8002ea204467ba
7
- data.tar.gz: c379a73b82763b962d9fab8eb981afafc88ea977e90a933877c22d2645c2a586bc0dba5b21ddaf09e747ea40cb149cc2db1316331b1115486b4e00452e0ed63d
6
+ metadata.gz: 335704a915555c71fb09436a2ab1800052c7237a8fbb17941d852239c764b78028c9c92ac829e7b93108630f193c74fb1a11006d5d9a26eca0bdf3a8e73d08b4
7
+ data.tar.gz: 9a944959f05f507025d7471e829532e7196cffdf8add7f0b74bfe806dfb2880ad0610d00c0279bf655ad975f3762cd44f7f58d9709520be889cb2cd70d9955c4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mbrew (0.1.1)
4
+ mbrew (0.1.2)
5
5
  git (~> 1.2)
6
6
  highline (~> 1.7)
7
7
  id3lib-ruby (~> 0.6)
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/man/mbrew.1.html).
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
@@ -47,7 +47,6 @@ def get_working_dir
47
47
  end
48
48
 
49
49
  working_dir = get_working_dir
50
- is_a_mbrew_lib = !working_dir.nil?
51
50
 
52
51
  mbrew = TheFox::MBrew::MBrew.new(working_dir)
53
52
 
@@ -15,12 +15,26 @@ module TheFox
15
15
  class MBrew
16
16
 
17
17
  def initialize(working_dir = '.')
18
- working_dir = working_dir || '.'
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
- @config = YAML.load_file("#{@dotmbrew_dir}/config.yml")
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
- raise 'not a mbrew library.' if @working_dir.nil?
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
- Dir.chdir(@working_dir) do
625
- Dir.chdir('.mbrew') do
626
- if !File.exist?('installed.yml')
627
- installed_yml = YAML::Store.new('installed.yml')
628
- installed_yml.transaction do
629
- installed_yml['artists'] = []
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
@@ -2,7 +2,7 @@
2
2
  module TheFox
3
3
  module MBrew
4
4
  RELEASE_ID = 0
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  DATE = '2015-12-10'
7
7
  HOMEPAGE = 'https://github.com/TheFox/mbrew'
8
8
  end
@@ -5,12 +5,6 @@
5
5
  "name": "MusicBrew",
6
6
  "folder_exclude_patterns": [ ],
7
7
  "file_exclude_patterns": [ ]
8
- },
9
- {
10
- "path": "../mbrew_man",
11
- "name": "Man",
12
- "folder_exclude_patterns": [ ],
13
- "file_exclude_patterns": [ ]
14
8
  }
15
9
  ]
16
10
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbrew
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Mayer