ZMediumToMarkdown 1.4.0 → 1.4.7
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/bin/ZMediumToMarkdown +5 -3
- data/lib/Helper.rb +5 -21
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 072fe69c4d10ec3bca66a370283c052d2de3081bc1d507b07b0aaedd0629da50
         | 
| 4 | 
            +
              data.tar.gz: a63a45968dfd7409ad144a4f27633eef90408a5d6ab4438b5f8a30ce70764e55
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: aecf98b3ec864d444ee9f51ebde2b3ceccbf2b1bd55a1f0dca2f1ed0ccefbcc0707cdac2d63d7b491b67d2962a5425931755ccb887780c68587c06aed9a43b34
         | 
| 7 | 
            +
              data.tar.gz: f4b6b091d3e8f3e0b2e4aff0ece8e1fadc84321eb072c435fa051855cd3af1b762e926726a57ae776357091d4beb93db25ce01183f0f58e7280203097d53f18d
         | 
    
        data/bin/ZMediumToMarkdown
    CHANGED
    
    | @@ -32,7 +32,7 @@ class Main | |
| 32 32 | 
             
                        end
         | 
| 33 33 |  | 
| 34 34 | 
             
                        opts.on('-n', '--new', 'Update to latest version') do
         | 
| 35 | 
            -
                            if Helper. | 
| 35 | 
            +
                            if Helper.getRemoteVersionFromGithub() > Helper.getLocalVersion()
         | 
| 36 36 | 
             
                                Helper.downloadLatestVersion()
         | 
| 37 37 | 
             
                            else
         | 
| 38 38 | 
             
                                puts "You're using the latest version :)"
         | 
| @@ -46,9 +46,11 @@ class Main | |
| 46 46 | 
             
                            Helper.printNewVersionMessageIfExists()
         | 
| 47 47 | 
             
                        end
         | 
| 48 48 |  | 
| 49 | 
            -
                        opts.on('-v', '--version', 'Print current ZMediumToMarkdown Version') do
         | 
| 50 | 
            -
                            puts "Version:#{Helper. | 
| 49 | 
            +
                        opts.on('-v', '--version', 'Print current ZMediumToMarkdown Version & Output Path') do
         | 
| 50 | 
            +
                            puts "Version:#{Helper.getLocalVersion().to_s}"
         | 
| 51 51 | 
             
                            puts "Output Path:#{outputFilePath.getAbsolutePath(nil)}"
         | 
| 52 | 
            +
                            
         | 
| 53 | 
            +
                            Helper.printNewVersionMessageIfExists()
         | 
| 52 54 | 
             
                        end
         | 
| 53 55 |  | 
| 54 56 | 
             
                    end.parse!
         | 
    
        data/lib/Helper.rb
    CHANGED
    
    | @@ -11,20 +11,6 @@ require 'zip' | |
| 11 11 |  | 
| 12 12 | 
             
            class Helper
         | 
| 13 13 |  | 
| 14 | 
            -
                class Version
         | 
| 15 | 
            -
                    attr_accessor :major, :minor, :patch
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                    def initialize(major, minor, patch)
         | 
| 18 | 
            -
                        @major = major.to_i
         | 
| 19 | 
            -
                        @minor = minor.to_i
         | 
| 20 | 
            -
                        @patch = patch.to_i
         | 
| 21 | 
            -
                    end
         | 
| 22 | 
            -
             | 
| 23 | 
            -
                    def to_string()
         | 
| 24 | 
            -
                        "#{major.to_s}.#{minor.to_s}.#{patch.to_s}"
         | 
| 25 | 
            -
                    end
         | 
| 26 | 
            -
                end
         | 
| 27 | 
            -
             | 
| 28 14 | 
             
                def self.createDirIfNotExist(dirPath)
         | 
| 29 15 | 
             
                    dirs = dirPath.split("/")
         | 
| 30 16 | 
             
                    currentDir = ""
         | 
| @@ -103,15 +89,15 @@ class Helper | |
| 103 89 | 
             
                end
         | 
| 104 90 |  | 
| 105 91 | 
             
                def self.printNewVersionMessageIfExists() 
         | 
| 106 | 
            -
                    if Helper. | 
| 92 | 
            +
                    if Helper.getRemoteVersionFromGithub() > Helper.getLocalVersion()
         | 
| 107 93 | 
             
                        puts "##########################################################"
         | 
| 108 94 | 
             
                        puts "#####           New Version Available!!!             #####"
         | 
| 109 | 
            -
                        puts "##### Please type ` | 
| 95 | 
            +
                        puts "##### Please type `ZMediumToMarkdown -n` to update!! #####"
         | 
| 110 96 | 
             
                        puts "##########################################################"
         | 
| 111 97 | 
             
                    end
         | 
| 112 98 | 
             
                end
         | 
| 113 99 |  | 
| 114 | 
            -
                def self. | 
| 100 | 
            +
                def self.getLocalVersion()
         | 
| 115 101 | 
             
                    rootPath = File.expand_path('../', File.dirname(__FILE__))
         | 
| 116 102 |  | 
| 117 103 | 
             
                    result = nil
         | 
| @@ -123,8 +109,7 @@ class Helper | |
| 123 109 | 
             
                    end
         | 
| 124 110 |  | 
| 125 111 | 
             
                    if !result.nil?
         | 
| 126 | 
            -
                         | 
| 127 | 
            -
                        Version.new(versions[0],versions[1],versions[2])
         | 
| 112 | 
            +
                        Gem::Version.new(result)
         | 
| 128 113 | 
             
                    else
         | 
| 129 114 | 
             
                        nil
         | 
| 130 115 | 
             
                    end
         | 
| @@ -146,8 +131,7 @@ class Helper | |
| 146 131 | 
             
                    end
         | 
| 147 132 |  | 
| 148 133 | 
             
                    if !tagName.nil?
         | 
| 149 | 
            -
                         | 
| 150 | 
            -
                        Version.new(versions[0],versions[1],versions[2])
         | 
| 134 | 
            +
                        Gem::Version.new(tagName.downcase.gsub! 'v','')
         | 
| 151 135 | 
             
                    else
         | 
| 152 136 | 
             
                        nil
         | 
| 153 137 | 
             
                    end
         |