enum_simulator 1.1.2 → 1.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.
- data/Manifest +1 -1
 - data/Rakefile +1 -1
 - data/enum_simulator.gemspec +3 -3
 - data/lib/enum_simulator.rb +10 -5
 - metadata +3 -3
 
    
        data/Manifest
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    | 
         @@ -23,7 +23,7 @@ RDoc::Task.new(:rdoc) do |rdoc| 
     | 
|
| 
       23 
23 
     | 
    
         
             
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
       24 
24 
     | 
    
         
             
            end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
            Echoe.new('enum_simulator', '1.1. 
     | 
| 
      
 26 
     | 
    
         
            +
            Echoe.new('enum_simulator', '1.1.3') do |p|
         
     | 
| 
       27 
27 
     | 
    
         
             
              p.description     = 'A simple plugin for abstracting out standard ActiveRecord enumerated attributes.'
         
     | 
| 
       28 
28 
     | 
    
         
             
              p.url             = 'https://github.com/centresource/enum_simulator.git'
         
     | 
| 
       29 
29 
     | 
    
         
             
              p.author          = ['Jeremy Holland', 'Brandon Valentine', 'Steven Warren']
         
     | 
    
        data/enum_simulator.gemspec
    CHANGED
    
    | 
         @@ -2,15 +2,15 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.name = "enum_simulator"
         
     | 
| 
       5 
     | 
    
         
            -
              s.version = "1.1. 
     | 
| 
      
 5 
     | 
    
         
            +
              s.version = "1.1.3"
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.authors = ["Jeremy Holland, Brandon Valentine, Steven Warren"]
         
     | 
| 
       9 
     | 
    
         
            -
              s.date = "2012-12- 
     | 
| 
      
 9 
     | 
    
         
            +
              s.date = "2012-12-26"
         
     | 
| 
       10 
10 
     | 
    
         
             
              s.description = "A simple plugin for abstracting out standard ActiveRecord enumerated attributes."
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.email = ["jeremy@jeremypholland.com", "brandon@brandonvalentine.com", "swarren@centresource.com"]
         
     | 
| 
       12 
12 
     | 
    
         
             
              s.extra_rdoc_files = ["README.rdoc", "lib/enum_simulator.rb"]
         
     | 
| 
       13 
     | 
    
         
            -
              s.files = ["Gemfile", "MIT-LICENSE", "README.rdoc", "Rakefile", "init.rb", "install.rb", "lib/enum_simulator.rb", "spec/enum_simulator_spec.rb", "spec/resources/schema", "spec/spec_helper.rb", "spec/support/models/Foo.rb", "spec/support/models/other_thingies.rb", "spec/support/models/thingy.rb", "uninstall.rb", " 
     | 
| 
      
 13 
     | 
    
         
            +
              s.files = ["Gemfile", "MIT-LICENSE", "Manifest", "README.rdoc", "Rakefile", "init.rb", "install.rb", "lib/enum_simulator.rb", "spec/enum_simulator_spec.rb", "spec/resources/schema", "spec/spec_helper.rb", "spec/support/models/Foo.rb", "spec/support/models/other_thingies.rb", "spec/support/models/thingy.rb", "uninstall.rb", "enum_simulator.gemspec"]
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.homepage = "https://github.com/centresource/enum_simulator.git"
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Enum_simulator", "--main", "README.rdoc"]
         
     | 
| 
       16 
16 
     | 
    
         
             
              s.require_paths = ["lib"]
         
     | 
    
        data/lib/enum_simulator.rb
    CHANGED
    
    | 
         @@ -7,12 +7,17 @@ module EnumSimulator 
     | 
|
| 
       7 
7 
     | 
    
         
             
              module ClassMethods
         
     | 
| 
       8 
8 
     | 
    
         
             
                def enum(attr, values)
         
     | 
| 
       9 
9 
     | 
    
         
             
                  val_dupe = values.dup
         
     | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 11 
     | 
    
         
            +
                    colhash = self.columns_hash
         
     | 
| 
      
 12 
     | 
    
         
            +
                    if colhash[attr.to_s].respond_to? :null and colhash[attr.to_s].null
         
     | 
| 
      
 13 
     | 
    
         
            +
                      if val_dupe.is_a? Hash
         
     | 
| 
      
 14 
     | 
    
         
            +
                        val_dupe[nil] = ""
         
     | 
| 
      
 15 
     | 
    
         
            +
                      else
         
     | 
| 
      
 16 
     | 
    
         
            +
                        val_dupe << nil
         
     | 
| 
      
 17 
     | 
    
         
            +
                      end
         
     | 
| 
       15 
18 
     | 
    
         
             
                    end
         
     | 
| 
      
 19 
     | 
    
         
            +
                  rescue
         
     | 
| 
      
 20 
     | 
    
         
            +
                    puts "Database connection not present or schema not loaded - Enum Simulator cannot determine nullability of its columns."
         
     | 
| 
       16 
21 
     | 
    
         
             
                  end
         
     | 
| 
       17 
22 
     | 
    
         
             
                  valid = val_dupe.is_a?(Hash) ? val_dupe.keys : val_dupe
         
     | 
| 
       18 
23 
     | 
    
         
             
                  @enumerated_attributes ||= {}
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: enum_simulator
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.3
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012-12- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-12-26 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       14 
14 
     | 
    
         
             
            description: A simple plugin for abstracting out standard ActiveRecord enumerated
         
     | 
| 
       15 
15 
     | 
    
         
             
              attributes.
         
     | 
| 
         @@ -25,6 +25,7 @@ extra_rdoc_files: 
     | 
|
| 
       25 
25 
     | 
    
         
             
            files:
         
     | 
| 
       26 
26 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       27 
27 
     | 
    
         
             
            - MIT-LICENSE
         
     | 
| 
      
 28 
     | 
    
         
            +
            - Manifest
         
     | 
| 
       28 
29 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
       29 
30 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       30 
31 
     | 
    
         
             
            - init.rb
         
     | 
| 
         @@ -37,7 +38,6 @@ files: 
     | 
|
| 
       37 
38 
     | 
    
         
             
            - spec/support/models/other_thingies.rb
         
     | 
| 
       38 
39 
     | 
    
         
             
            - spec/support/models/thingy.rb
         
     | 
| 
       39 
40 
     | 
    
         
             
            - uninstall.rb
         
     | 
| 
       40 
     | 
    
         
            -
            - Manifest
         
     | 
| 
       41 
41 
     | 
    
         
             
            - enum_simulator.gemspec
         
     | 
| 
       42 
42 
     | 
    
         
             
            homepage: https://github.com/centresource/enum_simulator.git
         
     | 
| 
       43 
43 
     | 
    
         
             
            licenses: []
         
     |