agig 0.1.2 → 0.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/agig.gemspec +2 -0
- data/lib/agig/session.rb +3 -1
- data/lib/agig/version.rb +1 -1
- data/spec/lib/agig/session_spec.rb +21 -0
- data/spec/spec_helper.rb +5 -0
- metadata +22 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: df12190a9b82939baf71234bbd20dd699dacf935
         | 
| 4 | 
            +
              data.tar.gz: ed95458598389d929037c065c455cd5993520a3e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a428a8f562514f82af29f7a6a5b068019d0ae934d072ebb265f30dd27e1005f9de301db98db98d9c39cf59d7a318b5911c8122ce01c4146696d4c48ad17c3740
         | 
| 7 | 
            +
              data.tar.gz: 290768691ec03b4c756cf1a63576a256c895d32c455e6aec06c61caf0ccb73d4372680955266cd46fd6b42799aa58d0ab441c30f8552b776c0484edf18c9fb53
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/.rspec
    ADDED
    
    
    
        data/agig.gemspec
    CHANGED
    
    
    
        data/lib/agig/session.rb
    CHANGED
    
    | @@ -89,7 +89,9 @@ class Agig::Session < Net::IRC::Server::Session | |
| 89 89 | 
             
                if issue_match = latest_comment_url.match(/(?:issues|pulls)\/(\d+?)$/)
         | 
| 90 90 | 
             
                  issue_id = issue_match[1]
         | 
| 91 91 | 
             
                  latest_comment = client.issue_comments(repos_owner, issue_id).last
         | 
| 92 | 
            -
                  latest_comment ? | 
| 92 | 
            +
                  latest_comment ?
         | 
| 93 | 
            +
                    latest_comment['html_url'] :
         | 
| 94 | 
            +
                    latest_comment_url.sub(/api\./, '').sub(/repos\//, '').sub(/pulls\//, 'pull/')
         | 
| 93 95 | 
             
                elsif comment_match = latest_comment_url.match(/comments\/(\d+?)$/)
         | 
| 94 96 | 
             
                  comment_id = comment_match[1]
         | 
| 95 97 | 
             
                  client.issue_comment(repos_owner, comment_id)['html_url']
         | 
    
        data/lib/agig/version.rb
    CHANGED
    
    
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            # coding: utf-8
         | 
| 2 | 
            +
            require File.expand_path('../../../spec_helper', __FILE__)
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            describe Agig::Session do
         | 
| 5 | 
            +
              before do
         | 
| 6 | 
            +
                @session = described_class.new('localhost', nil, nil)
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              describe '#reachable_url_for' do
         | 
| 10 | 
            +
                subject { @session.reachable_url_for(latest_comment_url) }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                context 'When "https://api.github.com/repos/fastladder/fastladder/pulls/170" given' do
         | 
| 13 | 
            +
                  before do
         | 
| 14 | 
            +
                    @session.stub_chain(:client, :issue_comments).and_return([])
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                  let(:latest_comment_url) { 'https://api.github.com/repos/fastladder/fastladder/pulls/170' }
         | 
| 18 | 
            +
                  it { should eq('https://github.com/fastladder/fastladder/pull/170') }
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    ADDED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: agig
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - SHIBATA Hiroshi
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2013- | 
| 11 | 
            +
            date: 2013-05-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: net-irc
         | 
| @@ -52,6 +52,20 @@ dependencies: | |
| 52 52 | 
             
                - - '>='
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: rspec
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - '>='
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '0'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - '>='
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '0'
         | 
| 55 69 | 
             
            description: another Github IRC Gateway
         | 
| 56 70 | 
             
            email:
         | 
| 57 71 | 
             
            - shibata.hiroshi@gmail.com
         | 
| @@ -61,6 +75,7 @@ extensions: [] | |
| 61 75 | 
             
            extra_rdoc_files: []
         | 
| 62 76 | 
             
            files:
         | 
| 63 77 | 
             
            - .gitignore
         | 
| 78 | 
            +
            - .rspec
         | 
| 64 79 | 
             
            - Gemfile
         | 
| 65 80 | 
             
            - LICENSE
         | 
| 66 81 | 
             
            - README.md
         | 
| @@ -72,6 +87,8 @@ files: | |
| 72 87 | 
             
            - lib/agig/optparse.rb
         | 
| 73 88 | 
             
            - lib/agig/session.rb
         | 
| 74 89 | 
             
            - lib/agig/version.rb
         | 
| 90 | 
            +
            - spec/lib/agig/session_spec.rb
         | 
| 91 | 
            +
            - spec/spec_helper.rb
         | 
| 75 92 | 
             
            homepage: https://github.com/hsbt/agig
         | 
| 76 93 | 
             
            licenses: []
         | 
| 77 94 | 
             
            metadata: {}
         | 
| @@ -96,5 +113,7 @@ signing_key: | |
| 96 113 | 
             
            specification_version: 4
         | 
| 97 114 | 
             
            summary: agig is another Github IRC Gateway. agig is forked from gig.rb, and contained
         | 
| 98 115 | 
             
              net-irc gems.
         | 
| 99 | 
            -
            test_files: | 
| 116 | 
            +
            test_files:
         | 
| 117 | 
            +
            - spec/lib/agig/session_spec.rb
         | 
| 118 | 
            +
            - spec/spec_helper.rb
         | 
| 100 119 | 
             
            has_rdoc: 
         |