nehm 1.2.2 → 1.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 +4 -4
 - data/CHANGELOG.md +8 -0
 - data/README.md +3 -3
 - data/lib/nehm.rb +1 -4
 - data/lib/nehm/configure.rb +10 -6
 - data/lib/nehm/get.rb +1 -1
 - data/lib/nehm/path_control.rb +20 -4
 - data/lib/nehm/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3f0c4e15904c1a52655fc3847970d6ab417fcedb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1e0969f09138e26b6788c695b323079951155a80
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2dae199bc056dc4d431f61f12d5fdafc92442bff56ea60eb994c19ef14b81f1a355dbc36744f4dd3529f27127966330a63511c8bc3d031a8cf864d00f61dfc44
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ed3a74038f90cf65ce9629396a661d9f2c97847f1b723e8b433440115e0931b08bdc8eb489b9a74eb58a2483d3964ae36714bfd9fd1bfa5d37dc133e7df6b2e4
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # nehm change log
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## 1.3
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            * Now you can type short paths to download and iTunes paths while configuring nehm (e.g. ~/Music)
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            * Configure menu doesn't automatically exit after choose
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            * nehm doesn't ask for iTunes path by first run
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
       3 
11 
     | 
    
         
             
            ## 1.2.2
         
     | 
| 
       4 
12 
     | 
    
         | 
| 
       5 
13 
     | 
    
         
             
            * Tracks has got now year tag
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -16,9 +16,9 @@ or 
     | 
|
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            **Linux:**
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            Debian/Ubuntu: ` 
     | 
| 
      
 19 
     | 
    
         
            +
            Debian/Ubuntu: `sudo apt-get install libtag1-dev`
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
            Fedora/RHEL: ` 
     | 
| 
      
 21 
     | 
    
         
            +
            Fedora/RHEL: `sudo yum install taglib-devel`
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
            **2. Then you can install `nehm` gem:**
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
         @@ -36,7 +36,7 @@ nehm should answer like this: 
     | 
|
| 
       36 
36 
     | 
    
         
             
            ```
         
     | 
| 
       37 
37 
     | 
    
         
             
            Hello!
         
     | 
| 
       38 
38 
     | 
    
         
             
            Before using the nehm, you should set it up:
         
     | 
| 
       39 
     | 
    
         
            -
            Enter  
     | 
| 
      
 39 
     | 
    
         
            +
            Enter path to desirable download directory (press enter to set it to ...
         
     | 
| 
       40 
40 
     | 
    
         
             
            ```
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
            **Now you can use nehm!**
         
     | 
    
        data/lib/nehm.rb
    CHANGED
    
    
    
        data/lib/nehm/configure.rb
    CHANGED
    
    | 
         @@ -6,13 +6,17 @@ module Configure 
     | 
|
| 
       6 
6 
     | 
    
         
             
                puts 'Permalink: ' + Paint[Config[:permalink], :cyan] if Config[:permalink]
         
     | 
| 
       7 
7 
     | 
    
         
             
                puts "\n"
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
      
 9 
     | 
    
         
            +
                loop do
         
     | 
| 
      
 10 
     | 
    
         
            +
                  HighLine.new.choose do |menu|
         
     | 
| 
      
 11 
     | 
    
         
            +
                    menu.prompt = Paint['Choose setting', :yellow]
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
      
 13 
     | 
    
         
            +
                    menu.choice('Edit download path') { PathControl.set_dl_path }
         
     | 
| 
      
 14 
     | 
    
         
            +
                    menu.choice('Edit itunes path') { PathControl.set_itunes_path } unless OS.linux?
         
     | 
| 
      
 15 
     | 
    
         
            +
                    menu.choice('Edit permalink') { UserControl.log_in }
         
     | 
| 
      
 16 
     | 
    
         
            +
                    menu.choice('Exit') { exit }
         
     | 
| 
      
 17 
     | 
    
         
            +
                  end
         
     | 
| 
      
 18 
     | 
    
         
            +
                  sleep(1)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  puts "\n"
         
     | 
| 
       16 
20 
     | 
    
         
             
                end
         
     | 
| 
       17 
21 
     | 
    
         
             
              end
         
     | 
| 
       18 
22 
     | 
    
         
             
            end
         
     | 
    
        data/lib/nehm/get.rb
    CHANGED
    
    
    
        data/lib/nehm/path_control.rb
    CHANGED
    
    | 
         @@ -6,7 +6,7 @@ class PathControl 
     | 
|
| 
       6 
6 
     | 
    
         
             
              def self.set_dl_path
         
     | 
| 
       7 
7 
     | 
    
         
             
                loop do
         
     | 
| 
       8 
8 
     | 
    
         
             
                  default_path = File.join(ENV['HOME'], '/Music')
         
     | 
| 
       9 
     | 
    
         
            -
                  path_ask = 'Enter  
     | 
| 
      
 9 
     | 
    
         
            +
                  path_ask = 'Enter path to desirable download directory'
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                  if Dir.exist?(default_path)
         
     | 
| 
       12 
12 
     | 
    
         
             
                    path_ask << " (press enter to set it to #{Paint[default_path, :magenta]})"
         
     | 
| 
         @@ -17,9 +17,11 @@ class PathControl 
     | 
|
| 
       17 
17 
     | 
    
         
             
                  path = HighLine.new.ask(path_ask + ':')
         
     | 
| 
       18 
18 
     | 
    
         
             
                  path = default_path if path == '' && default_path
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
      
 20 
     | 
    
         
            +
                  path = PathControl.tilde_to_home(path) if PathControl.tilde_at_top?(path)
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       20 
22 
     | 
    
         
             
                  if Dir.exist?(path)
         
     | 
| 
       21 
23 
     | 
    
         
             
                    Config[:dl_path] = path
         
     | 
| 
       22 
     | 
    
         
            -
                    puts Paint[ 
     | 
| 
      
 24 
     | 
    
         
            +
                    puts Paint["Download directory set up to #{Paint[path, :magenta]}", :green]
         
     | 
| 
       23 
25 
     | 
    
         
             
                    break
         
     | 
| 
       24 
26 
     | 
    
         
             
                  else
         
     | 
| 
       25 
27 
     | 
    
         
             
                    puts Paint["This directory doesn't exist. Please enter path again", :red]
         
     | 
| 
         @@ -48,7 +50,7 @@ class PathControl 
     | 
|
| 
       48 
50 
     | 
    
         
             
              def self.set_itunes_path
         
     | 
| 
       49 
51 
     | 
    
         
             
                loop do
         
     | 
| 
       50 
52 
     | 
    
         
             
                  default_path = File.join(ENV['HOME'], '/Music/iTunes')
         
     | 
| 
       51 
     | 
    
         
            -
                  path_ask = 'Enter  
     | 
| 
      
 53 
     | 
    
         
            +
                  path_ask = 'Enter path to iTunes directory'
         
     | 
| 
       52 
54 
     | 
    
         | 
| 
       53 
55 
     | 
    
         
             
                  if Dir.exist?(default_path)
         
     | 
| 
       54 
56 
     | 
    
         
             
                    path_ask << " (press enter to set it to #{Paint[default_path, :magenta]})"
         
     | 
| 
         @@ -59,15 +61,29 @@ class PathControl 
     | 
|
| 
       59 
61 
     | 
    
         
             
                  path = HighLine.new.ask(path_ask + ':')
         
     | 
| 
       60 
62 
     | 
    
         
             
                  path = default_path if path == '' && default_path
         
     | 
| 
       61 
63 
     | 
    
         | 
| 
      
 64 
     | 
    
         
            +
                  path = PathControl.tilde_to_home(path) if PathControl.tilde_at_top?(path)
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
       62 
66 
     | 
    
         
             
                  path = File.join(path, "iTunes\ Media/Automatically\ Add\ to\ iTunes.localized")
         
     | 
| 
       63 
67 
     | 
    
         | 
| 
       64 
68 
     | 
    
         
             
                  if Dir.exist?(path)
         
     | 
| 
       65 
69 
     | 
    
         
             
                    Config[:itunes_path] = path
         
     | 
| 
       66 
     | 
    
         
            -
                    puts Paint[ 
     | 
| 
      
 70 
     | 
    
         
            +
                    puts Paint["iTunes directory set up to #{Paint[path, :magenta]}", :green]
         
     | 
| 
       67 
71 
     | 
    
         
             
                    break
         
     | 
| 
       68 
72 
     | 
    
         
             
                  else
         
     | 
| 
       69 
73 
     | 
    
         
             
                    puts Paint["This directory doesn't exist. Please enter path again", :red]
         
     | 
| 
       70 
74 
     | 
    
         
             
                  end
         
     | 
| 
       71 
75 
     | 
    
         
             
                end
         
     | 
| 
       72 
76 
     | 
    
         
             
              end
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
              def self.set_itunes_path_to_default
         
     | 
| 
      
 79 
     | 
    
         
            +
                Config[:itunes_path] = File.join(ENV['HOME'], "/Music/iTunes/iTunes\ Media/Automatically\ Add\ to\ iTunes.localized")
         
     | 
| 
      
 80 
     | 
    
         
            +
              end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
              def self.tilde_to_home(path)
         
     | 
| 
      
 83 
     | 
    
         
            +
                File.join(ENV['HOME'], path[1..-1])
         
     | 
| 
      
 84 
     | 
    
         
            +
              end
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
              def self.tilde_at_top?(path)
         
     | 
| 
      
 87 
     | 
    
         
            +
                path[0] == '~' ? true : false
         
     | 
| 
      
 88 
     | 
    
         
            +
              end
         
     | 
| 
       73 
89 
     | 
    
         
             
            end
         
     | 
    
        data/lib/nehm/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: nehm
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: '1.3'
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Albert Nigmatzianov
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015-07- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-07-31 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |