ohmage 0.0.3 → 0.0.4
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 +4 -4
- data/lib/ohmage/campaign.rb +5 -0
- data/lib/ohmage/cli.rb +11 -6
- data/lib/ohmage/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1b529813fac4bd1f2583b5a66a416486698b6c2b
         | 
| 4 | 
            +
              data.tar.gz: f0a0bbb1fb4d6e057ef7fb59a2ace3d268268d6d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 88ad714c926bfb372f9bb877bd6ac436aae25037c82d7df8389d6a204fef054a0cad4f9bebcd276e767891f6a0a7bdd701f1615021a5c99505b49b7139f06b14
         | 
| 7 | 
            +
              data.tar.gz: 9d7c731bb2e8c231d208fa6f5f6a322ea95813c2eb1c31fad547b46943212f76ffd8661d49007d58d8d75bcb0c858b408559b3156d0e948ec1dca6adefde5152
         | 
    
        data/lib/ohmage/campaign.rb
    CHANGED
    
    
    
        data/lib/ohmage/cli.rb
    CHANGED
    
    | @@ -13,20 +13,20 @@ module Ohmage | |
| 13 13 | 
             
                  option :search, aliases: :s, desc: 'a search string to limit the returned campaign list'
         | 
| 14 14 | 
             
                  def campaign
         | 
| 15 15 | 
             
                    ls = Ohmage.campaign_read(campaign_name_search: options[:search], output_format: 'short')
         | 
| 16 | 
            -
                    Ohmage:: | 
| 16 | 
            +
                    Ohmage::CliHelpers.format_output(ls, options[:table], [:name, :urn, :description], :urn)
         | 
| 17 17 | 
             
                  end
         | 
| 18 18 |  | 
| 19 19 | 
             
                  desc 'ls class <options>', 'Lists classes current user has access to'
         | 
| 20 20 | 
             
                  def clazz(urn_list = nil)
         | 
| 21 21 | 
             
                    ls = Ohmage.class_read(class_urn_list: urn_list)
         | 
| 22 | 
            -
                    Ohmage:: | 
| 22 | 
            +
                    Ohmage::CliHelpers.format_output(ls, options[:table], [:name, :urn, :description, :role, :users], :urn)
         | 
| 23 23 | 
             
                  end
         | 
| 24 24 |  | 
| 25 25 | 
             
                  desc 'ls user <options>', 'Lists users that match criteria of search, all viewable if no search'
         | 
| 26 26 | 
             
                  option :search, aliases: :s, desc: 'a search string to limit the returned user list'
         | 
| 27 27 | 
             
                  def user(username = nil)
         | 
| 28 28 | 
             
                    ls = Ohmage.user_read(user_list: username, username_search: options[:search])
         | 
| 29 | 
            -
                    Ohmage:: | 
| 29 | 
            +
                    Ohmage::CliHelpers.format_output(ls, options[:table], [:username, :email_address, :enabled, :admin, :new_account], :username)
         | 
| 30 30 | 
             
                  end
         | 
| 31 31 | 
             
                end
         | 
| 32 32 |  | 
| @@ -44,7 +44,7 @@ module Ohmage | |
| 44 44 | 
             
                                                  admin: options[:admin],
         | 
| 45 45 | 
             
                                                  enabled: options[:enabled],
         | 
| 46 46 | 
             
                                                  new_account: options[:new])
         | 
| 47 | 
            -
                    Ohmage:: | 
| 47 | 
            +
                    Ohmage::CliHelpers.format_output(new_user, options[:table], [:username], :username)
         | 
| 48 48 | 
             
                  end
         | 
| 49 49 |  | 
| 50 50 | 
             
                  desc 'create class <class_urn> <class_name> <options>', 'creates a new ohmage class with parameters'
         | 
| @@ -53,7 +53,7 @@ module Ohmage | |
| 53 53 | 
             
                    new_class = Ohmage.class_create(class_urn: urn,
         | 
| 54 54 | 
             
                                                    class_name: name,
         | 
| 55 55 | 
             
                                                    description: options[:description])
         | 
| 56 | 
            -
                    Ohmage:: | 
| 56 | 
            +
                    Ohmage::CliHelpers.format_output(new_class, options[:table], [:urn, :name, :description], :urn)
         | 
| 57 57 | 
             
                  end
         | 
| 58 58 | 
             
                end
         | 
| 59 59 |  | 
| @@ -67,6 +67,11 @@ module Ohmage | |
| 67 67 | 
             
                  def user(username)
         | 
| 68 68 | 
             
                    Ohmage.user_delete(user_list: username)
         | 
| 69 69 | 
             
                  end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
                  desc 'delete campaign <campaign_urn>', 'deletes an existing ohmage campaign'
         | 
| 72 | 
            +
                  def campaign(urn)
         | 
| 73 | 
            +
                    Ohmage.campaign_delete(campaign_urn: urn)
         | 
| 74 | 
            +
                  end
         | 
| 70 75 | 
             
                end
         | 
| 71 76 |  | 
| 72 77 | 
             
                class Update < Thor
         | 
| @@ -80,7 +85,7 @@ module Ohmage | |
| 80 85 | 
             
                                                      admin: options[:admin],
         | 
| 81 86 | 
             
                                                      enabled: options[:enabled],
         | 
| 82 87 | 
             
                                                      new_account: options[:new])
         | 
| 83 | 
            -
                    Ohmage:: | 
| 88 | 
            +
                    Ohmage::CliHelpers.format_output(updated_user, options[:table], [:username, :admin, :enabled, :new_account], :username)
         | 
| 84 89 | 
             
                  end
         | 
| 85 90 |  | 
| 86 91 | 
             
                  desc 'update password <username> <options>', "updates provided user's password"
         | 
    
        data/lib/ohmage/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ohmage
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Steve Nolen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015-03- | 
| 11 | 
            +
            date: 2015-03-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: addressable
         | 
| @@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 112 112 | 
             
                  version: 1.3.5
         | 
| 113 113 | 
             
            requirements: []
         | 
| 114 114 | 
             
            rubyforge_project: 
         | 
| 115 | 
            -
            rubygems_version: 2.4. | 
| 115 | 
            +
            rubygems_version: 2.4.4
         | 
| 116 116 | 
             
            signing_key: 
         | 
| 117 117 | 
             
            specification_version: 4
         | 
| 118 118 | 
             
            summary: A Ruby interface for the ohmage 2.x API.
         |