my_plugin 0.2.9 → 0.3.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.
- checksums.yaml +8 -8
 - data/lib/my_plugin/version.rb +1 -1
 - data/lib/tasks/my_plugin.rake +8 -8
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                NzBlNmZkZGU5NWFhNjVhMTI1M2RhOTY4Y2Y4ZDcyODQwYWZkZDFmMQ==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                MWUzNDFjNGQyYjcyNDMwZTczYWY0N2I3NWVkZGM4YmIxNDUxNjMzZA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                YTk3ODJkODYwYmMwYTQ3ODA5YjdiMWUwNDFjODU4MTM5YTQ4MWVjMTE4MWY0
         
     | 
| 
      
 10 
     | 
    
         
            +
                Y2ZhMjQwMjE2ZmU4YTIwZTFmYjJlZTJmN2U5M2QzMjY3MDA1YjI0NzZjY2I5
         
     | 
| 
      
 11 
     | 
    
         
            +
                ODg2ZDJjM2YxMDk2MjhmYjhiNzI3MTk2NzIwMzA2NWVjMjM5OWM=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                NGRmOTcyMDBjM2M3OTc5ODhmZTYxZDNjNDZhYzNmNmVmZTQxYzY0MTgwYzRl
         
     | 
| 
      
 14 
     | 
    
         
            +
                Y2Q0OGQxOGE1NzkyMmU4MDdlN2MxN2Q5MWE0MWJjYzNlYjA5NjkwNWJkM2Y0
         
     | 
| 
      
 15 
     | 
    
         
            +
                MWI0ODEwYzFmNDQzZDVkYWIzMjUxNjA4YTI4NTU3MmNlZmE3Yzc=
         
     | 
    
        data/lib/my_plugin/version.rb
    CHANGED
    
    
    
        data/lib/tasks/my_plugin.rake
    CHANGED
    
    | 
         @@ -5,28 +5,28 @@ namespace :db do 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
                model_class          = ENV['model']
         
     | 
| 
       7 
7 
     | 
    
         
             
                key_pair             = ENV['key_pair']
         
     | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
      
 8 
     | 
    
         
            +
                found_by_id       = ENV['found_by_id']
         
     | 
| 
      
 9 
     | 
    
         
            +
                found_by_id = found_by_id.to_i
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                model_class = model_class.constantize
         
     | 
| 
       12 
12 
     | 
    
         
             
                puts "#{pick(model_class).username}"
         
     | 
| 
       13 
     | 
    
         
            -
                puts "#{set(model_class,  
     | 
| 
       14 
     | 
    
         
            -
                puts "#{get(model_class,  
     | 
| 
      
 13 
     | 
    
         
            +
                puts "#{set(model_class, found_by_id, key_pair)}"
         
     | 
| 
      
 14 
     | 
    
         
            +
                puts "#{get(model_class, found_by_id, key_pair)}"
         
     | 
| 
       15 
15 
     | 
    
         
             
              end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
              desc "Set model attribute"
         
     | 
| 
       18 
18 
     | 
    
         
             
              task :setter => :field
         
     | 
| 
       19 
     | 
    
         
            -
              def set(model_class,  
     | 
| 
      
 19 
     | 
    
         
            +
              def set(model_class, found_by_id, key_pair)
         
     | 
| 
       20 
20 
     | 
    
         
             
                puts "putting value in model attribute"
         
     | 
| 
       21 
     | 
    
         
            -
                obj = model_class. 
     | 
| 
      
 21 
     | 
    
         
            +
                obj = model_class.find(found_by_id)
         
     | 
| 
       22 
22 
     | 
    
         
             
                obj.nickname = Hash[*key_pair.split(',')]
         
     | 
| 
       23 
23 
     | 
    
         
             
              end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
              desc "Get model attribute"
         
     | 
| 
       26 
26 
     | 
    
         
             
              task :getter => :field
         
     | 
| 
       27 
     | 
    
         
            -
              def get(model_class, found_by_field,  
     | 
| 
      
 27 
     | 
    
         
            +
              def get(model_class, found_by_field, key_pair)
         
     | 
| 
       28 
28 
     | 
    
         
             
                puts "getting value in model attribute"
         
     | 
| 
       29 
     | 
    
         
            -
                obj = model_class. 
     | 
| 
      
 29 
     | 
    
         
            +
                obj = model_class.find(found_by_id)
         
     | 
| 
       30 
30 
     | 
    
         
             
                obj.nickname
         
     | 
| 
       31 
31 
     | 
    
         
             
              end
         
     | 
| 
       32 
32 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: my_plugin
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sohair Ahmad
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-12-01 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |