zensana 1.4.1 → 1.5.0
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/README.md +5 -1
 - data/lib/zensana/commands/project.rb +23 -9
 - data/lib/zensana/models/zendesk/attachment.rb +5 -1
 - data/lib/zensana/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e97fa7d7b90bac8416207fa5ac106977a9b9d740
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f2e42a59aa59a9c59816e9e019ea300b21949f2c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8b8fe064dbcb2448348314366fec7874144b42f20ee5f4acf123263a813998026ffa60ca2aea628461567c48f3c7544adf274d6ff03cffae509bec7e58f9984e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b0ce73be4a761d0d615ef3aaba765bf60b2a605ab9f4818f989a91c45ea04989779f6aa33ce07b8abb0dd33764cb6656b927a3388614a2cf3841affdf5aa4740
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -55,9 +55,13 @@ control what gets converted. 
     | 
|
| 
       55 
55 
     | 
    
         
             
                    -a, [--attachments], [--no-attachments]  # download and upload any attachments
         
     | 
| 
       56 
56 
     | 
    
         
             
                                                             # Default: true
         
     | 
| 
       57 
57 
     | 
    
         
             
                    -c, [--completed], [--no-completed]      # include tasks that are completed
         
     | 
| 
       58 
     | 
    
         
            -
                    - 
     | 
| 
      
 58 
     | 
    
         
            +
                    -f, [--followers], [--no-followers]      # add task followers to ticket as cc
         
     | 
| 
      
 59 
     | 
    
         
            +
                    -t, [--global-tags=one two three]        # array of tag(s) to be applied to every ticket imported
         
     | 
| 
      
 60 
     | 
    
         
            +
                                                             # Default: ["zensana"]
         
     | 
| 
      
 61 
     | 
    
         
            +
                    -g, [--group-id=N]                       # ZenDesk group_id to assign tickets to - must not conflict with default_user
         
     | 
| 
       59 
62 
     | 
    
         
             
                    -s, [--stories], [--no-stories]          # import stories as comments
         
     | 
| 
       60 
63 
     | 
    
         
             
                                                             # Default: true
         
     | 
| 
      
 64 
     | 
    
         
            +
                    -u, [--default-user=DEFAULT_USER]        # set a default user to assign to invalid asana user items
         
     | 
| 
       61 
65 
     | 
    
         
             
                    -v, [--verified], [--no-verified]        # `false` will send email to zendesk users created
         
     | 
| 
       62 
66 
     | 
    
         
             
                                                             # Default: true
         
     | 
| 
       63 
67 
     | 
    
         | 
| 
         @@ -31,6 +31,7 @@ module Zensana 
     | 
|
| 
       31 
31 
     | 
    
         
             
                desc 'convert PROJECT', 'Convert PROJECT tasks to ZenDesk tickets (exact ID or NAME required)'
         
     | 
| 
       32 
32 
     | 
    
         
             
                option :attachments,  type: 'boolean', aliases: '-a', default: true,        desc: 'download and upload any attachments'
         
     | 
| 
       33 
33 
     | 
    
         
             
                option :completed,    type: 'boolean', aliases: '-c', default: false,       desc: 'include tasks that are completed'
         
     | 
| 
      
 34 
     | 
    
         
            +
                option :followers,    type: 'boolean', aliases: '-f', default: false,       desc: 'add task followers to ticket as cc'
         
     | 
| 
       34 
35 
     | 
    
         
             
                option :global_tags,  type: 'array',   aliases: '-t', default: ['zensana'], desc: 'array of tag(s) to be applied to every ticket imported'
         
     | 
| 
       35 
36 
     | 
    
         
             
                option :group_id,     type: 'numeric', aliases: '-g', default: nil,         desc: 'ZenDesk group_id to assign tickets to - must not conflict with default_user'
         
     | 
| 
       36 
37 
     | 
    
         
             
                option :stories,      type: 'boolean', aliases: '-s', default: true,        desc: 'import stories as comments'
         
     | 
| 
         @@ -174,12 +175,21 @@ using options #{options} 
     | 
|
| 
       174 
175 
     | 
    
         
             
                        end
         
     | 
| 
       175 
176 
     | 
    
         
             
                      end
         
     | 
| 
       176 
177 
     | 
    
         | 
| 
      
 178 
     | 
    
         
            +
                      # add followers as collaborators
         
     | 
| 
      
 179 
     | 
    
         
            +
                      if options[:followers]
         
     | 
| 
      
 180 
     | 
    
         
            +
                        collaborators = []
         
     | 
| 
      
 181 
     | 
    
         
            +
                        task.followers.each do |follower|
         
     | 
| 
      
 182 
     | 
    
         
            +
                          unless follower == task.created_by
         
     | 
| 
      
 183 
     | 
    
         
            +
                            if collaborator = asana_to_zendesk_user(follower, true)
         
     | 
| 
      
 184 
     | 
    
         
            +
                              collaborators << collaborator.id
         
     | 
| 
      
 185 
     | 
    
         
            +
                            end
         
     | 
| 
      
 186 
     | 
    
         
            +
                          end
         
     | 
| 
      
 187 
     | 
    
         
            +
                        end
         
     | 
| 
      
 188 
     | 
    
         
            +
                      end
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
       177 
190 
     | 
    
         
             
                      # ready to import the ticket now!
         
     | 
| 
       178 
191 
     | 
    
         
             
                      ticket = Zensana::Zendesk::Ticket.new(
         
     | 
| 
       179 
     | 
    
         
            -
                        : 
     | 
| 
       180 
     | 
    
         
            -
                        :external_id  => task.id,
         
     | 
| 
       181 
     | 
    
         
            -
                        :subject      => task.name,
         
     | 
| 
       182 
     | 
    
         
            -
                        :description  => <<-EOF,
         
     | 
| 
      
 192 
     | 
    
         
            +
                        :description      => <<-EOF,
         
     | 
| 
       183 
193 
     | 
    
         
             
                        This is an Asana task imported using zensana @ #{Time.now}
         
     | 
| 
       184 
194 
     | 
    
         | 
| 
       185 
195 
     | 
    
         
             
                                Project:  #{@asana_project.name} (#{@asana_project.id})
         
     | 
| 
         @@ -188,11 +198,15 @@ using options #{options} 
     | 
|
| 
       188 
198 
     | 
    
         | 
| 
       189 
199 
     | 
    
         
             
                        Task attributes:  #{task.attributes}
         
     | 
| 
       190 
200 
     | 
    
         
             
                        EOF
         
     | 
| 
       191 
     | 
    
         
            -
                        : 
     | 
| 
       192 
     | 
    
         
            -
                        : 
     | 
| 
       193 
     | 
    
         
            -
                        : 
     | 
| 
       194 
     | 
    
         
            -
                        : 
     | 
| 
       195 
     | 
    
         
            -
                        : 
     | 
| 
      
 201 
     | 
    
         
            +
                        :requester_id     => requester.id,
         
     | 
| 
      
 202 
     | 
    
         
            +
                        :external_id      => task.id,
         
     | 
| 
      
 203 
     | 
    
         
            +
                        :subject          => task.name,
         
     | 
| 
      
 204 
     | 
    
         
            +
                        :assignee_id      => zendesk_assignee_id(task.attributes['assignee']),
         
     | 
| 
      
 205 
     | 
    
         
            +
                        :group_id         => options[:group_id],
         
     | 
| 
      
 206 
     | 
    
         
            +
                        :created_at       => task.created_at,
         
     | 
| 
      
 207 
     | 
    
         
            +
                        :tags             => flatten_tags(project_tags, section_tags),
         
     | 
| 
      
 208 
     | 
    
         
            +
                        :comments         => comments,
         
     | 
| 
      
 209 
     | 
    
         
            +
                        :collaborator_ids => collaborators
         
     | 
| 
       196 
210 
     | 
    
         
             
                      )
         
     | 
| 
       197 
211 
     | 
    
         
             
                      ticket.import
         
     | 
| 
       198 
212 
     | 
    
         
             
                      say "\n >>> ticket successfully imported ", :green
         
     | 
| 
         @@ -32,13 +32,17 @@ module Zensana 
     | 
|
| 
       32 
32 
     | 
    
         
             
                      :headers => {
         
     | 
| 
       33 
33 
     | 
    
         
             
                        "Content-Type" => "application/binary"
         
     | 
| 
       34 
34 
     | 
    
         
             
                      },
         
     | 
| 
       35 
     | 
    
         
            -
                      :detect_mime_type =>  
     | 
| 
      
 35 
     | 
    
         
            +
                      :detect_mime_type => mime_type_known?(file),
         
     | 
| 
       36 
36 
     | 
    
         
             
                      :body => {
         
     | 
| 
       37 
37 
     | 
    
         
             
                        "filename"      => "#{File.basename(file)}",
         
     | 
| 
       38 
38 
     | 
    
         
             
                        "uploaded_data" => File.new(file)
         
     | 
| 
       39 
39 
     | 
    
         
             
                      },
         
     | 
| 
       40 
40 
     | 
    
         
             
                      )['upload']
         
     | 
| 
       41 
41 
     | 
    
         
             
                  end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  def mime_type_known?(file)
         
     | 
| 
      
 44 
     | 
    
         
            +
                    ! [ '.cshtml' ].include? File.extname(file)
         
     | 
| 
      
 45 
     | 
    
         
            +
                  end
         
     | 
| 
       42 
46 
     | 
    
         
             
                end
         
     | 
| 
       43 
47 
     | 
    
         
             
              end
         
     | 
| 
       44 
48 
     | 
    
         
             
            end
         
     | 
    
        data/lib/zensana/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: zensana
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.5.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Warren Bain
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-06-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: awesome_print
         
     |