hitch 1.0.3 → 1.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/hitch.gemspec +2 -1
- data/lib/hitch.rb +1 -1
- data/lib/hitch/ui.rb +1 -1
- data/spec/hitch/ui_spec.rb +26 -6
- metadata +4 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e31466745b18c78b3065e2ce0fb9ef2ac902f1fe
         | 
| 4 | 
            +
              data.tar.gz: 161bd434fdcd957688805804e6a8d2b64498e96e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b1fbfe1d1ec0f90441f444ae85f66d7fe2e595841258dcdec552ddb7c45373213df446020996a95f5ac7f533718acf349b07933a11c8f7f433d59cc1888f84e5
         | 
| 7 | 
            +
              data.tar.gz: 348ad63679b1173ff0a0418b091d666deca5efe9fdf3019ed64e4f43c5c7c9efe70077a0348233691560e30af386cdabba3a2eeaceebb9bb456aae68dd155b61
         | 
    
        data/hitch.gemspec
    CHANGED
    
    | @@ -4,8 +4,9 @@ Gem::Specification.new do |s| | |
| 4 4 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 5 5 | 
             
              s.rubygems_version = '1.3.5'
         | 
| 6 6 |  | 
| 7 | 
            +
              s.license = "MIT"
         | 
| 7 8 | 
             
              s.name = %q{hitch}
         | 
| 8 | 
            -
              s.version = '1.0. | 
| 9 | 
            +
              s.version = '1.0.4'
         | 
| 9 10 | 
             
              s.date = Time.now.strftime('%F')
         | 
| 10 11 |  | 
| 11 12 | 
             
              s.description = %q{Git author attribution helper for pair programmers.}
         | 
    
        data/lib/hitch.rb
    CHANGED
    
    
    
        data/lib/hitch/ui.rb
    CHANGED
    
    | @@ -6,7 +6,7 @@ module Hitch | |
| 6 6 | 
             
                def self.prompt_for_group_email
         | 
| 7 7 | 
             
                  Hitch.group_email = highline.ask("What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com") do |q|
         | 
| 8 8 | 
             
                    q.case = :down
         | 
| 9 | 
            -
                    q.validate = /\A[a-zA-Z0-9_ | 
| 9 | 
            +
                    q.validate = /\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/
         | 
| 10 10 | 
             
                  end.to_s
         | 
| 11 11 | 
             
                end
         | 
| 12 12 |  | 
    
        data/spec/hitch/ui_spec.rb
    CHANGED
    
    | @@ -4,20 +4,40 @@ describe Hitch::UI do | |
| 4 4 |  | 
| 5 5 | 
             
              describe '.prompt_for_group_email' do
         | 
| 6 6 |  | 
| 7 | 
            +
                let(:question_message) { "What is the group email? e.g. dev@hashrocket.com will become dev+therubymug+leshill@hashrocket.com" }
         | 
| 8 | 
            +
             | 
| 7 9 | 
             
                it 'prompts for group email' do
         | 
| 8 | 
            -
                  Hitch::UI.highline.should_receive(:ask).with( | 
| 10 | 
            +
                  Hitch::UI.highline.should_receive(:ask).with(question_message)
         | 
| 9 11 | 
             
                  Hitch::UI.prompt_for_group_email
         | 
| 10 12 | 
             
                end
         | 
| 11 13 |  | 
| 12 14 | 
             
                it 'returns the given group email' do
         | 
| 13 | 
            -
                  Hitch::UI.highline.stub(:ask).with( | 
| 15 | 
            +
                  Hitch::UI.highline.stub(:ask).with(question_message).and_return('dev@hashrocket.com')
         | 
| 14 16 | 
             
                  Hitch::UI.prompt_for_group_email.should == 'dev@hashrocket.com'
         | 
| 15 17 | 
             
                end
         | 
| 16 18 |  | 
| 17 | 
            -
                 | 
| 18 | 
            -
                   | 
| 19 | 
            -
                   | 
| 20 | 
            -
             | 
| 19 | 
            +
                context 'when group email contains a `+` in it' do
         | 
| 20 | 
            +
                  let(:group_email) { 'dev+hitch@hashrocket.com' }
         | 
| 21 | 
            +
                  it 'sets Hitch.group_email' do
         | 
| 22 | 
            +
                    question = double({:case= => nil, :validate= => nil})
         | 
| 23 | 
            +
                    question.should_receive(:case=).with(:down)
         | 
| 24 | 
            +
                    question.should_receive(:validate=).with(/\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/)
         | 
| 25 | 
            +
                    Hitch.should_receive('group_email=').with(group_email)
         | 
| 26 | 
            +
                    Hitch::UI.highline.stub(:ask).with(question_message).and_yield(question).and_return(group_email)
         | 
| 27 | 
            +
                    Hitch::UI.prompt_for_group_email
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                context 'when group email does not contain a `+` in it' do
         | 
| 32 | 
            +
                  let(:group_email) { 'dev@hashrocket.com' }
         | 
| 33 | 
            +
                  it 'sets Hitch.group_email' do
         | 
| 34 | 
            +
                    question = double({:case= => nil, :validate= => nil})
         | 
| 35 | 
            +
                    question.should_receive(:case=).with(:down)
         | 
| 36 | 
            +
                    question.should_receive(:validate=).with(/\A[a-zA-Z0-9_\.\-\+]+@[a-zA-Z1-9\-]+\.[a-zA-Z0-9\-\.]+\z/)
         | 
| 37 | 
            +
                    Hitch.should_receive('group_email=').with(group_email)
         | 
| 38 | 
            +
                    Hitch::UI.highline.stub(:ask).with(question_message).and_yield(question).and_return(group_email)
         | 
| 39 | 
            +
                    Hitch::UI.prompt_for_group_email
         | 
| 40 | 
            +
                  end
         | 
| 21 41 | 
             
                end
         | 
| 22 42 |  | 
| 23 43 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hitch
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Rogelio J. Samour
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015- | 
| 11 | 
            +
            date: 2015-10-20 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rspec
         | 
| @@ -65,7 +65,8 @@ files: | |
| 65 65 | 
             
            - spec/hitch_spec.rb
         | 
| 66 66 | 
             
            - spec/spec_helper.rb
         | 
| 67 67 | 
             
            homepage: http://github.com/therubymug/hitch
         | 
| 68 | 
            -
            licenses: | 
| 68 | 
            +
            licenses:
         | 
| 69 | 
            +
            - MIT
         | 
| 69 70 | 
             
            metadata: {}
         | 
| 70 71 | 
             
            post_install_message: 
         | 
| 71 72 | 
             
            rdoc_options:
         |