Neurogami-rhesus 0.2.3 → 0.2.5
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/rhesus/core.rb +11 -4
- data/lib/version.rb +1 -1
- metadata +4 -3
    
        data/lib/rhesus/core.rb
    CHANGED
    
    | @@ -20,7 +20,7 @@ module Neurogami | |
| 20 20 |  | 
| 21 21 | 
             
                class Core
         | 
| 22 22 | 
             
                  # Hacky :( FIXME Add a better way to define what files get slurped for parsing
         | 
| 23 | 
            -
                  haz_vars = %w{ rb txt rhtml ini yml yaml Rakefile rake gemspec}
         | 
| 23 | 
            +
                  haz_vars = %w{ rb txt rhtml ini yml yaml Rakefile rake gemspec feature}
         | 
| 24 24 | 
             
                  @@re = haz_vars.map { |x|   x + '$' }.join( '|') 
         | 
| 25 25 | 
             
                  @@re = Regexp.new "(#{@@re})$"
         | 
| 26 26 |  | 
| @@ -142,16 +142,23 @@ module Neurogami | |
| 142 142 | 
             
                    write_to = location + real_path 
         | 
| 143 143 | 
             
                    destination_dir = File.expand_path(File.dirname(write_to))
         | 
| 144 144 | 
             
                    FileUtils.mkdir_p destination_dir
         | 
| 145 | 
            -
             | 
| 145 | 
            +
                    file_to_write_to  = File.expand_path write_to
         | 
| 146 | 
            +
                    rename( file_to_write_to ) if File.exist? file_to_write_to 
         | 
| 146 147 | 
             
                    # Do a straight file copy unless this file might be using Erb
         | 
| 147 148 | 
             
                    if path =~ @@re
         | 
| 148 149 | 
             
                      text = process_template path, var_set 
         | 
| 149 | 
            -
                      File.open( | 
| 150 | 
            +
                      File.open(file_to_write_to, "w"){|f| f.puts text }
         | 
| 150 151 | 
             
                    else
         | 
| 151 | 
            -
                      FileUtils.cp path,  | 
| 152 | 
            +
                      FileUtils.cp path, file_to_write_to
         | 
| 152 153 | 
             
                    end
         | 
| 153 154 | 
             
                  end
         | 
| 154 155 |  | 
| 156 | 
            +
             | 
| 157 | 
            +
                  def self.rename full_file_path
         | 
| 158 | 
            +
                    ts = Time.now.to_i.to_s
         | 
| 159 | 
            +
                    FileUtils.mv full_file_path, full_file_path + '.' + ts 
         | 
| 160 | 
            +
                  end
         | 
| 161 | 
            +
             | 
| 155 162 | 
             
                end
         | 
| 156 163 | 
             
              end
         | 
| 157 164 | 
             
            end
         | 
    
        data/lib/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: Neurogami-rhesus
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - James Britt / Neurogami
         | 
| @@ -9,7 +9,7 @@ autorequire: | |
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2009- | 
| 12 | 
            +
            date: 2009-08-08 00:00:00 -07:00
         | 
| 13 13 | 
             
            default_executable: rhesus
         | 
| 14 14 | 
             
            dependencies: 
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -56,6 +56,7 @@ files: | |
| 56 56 | 
             
            - test/test_rhesus.rb
         | 
| 57 57 | 
             
            has_rdoc: false
         | 
| 58 58 | 
             
            homepage: http://www.neurogami.com/code
         | 
| 59 | 
            +
            licenses: 
         | 
| 59 60 | 
             
            post_install_message: 
         | 
| 60 61 | 
             
            rdoc_options: 
         | 
| 61 62 | 
             
            - --main
         | 
| @@ -79,7 +80,7 @@ requirements: [] | |
| 79 80 | 
             
            rubyforge_project: !binary |
         | 
| 80 81 | 
             
              AA==
         | 
| 81 82 |  | 
| 82 | 
            -
            rubygems_version: 1. | 
| 83 | 
            +
            rubygems_version: 1.3.5
         | 
| 83 84 | 
             
            signing_key: 
         | 
| 84 85 | 
             
            specification_version: 3
         | 
| 85 86 | 
             
            summary: Really simple, practical code generator.
         |