sdoc_all 1.0.0.1 → 1.0.1
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.
- data/VERSION.yml +1 -1
- data/lib/sdoc_all/task.rb +16 -14
- data/sdoc_all.gemspec +1 -1
- metadata +1 -1
    
        data/VERSION.yml
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            [1, 0,  | 
| 1 | 
            +
            [1, 0, 1]
         | 
    
        data/lib/sdoc_all/task.rb
    CHANGED
    
    | @@ -25,6 +25,18 @@ class SdocAll | |
| 25 25 | 
             
                  created_hash = config_hash_path.read rescue nil
         | 
| 26 26 | 
             
                  return true if created_hash != config_hash
         | 
| 27 27 | 
             
                end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                def run_if_clobber
         | 
| 30 | 
            +
                  if clobber?
         | 
| 31 | 
            +
                    Base.remove_if_present(Base.docs_path + doc_path)
         | 
| 32 | 
            +
                    yield
         | 
| 33 | 
            +
                    if (Base.docs_path + doc_path).directory?
         | 
| 34 | 
            +
                      config_hash_path.open('w') do |f|
         | 
| 35 | 
            +
                        f.write(config_hash)
         | 
| 36 | 
            +
                      end
         | 
| 37 | 
            +
                    end
         | 
| 38 | 
            +
                  end
         | 
| 39 | 
            +
                end
         | 
| 28 40 | 
             
              end
         | 
| 29 41 |  | 
| 30 42 | 
             
              class Task < BaseTask
         | 
| @@ -44,9 +56,7 @@ class SdocAll | |
| 44 56 | 
             
                end
         | 
| 45 57 |  | 
| 46 58 | 
             
                def run(options = {})
         | 
| 47 | 
            -
                   | 
| 48 | 
            -
                    Base.remove_if_present(Base.docs_path + doc_path)
         | 
| 49 | 
            -
             | 
| 59 | 
            +
                  run_if_clobber do
         | 
| 50 60 | 
             
                    cmd = %w(sdoc)
         | 
| 51 61 | 
             
                    cmd << '-o' << Base.docs_path + doc_path
         | 
| 52 62 | 
             
                    cmd << '-t' << title
         | 
| @@ -68,12 +78,6 @@ class SdocAll | |
| 68 78 | 
             
                    else
         | 
| 69 79 | 
             
                      Base.system(*cmd + [src_path])
         | 
| 70 80 | 
             
                    end
         | 
| 71 | 
            -
             | 
| 72 | 
            -
                    if (Base.docs_path + doc_path).directory?
         | 
| 73 | 
            -
                      config_hash_path.open('w') do |f|
         | 
| 74 | 
            -
                        f.write(config_hash)
         | 
| 75 | 
            -
                      end
         | 
| 76 | 
            -
                    end
         | 
| 77 81 | 
             
                  end
         | 
| 78 82 | 
             
                end
         | 
| 79 83 |  | 
| @@ -124,10 +128,8 @@ class SdocAll | |
| 124 128 | 
             
                end
         | 
| 125 129 |  | 
| 126 130 | 
             
                def run(options = {})
         | 
| 127 | 
            -
                   | 
| 128 | 
            -
                     | 
| 129 | 
            -
             | 
| 130 | 
            -
                    tasks.each do |task|
         | 
| 131 | 
            +
                  run_if_clobber do
         | 
| 132 | 
            +
                    tasks.each_with_progress(title) do |task|
         | 
| 131 133 | 
             
                      task.run(options)
         | 
| 132 134 | 
             
                    end
         | 
| 133 135 |  | 
| @@ -143,7 +145,7 @@ class SdocAll | |
| 143 145 | 
             
                end
         | 
| 144 146 |  | 
| 145 147 | 
             
                def for_hash
         | 
| 146 | 
            -
                  [doc_path.to_s, title, tasks.map(&: | 
| 148 | 
            +
                  [doc_path.to_s, title, tasks.map(&:for_hash)]
         | 
| 147 149 | 
             
                end
         | 
| 148 150 |  | 
| 149 151 | 
             
                def clobber?
         | 
    
        data/sdoc_all.gemspec
    CHANGED