link_finder 0.0.1 → 0.0.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.
- data/lib/link_finder.rb +7 -6
 - data/lib/link_finder/version.rb +1 -1
 - metadata +1 -1
 
    
        data/lib/link_finder.rb
    CHANGED
    
    | 
         @@ -113,12 +113,14 @@ module LinkFinder 
     | 
|
| 
       113 
113 
     | 
    
         
             
                end
         
     | 
| 
       114 
114 
     | 
    
         | 
| 
       115 
115 
     | 
    
         
             
                def dia_refresh 
         
     | 
| 
       116 
     | 
    
         
            -
                  pixbuf = Gdk::Pixbuf.new(" 
     | 
| 
      
 116 
     | 
    
         
            +
                  pixbuf = Gdk::Pixbuf.new("#{@report_filename}.png", 700, 520)
         
     | 
| 
       117 
117 
     | 
    
         
             
                  @img_diagram.pixbuf = pixbuf
         
     | 
| 
       118 
118 
     | 
    
         
             
                  Gtk::main_iteration_do(blocking = false) while Gtk::events_pending?
         
     | 
| 
       119 
119 
     | 
    
         
             
                end
         
     | 
| 
       120 
120 
     | 
    
         | 
| 
       121 
121 
     | 
    
         
             
                def start_process
         
     | 
| 
      
 122 
     | 
    
         
            +
                  @report_filename = "report_#{Time.now.to_s.gsub(/[\s\+]/, "_").gsub(/\:/,'-')}"
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
       122 
124 
     | 
    
         
             
                  progress_reset
         
     | 
| 
       123 
125 
     | 
    
         
             
                  @progress_value = 0
         
     | 
| 
       124 
126 
     | 
    
         | 
| 
         @@ -171,18 +173,17 @@ module LinkFinder 
     | 
|
| 
       171 
173 
     | 
    
         
             
                            dia = Gruff::Bar.new
         
     | 
| 
       172 
174 
     | 
    
         
             
                            dia.title = "Отчет"
         
     | 
| 
       173 
175 
     | 
    
         
             
                            dia_data.each { |d| dia.data(d[:link], d[:count]) }
         
     | 
| 
       174 
     | 
    
         
            -
                            dia.write(" 
     | 
| 
      
 176 
     | 
    
         
            +
                            dia.write("#{@report_filename}.png")
         
     | 
| 
       175 
177 
     | 
    
         
             
                            dia_refresh
         
     | 
| 
       176 
178 
     | 
    
         
             
                          end
         
     | 
| 
       177 
179 
     | 
    
         
             
                        end
         
     | 
| 
       178 
180 
     | 
    
         
             
                      end
         
     | 
| 
       179 
     | 
    
         
            -
                      
         
     | 
| 
       180 
     | 
    
         
            -
                      break if index >= 10
         
     | 
| 
      
 181 
     | 
    
         
            +
                      # break if index >= 10
         
     | 
| 
       181 
182 
     | 
    
         
             
                    end
         
     | 
| 
       182 
183 
     | 
    
         
             
                    @threads.each {|t| t.join}
         
     | 
| 
       183 
184 
     | 
    
         | 
| 
       184 
185 
     | 
    
         
             
                    dia_data = []
         
     | 
| 
       185 
     | 
    
         
            -
                    File.open(" 
     | 
| 
      
 186 
     | 
    
         
            +
                    File.open("#{@report_filename}.txt", "wb:UTF-8") do |f|
         
     | 
| 
       186 
187 
     | 
    
         
             
                      f.write Time.now.to_s + "\n"
         
     | 
| 
       187 
188 
     | 
    
         
             
                      all = @sites.length
         
     | 
| 
       188 
189 
     | 
    
         
             
                      @result.each do |r|
         
     | 
| 
         @@ -223,7 +224,7 @@ module LinkFinder 
     | 
|
| 
       223 
224 
     | 
    
         
             
                    dia = Gruff::Bar.new
         
     | 
| 
       224 
225 
     | 
    
         
             
                    dia.title = "Отчет"
         
     | 
| 
       225 
226 
     | 
    
         
             
                    dia_data.each { |d| dia.data(d[:link], d[:count]) }
         
     | 
| 
       226 
     | 
    
         
            -
                    dia.write(" 
     | 
| 
      
 227 
     | 
    
         
            +
                    dia.write("#{@report_filename}.png")
         
     | 
| 
       227 
228 
     | 
    
         
             
                    dia_refresh
         
     | 
| 
       228 
229 
     | 
    
         
             
                  end
         
     | 
| 
       229 
230 
     | 
    
         
             
                end
         
     | 
    
        data/lib/link_finder/version.rb
    CHANGED