relish 0.0.1 → 0.0.2
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.
- data/.gitignore +2 -1
 - data/LICENSE +1 -1
 - data/Rakefile +6 -1
 - data/bin/relish +3 -1
 - data/cucumber.yml +1 -0
 - data/features/push.feature +10 -6
 - data/features/step_definitions/aruba.rb +7 -0
 - data/features/step_definitions/fake_web_steps.rb +8 -0
 - data/features/step_definitions/relish_steps.rb +6 -0
 - data/features/support/env.rb +4 -1
 - data/lib/relish/command.rb +17 -1
 - data/lib/relish/commands/base.rb +26 -22
 - data/lib/relish/commands/config.rb +10 -0
 - data/lib/relish/commands/push.rb +9 -7
 - data/relish.gemspec +14 -8
 - data/spec/relish/command_spec.rb +12 -0
 - data/spec/relish/commands/base_spec.rb +65 -26
 - data/spec/relish/commands/push_spec.rb +19 -12
 - data/spec/spec_helper.rb +5 -1
 - metadata +49 -47
 - data/Gemfile.lock +0 -53
 - data/lib/relish.rb +0 -2
 - data/lib/relish/cli/options.rb +0 -51
 - data/lib/relish/cli/runner.rb +0 -12
 - data/lib/relish/helpers.rb +0 -15
 
    
        data/.gitignore
    CHANGED
    
    
    
        data/LICENSE
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    
    
        data/bin/relish
    CHANGED
    
    | 
         @@ -1,8 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
2 
     | 
    
         
             
            $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
      
 4 
     | 
    
         
            +
            require 'relish/command'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       4 
6 
     | 
    
         
             
            args = ARGV.dup
         
     | 
| 
       5 
7 
     | 
    
         
             
            ARGV.clear
         
     | 
| 
       6 
8 
     | 
    
         
             
            command = args.shift.strip rescue 'help'
         
     | 
| 
       7 
9 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
            Relish:: 
     | 
| 
      
 10 
     | 
    
         
            +
            Relish::Command.run(command, args)
         
     | 
    
        data/cucumber.yml
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            default: --format progress
         
     | 
    
        data/features/push.feature
    CHANGED
    
    | 
         @@ -1,8 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            @announce
         
     | 
| 
       1 
2 
     | 
    
         
             
            Feature: Push
         
     | 
| 
       2 
     | 
    
         
            -
               
     | 
| 
       3 
     | 
    
         
            -
               
     | 
| 
       4 
     | 
    
         
            -
              I want  
     | 
| 
      
 3 
     | 
    
         
            +
              In order to send my features to relishapp.com
         
     | 
| 
      
 4 
     | 
    
         
            +
              As a Relish user dev
         
     | 
| 
      
 5 
     | 
    
         
            +
              I want a push command
         
     | 
| 
       5 
6 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
               
     | 
| 
       7 
     | 
    
         
            -
                Given  
     | 
| 
       8 
     | 
    
         
            -
              
         
     | 
| 
      
 7 
     | 
    
         
            +
              Background:
         
     | 
| 
      
 8 
     | 
    
         
            +
                Given my API token "1234" is stored
         
     | 
| 
      
 9 
     | 
    
         
            +
              
         
     | 
| 
      
 10 
     | 
    
         
            +
              Scenario: Specify everything at the command-line
         
     | 
| 
      
 11 
     | 
    
         
            +
                When I run relish push --host localhost:1234 --project p
         
     | 
| 
      
 12 
     | 
    
         
            +
                When it should POST to "http://localhost:1234/pushes?project_id=p&api_token=1234"
         
     | 
| 
         @@ -0,0 +1,8 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'fake_web'
         
     | 
| 
      
 2 
     | 
    
         
            +
            FakeWeb.allow_net_connect = false
         
     | 
| 
      
 3 
     | 
    
         
            +
            FakeWeb.register_uri(:any, /.*/, :body => "Faked HTTP response")
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            When /^it should POST to "http:\/\/localhost:1234([^"]*)"$/ do |path|
         
     | 
| 
      
 6 
     | 
    
         
            +
              request = FakeWeb.last_request || raise("Fakeweb did not record a request.")
         
     | 
| 
      
 7 
     | 
    
         
            +
              request.path.should == path
         
     | 
| 
      
 8 
     | 
    
         
            +
            end
         
     | 
    
        data/features/support/env.rb
    CHANGED
    
    
    
        data/lib/relish/command.rb
    CHANGED
    
    | 
         @@ -1,2 +1,18 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'relish/commands/base'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'relish/commands/push'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'relish/commands/push'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module Relish
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Command
         
     | 
| 
      
 6 
     | 
    
         
            +
                
         
     | 
| 
      
 7 
     | 
    
         
            +
                def self.run(command, args)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  command_class, method = get_command_and_method(command, args)      
         
     | 
| 
      
 9 
     | 
    
         
            +
                  command_class.new(args).send(method)
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
                
         
     | 
| 
      
 12 
     | 
    
         
            +
                def self.get_command_and_method(command, args)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  command_class, method = command.split(':')
         
     | 
| 
      
 14 
     | 
    
         
            +
                  return Relish::Command.const_get(command_class.capitalize), (method || :default)
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
                
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/relish/commands/base.rb
    CHANGED
    
    | 
         @@ -1,41 +1,45 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require ' 
     | 
| 
      
 1 
     | 
    
         
            +
            require 'yaml'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Relish
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Command
         
     | 
| 
       5 
5 
     | 
    
         
             
                class Base
         
     | 
| 
       6 
     | 
    
         
            -
                  include Relish::Helpers
         
     | 
| 
       7 
     | 
    
         
            -
                  
         
     | 
| 
       8 
6 
     | 
    
         
             
                  DEFAULT_HOST = 'relishapp.com'
         
     | 
| 
      
 7 
     | 
    
         
            +
                  GLOBAL_OPTIONS_FILE = File.join(File.expand_path('~'), '.relish')
         
     | 
| 
       9 
8 
     | 
    
         
             
                  LOCAL_OPTIONS_FILE = '.relish'
         
     | 
| 
       10 
9 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                   
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
                  attr_reader :args
         
     | 
| 
      
 11 
     | 
    
         
            +
                  
         
     | 
| 
      
 12 
     | 
    
         
            +
                  def initialize(args)
         
     | 
| 
      
 13 
     | 
    
         
            +
                    @args = args
         
     | 
| 
      
 14 
     | 
    
         
            +
                    @options = get_options
         
     | 
| 
       13 
15 
     | 
    
         
             
                  end
         
     | 
| 
       14 
16 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
                   
     | 
| 
       16 
     | 
    
         
            -
                     
     | 
| 
       17 
     | 
    
         
            -
                      @options[meth] || parse_options_file[meth]
         
     | 
| 
       18 
     | 
    
         
            -
                    end
         
     | 
| 
      
 17 
     | 
    
         
            +
                  def organization
         
     | 
| 
      
 18 
     | 
    
         
            +
                    @options['--organization'] || @options['-o'] || parsed_options_file['organization']
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                  def  
     | 
| 
       22 
     | 
    
         
            -
                    @options[ 
     | 
| 
      
 21 
     | 
    
         
            +
                  def project
         
     | 
| 
      
 22 
     | 
    
         
            +
                    @options['--project'] || @options['-p'] || parsed_options_file['project']
         
     | 
| 
       23 
23 
     | 
    
         
             
                  end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
                  def  
     | 
| 
       26 
     | 
    
         
            -
                    @ 
     | 
| 
       27 
     | 
    
         
            -
                      if File.exist?(LOCAL_OPTIONS_FILE)
         
     | 
| 
       28 
     | 
    
         
            -
                        parser = Trollop::Parser.new
         
     | 
| 
       29 
     | 
    
         
            -
                        parser.opt :account, "", :short => '-a', :type => String
         
     | 
| 
       30 
     | 
    
         
            -
                        parser.opt :project, "", :short => '-p', :type => String
         
     | 
| 
       31 
     | 
    
         
            -
                        parser.opt :version, "", :short => '-v', :type => String
         
     | 
| 
       32 
     | 
    
         
            -
                        parser.parse(File.read(LOCAL_OPTIONS_FILE).split)
         
     | 
| 
       33 
     | 
    
         
            -
                      else {} end
         
     | 
| 
       34 
     | 
    
         
            -
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
                  def host
         
     | 
| 
      
 26 
     | 
    
         
            +
                    @options['--host'] || DEFAULT_HOST
         
     | 
| 
       35 
27 
     | 
    
         
             
                  end
         
     | 
| 
       36 
28 
     | 
    
         | 
| 
       37 
29 
     | 
    
         
             
                  def api_token
         
     | 
| 
       38 
     | 
    
         
            -
                     
     | 
| 
      
 30 
     | 
    
         
            +
                    parsed_options_file['api_token']
         
     | 
| 
      
 31 
     | 
    
         
            +
                  end
         
     | 
| 
      
 32 
     | 
    
         
            +
                  
         
     | 
| 
      
 33 
     | 
    
         
            +
                  def get_options
         
     | 
| 
      
 34 
     | 
    
         
            +
                    parsed_options_file.merge(Hash[*args])
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
                  
         
     | 
| 
      
 37 
     | 
    
         
            +
                  def parsed_options_file
         
     | 
| 
      
 38 
     | 
    
         
            +
                    @parsed_options_file ||= {}.tap do |parsed_options|
         
     | 
| 
      
 39 
     | 
    
         
            +
                      [GLOBAL_OPTIONS_FILE, LOCAL_OPTIONS_FILE].each do |options_file|
         
     | 
| 
      
 40 
     | 
    
         
            +
                        parsed_options.merge!(YAML.load_file(options_file)) if File.exist?(options_file)
         
     | 
| 
      
 41 
     | 
    
         
            +
                      end
         
     | 
| 
      
 42 
     | 
    
         
            +
                    end
         
     | 
| 
       39 
43 
     | 
    
         
             
                  end
         
     | 
| 
       40 
44 
     | 
    
         | 
| 
       41 
45 
     | 
    
         
             
                end
         
     | 
    
        data/lib/relish/commands/push.rb
    CHANGED
    
    | 
         @@ -1,3 +1,4 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
       1 
2 
     | 
    
         
             
            require 'zlib'
         
     | 
| 
       2 
3 
     | 
    
         
             
            require 'archive/tar/minitar'
         
     | 
| 
       3 
4 
     | 
    
         
             
            require 'stringio'
         
     | 
| 
         @@ -7,6 +8,10 @@ module Relish 
     | 
|
| 
       7 
8 
     | 
    
         
             
              module Command
         
     | 
| 
       8 
9 
     | 
    
         
             
                class Push < Base
         
     | 
| 
       9 
10 
     | 
    
         | 
| 
      
 11 
     | 
    
         
            +
                  def default
         
     | 
| 
      
 12 
     | 
    
         
            +
                    run
         
     | 
| 
      
 13 
     | 
    
         
            +
                  end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  
         
     | 
| 
       10 
15 
     | 
    
         
             
                  def run
         
     | 
| 
       11 
16 
     | 
    
         
             
                    post files_as_tar_gz
         
     | 
| 
       12 
17 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -15,10 +20,7 @@ module Relish 
     | 
|
| 
       15 
20 
     | 
    
         
             
                    resource = RestClient::Resource.new(url)
         
     | 
| 
       16 
21 
     | 
    
         
             
                    resource.post(tar_gz_data, :content_type => 'application/x-gzip')
         
     | 
| 
       17 
22 
     | 
    
         
             
                    puts "sent:\n#{files.join("\n")}"
         
     | 
| 
       18 
     | 
    
         
            -
                  rescue RestClient:: 
     | 
| 
       19 
     | 
    
         
            -
                         RestClient::Unauthorized,
         
     | 
| 
       20 
     | 
    
         
            -
                         RestClient::BadRequest => exception
         
     | 
| 
       21 
     | 
    
         
            -
                         
         
     | 
| 
      
 23 
     | 
    
         
            +
                  rescue RestClient::Exception => exception
         
     | 
| 
       22 
24 
     | 
    
         
             
                    warn exception.response
         
     | 
| 
       23 
25 
     | 
    
         
             
                    exit 1
         
     | 
| 
       24 
26 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -26,7 +28,7 @@ module Relish 
     | 
|
| 
       26 
28 
     | 
    
         
             
                  def url
         
     | 
| 
       27 
29 
     | 
    
         
             
                    "".tap do |str|
         
     | 
| 
       28 
30 
     | 
    
         
             
                      str << "http://#{host}/pushes?"
         
     | 
| 
       29 
     | 
    
         
            -
                      str << " 
     | 
| 
      
 31 
     | 
    
         
            +
                      str << "creator_id=#{organization}&" if organization
         
     | 
| 
       30 
32 
     | 
    
         
             
                      str << "project_id=#{project}&"
         
     | 
| 
       31 
33 
     | 
    
         
             
                      str << "version_id=#{version}&" if version
         
     | 
| 
       32 
34 
     | 
    
         
             
                      str << "api_token=#{api_token}"
         
     | 
| 
         @@ -34,7 +36,7 @@ module Relish 
     | 
|
| 
       34 
36 
     | 
    
         
             
                  end
         
     | 
| 
       35 
37 
     | 
    
         | 
| 
       36 
38 
     | 
    
         
             
                  def version
         
     | 
| 
       37 
     | 
    
         
            -
                    @options[ 
     | 
| 
      
 39 
     | 
    
         
            +
                    @options['--version'] || @options['-v']
         
     | 
| 
       38 
40 
     | 
    
         
             
                  end
         
     | 
| 
       39 
41 
     | 
    
         | 
| 
       40 
42 
     | 
    
         
             
                  def files_as_tar_gz
         
     | 
| 
         @@ -52,7 +54,7 @@ module Relish 
     | 
|
| 
       52 
54 
     | 
    
         
             
                  end
         
     | 
| 
       53 
55 
     | 
    
         | 
| 
       54 
56 
     | 
    
         
             
                  def files
         
     | 
| 
       55 
     | 
    
         
            -
                    Dir['features/**/*.{feature,md}']
         
     | 
| 
      
 57 
     | 
    
         
            +
                    Dir['features/**/*.{feature,md,markdown}']
         
     | 
| 
       56 
58 
     | 
    
         
             
                  end
         
     | 
| 
       57 
59 
     | 
    
         | 
| 
       58 
60 
     | 
    
         
             
                end
         
     | 
    
        data/relish.gemspec
    CHANGED
    
    | 
         @@ -1,9 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
2 
     | 
    
         
             
              s.name = "relish"
         
     | 
| 
       3 
     | 
    
         
            -
              s.version = "0.0. 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version = "0.0.2"
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
              s.required_rubygems_version = '>= 1.3.5'
         
     | 
| 
       6 
     | 
    
         
            -
              s.authors = ["Matt  
     | 
| 
      
 6 
     | 
    
         
            +
              s.authors = ["Matt Wynne", "Justin Ko"]
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.date = "2010-09-23"
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.description = %q{Client gem for http://relishapp.com}
         
     | 
| 
       9 
9 
     | 
    
         
             
              s.email = "jko170@gmail.com"
         
     | 
| 
         @@ -16,17 +16,23 @@ Gem::Specification.new do |s| 
     | 
|
| 
       16 
16 
     | 
    
         
             
              s.require_path = "lib"
         
     | 
| 
       17 
17 
     | 
    
         
             
              s.files        = `git ls-files`.split("\n")
         
     | 
| 
       18 
18 
     | 
    
         
             
              s.test_files   = `git ls-files -- {spec,features}/*`.split("\n")
         
     | 
| 
      
 19 
     | 
    
         
            +
              s.executables  = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              {
         
     | 
| 
      
 22 
     | 
    
         
            +
                'archive-tar-minitar' => '~> 0.5.2',
         
     | 
| 
      
 23 
     | 
    
         
            +
                'rest-client'         => '~> 1.6.1',
         
     | 
| 
      
 24 
     | 
    
         
            +
              }.each do |lib, version|
         
     | 
| 
      
 25 
     | 
    
         
            +
                s.add_runtime_dependency lib, version
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
       19 
27 
     | 
    
         | 
| 
       20 
28 
     | 
    
         
             
              {
         
     | 
| 
       21 
29 
     | 
    
         
             
                'bundler'             => '~> 1.0.0',
         
     | 
| 
       22 
30 
     | 
    
         
             
                'rake'                => '~> 0.8.7',
         
     | 
| 
       23 
     | 
    
         
            -
                ' 
     | 
| 
       24 
     | 
    
         
            -
                'rest-client'         => '~> 1.6.1',
         
     | 
| 
       25 
     | 
    
         
            -
                'trollop'             => '~> 1.16.2',
         
     | 
| 
       26 
     | 
    
         
            -
                'rspec'               => '~> 2.0.0.beta.22',
         
     | 
| 
      
 31 
     | 
    
         
            +
                'rspec'               => '~> 2.0.0',
         
     | 
| 
       27 
32 
     | 
    
         
             
                'cucumber'            => '~> 0.9.1',
         
     | 
| 
       28 
     | 
    
         
            -
                'aruba'               => '~> 0.2.2'
         
     | 
| 
      
 33 
     | 
    
         
            +
                'aruba'               => '~> 0.2.2',
         
     | 
| 
      
 34 
     | 
    
         
            +
                'fakeweb'             => '~> 1.3.0'
         
     | 
| 
       29 
35 
     | 
    
         
             
              }.each do |lib, version|
         
     | 
| 
       30 
36 
     | 
    
         
             
                s.add_development_dependency lib, version
         
     | 
| 
       31 
37 
     | 
    
         
             
              end
         
     | 
| 
       32 
     | 
    
         
            -
            end
         
     | 
| 
      
 38 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Relish::Command do
         
     | 
| 
      
 4 
     | 
    
         
            +
              
         
     | 
| 
      
 5 
     | 
    
         
            +
              it "recognizes the 'push' command" do
         
     | 
| 
      
 6 
     | 
    
         
            +
                push = double
         
     | 
| 
      
 7 
     | 
    
         
            +
                push.should_receive(:default)
         
     | 
| 
      
 8 
     | 
    
         
            +
                Relish::Command::Push.should_receive(:new).with([]).and_return(push)
         
     | 
| 
      
 9 
     | 
    
         
            +
                Relish::Command.run('push', [])
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
              
         
     | 
| 
      
 12 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -3,19 +3,40 @@ require 'spec_helper' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Relish
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Command
         
     | 
| 
       5 
5 
     | 
    
         
             
                describe Base do
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                  {: 
     | 
| 
      
 6 
     | 
    
         
            +
                
         
     | 
| 
      
 7 
     | 
    
         
            +
                  {:organization => 'rspec', :project => 'rspec-core'}.each do |meth, name|
         
     | 
| 
       8 
8 
     | 
    
         
             
                    describe "##{meth}" do
         
     | 
| 
       9 
     | 
    
         
            -
                      context 'passed in command line' do
         
     | 
| 
       10 
     | 
    
         
            -
                        let(:base) { described_class.new({meth  
     | 
| 
      
 9 
     | 
    
         
            +
                      context 'passed in command line as full arg' do
         
     | 
| 
      
 10 
     | 
    
         
            +
                        let(:base) { described_class.new(["--#{meth}", name]) }
         
     | 
| 
      
 11 
     | 
    
         
            +
                      
         
     | 
| 
      
 12 
     | 
    
         
            +
                        it 'returns the value' do
         
     | 
| 
      
 13 
     | 
    
         
            +
                          base.send(meth).should eq(name)
         
     | 
| 
      
 14 
     | 
    
         
            +
                        end
         
     | 
| 
      
 15 
     | 
    
         
            +
                      end
         
     | 
| 
      
 16 
     | 
    
         
            +
                      
         
     | 
| 
      
 17 
     | 
    
         
            +
                      context 'passed in command line as short arg' do
         
     | 
| 
      
 18 
     | 
    
         
            +
                        let(:short_arg) { meth.to_s[0,1] }
         
     | 
| 
      
 19 
     | 
    
         
            +
                        let(:base) { described_class.new(["-#{short_arg}", name]) }
         
     | 
| 
      
 20 
     | 
    
         
            +
                      
         
     | 
| 
      
 21 
     | 
    
         
            +
                        it 'returns the value' do
         
     | 
| 
      
 22 
     | 
    
         
            +
                          base.send(meth).should eq(name)
         
     | 
| 
      
 23 
     | 
    
         
            +
                        end
         
     | 
| 
      
 24 
     | 
    
         
            +
                      end
         
     | 
| 
       11 
25 
     | 
    
         | 
| 
      
 26 
     | 
    
         
            +
                      context 'contained in the options file' do
         
     | 
| 
      
 27 
     | 
    
         
            +
                        let(:base) { described_class.new([]) }
         
     | 
| 
      
 28 
     | 
    
         
            +
                        
         
     | 
| 
      
 29 
     | 
    
         
            +
                        before do
         
     | 
| 
      
 30 
     | 
    
         
            +
                          base.stub(:parsed_options_file).and_return({meth.to_s => name})
         
     | 
| 
      
 31 
     | 
    
         
            +
                        end
         
     | 
| 
      
 32 
     | 
    
         
            +
                        
         
     | 
| 
       12 
33 
     | 
    
         
             
                        it 'returns the value' do
         
     | 
| 
       13 
34 
     | 
    
         
             
                          base.send(meth).should eq(name)
         
     | 
| 
       14 
35 
     | 
    
         
             
                        end
         
     | 
| 
       15 
36 
     | 
    
         
             
                      end
         
     | 
| 
       16 
37 
     | 
    
         | 
| 
       17 
38 
     | 
    
         
             
                      context 'not passed in command line' do
         
     | 
| 
       18 
     | 
    
         
            -
                        let(:base) { described_class.new }
         
     | 
| 
      
 39 
     | 
    
         
            +
                        let(:base) { described_class.new([]) }
         
     | 
| 
       19 
40 
     | 
    
         | 
| 
       20 
41 
     | 
    
         
             
                        context 'and options file does not exist' do
         
     | 
| 
       21 
42 
     | 
    
         
             
                          it 'returns nil' do
         
     | 
| 
         @@ -28,7 +49,7 @@ module Relish 
     | 
|
| 
       28 
49 
     | 
    
         | 
| 
       29 
50 
     | 
    
         
             
                  describe '#host' do
         
     | 
| 
       30 
51 
     | 
    
         
             
                    context 'passed in command line' do
         
     | 
| 
       31 
     | 
    
         
            -
                      let(:base) { described_class.new( 
     | 
| 
      
 52 
     | 
    
         
            +
                      let(:base) { described_class.new(['--host', 'test.com']) }
         
     | 
| 
       32 
53 
     | 
    
         | 
| 
       33 
54 
     | 
    
         
             
                      it 'returns test.com' do
         
     | 
| 
       34 
55 
     | 
    
         
             
                        base.host.should eq('test.com')
         
     | 
| 
         @@ -36,7 +57,7 @@ module Relish 
     | 
|
| 
       36 
57 
     | 
    
         
             
                    end
         
     | 
| 
       37 
58 
     | 
    
         | 
| 
       38 
59 
     | 
    
         
             
                    context 'not passed in command line' do
         
     | 
| 
       39 
     | 
    
         
            -
                      let(:base) { described_class.new }
         
     | 
| 
      
 60 
     | 
    
         
            +
                      let(:base) { described_class.new([]) }
         
     | 
| 
       40 
61 
     | 
    
         | 
| 
       41 
62 
     | 
    
         
             
                      it 'returns the default host' do
         
     | 
| 
       42 
63 
     | 
    
         
             
                        base.host.should eq(Base::DEFAULT_HOST)
         
     | 
| 
         @@ -44,25 +65,53 @@ module Relish 
     | 
|
| 
       44 
65 
     | 
    
         
             
                    end
         
     | 
| 
       45 
66 
     | 
    
         
             
                  end
         
     | 
| 
       46 
67 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
                  describe '# 
     | 
| 
       48 
     | 
    
         
            -
                    let(:base) { described_class.new }
         
     | 
| 
      
 68 
     | 
    
         
            +
                  describe '#api_token' do
         
     | 
| 
      
 69 
     | 
    
         
            +
                    let(:base) { described_class.new([]) }
         
     | 
| 
      
 70 
     | 
    
         
            +
                    let(:options) { {'api_token' => '12345'} }
         
     | 
| 
      
 71 
     | 
    
         
            +
                    
         
     | 
| 
      
 72 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 73 
     | 
    
         
            +
                      base.should_receive(:parsed_options_file).and_return(options)
         
     | 
| 
      
 74 
     | 
    
         
            +
                    end
         
     | 
| 
      
 75 
     | 
    
         
            +
                    
         
     | 
| 
      
 76 
     | 
    
         
            +
                    it 'parses the api token' do
         
     | 
| 
      
 77 
     | 
    
         
            +
                      base.api_token.should eq('12345')
         
     | 
| 
      
 78 
     | 
    
         
            +
                    end
         
     | 
| 
      
 79 
     | 
    
         
            +
                  end
         
     | 
| 
      
 80 
     | 
    
         
            +
                  
         
     | 
| 
      
 81 
     | 
    
         
            +
                  describe '#get_options' do
         
     | 
| 
      
 82 
     | 
    
         
            +
                    let(:base) { described_class.new(['--project', 'rspec-core']) }
         
     | 
| 
      
 83 
     | 
    
         
            +
                    let(:options) { {'project' => 'rspec-core'} }
         
     | 
| 
      
 84 
     | 
    
         
            +
                    
         
     | 
| 
      
 85 
     | 
    
         
            +
                    before do
         
     | 
| 
      
 86 
     | 
    
         
            +
                      base.should_receive(:parsed_options_file).and_return(options)
         
     | 
| 
      
 87 
     | 
    
         
            +
                    end
         
     | 
| 
      
 88 
     | 
    
         
            +
                    
         
     | 
| 
      
 89 
     | 
    
         
            +
                    it 'combines the args and options file' do
         
     | 
| 
      
 90 
     | 
    
         
            +
                      base.get_options.should eq(
         
     | 
| 
      
 91 
     | 
    
         
            +
                        {'project' => 'rspec-core', '--project' => 'rspec-core'}
         
     | 
| 
      
 92 
     | 
    
         
            +
                      )
         
     | 
| 
      
 93 
     | 
    
         
            +
                    end
         
     | 
| 
      
 94 
     | 
    
         
            +
                  end
         
     | 
| 
      
 95 
     | 
    
         
            +
                  
         
     | 
| 
      
 96 
     | 
    
         
            +
                  describe '#parsed_options_file' do
         
     | 
| 
      
 97 
     | 
    
         
            +
                    let(:base) { described_class.new([]) }
         
     | 
| 
       49 
98 
     | 
    
         | 
| 
       50 
99 
     | 
    
         
             
                    context 'with options file that exists' do
         
     | 
| 
       51 
100 
     | 
    
         
             
                      let(:options) do
         
     | 
| 
       52 
     | 
    
         
            -
                        ' 
     | 
| 
      
 101 
     | 
    
         
            +
                        {'organization' => 'rspec', 'project' => 'rspec-core'}
         
     | 
| 
       53 
102 
     | 
    
         
             
                      end
         
     | 
| 
       54 
103 
     | 
    
         | 
| 
       55 
104 
     | 
    
         
             
                      before do
         
     | 
| 
       56 
     | 
    
         
            -
                        File. 
     | 
| 
       57 
     | 
    
         
            -
                         
     | 
| 
      
 105 
     | 
    
         
            +
                        File.should_receive(:exist?).twice.and_return(true)
         
     | 
| 
      
 106 
     | 
    
         
            +
                        YAML.should_receive(:load_file).twice.and_return(options)
         
     | 
| 
       58 
107 
     | 
    
         
             
                      end
         
     | 
| 
       59 
108 
     | 
    
         | 
| 
       60 
     | 
    
         
            -
                      it 'parses the  
     | 
| 
       61 
     | 
    
         
            -
                        base. 
     | 
| 
      
 109 
     | 
    
         
            +
                      it 'parses the organization' do
         
     | 
| 
      
 110 
     | 
    
         
            +
                        base.parsed_options_file['organization'].should eq('rspec')
         
     | 
| 
       62 
111 
     | 
    
         
             
                      end
         
     | 
| 
       63 
112 
     | 
    
         | 
| 
       64 
113 
     | 
    
         
             
                      it 'parses the project' do
         
     | 
| 
       65 
     | 
    
         
            -
                        base. 
     | 
| 
      
 114 
     | 
    
         
            +
                        base.parsed_options_file['project'].should eq('rspec-core')
         
     | 
| 
       66 
115 
     | 
    
         
             
                      end
         
     | 
| 
       67 
116 
     | 
    
         
             
                    end
         
     | 
| 
       68 
117 
     | 
    
         | 
| 
         @@ -72,21 +121,11 @@ module Relish 
     | 
|
| 
       72 
121 
     | 
    
         
             
                      end
         
     | 
| 
       73 
122 
     | 
    
         | 
| 
       74 
123 
     | 
    
         
             
                      it 'returns an empty hash' do
         
     | 
| 
       75 
     | 
    
         
            -
                        base. 
     | 
| 
      
 124 
     | 
    
         
            +
                        base.parsed_options_file.should eq({})
         
     | 
| 
       76 
125 
     | 
    
         
             
                      end
         
     | 
| 
       77 
126 
     | 
    
         
             
                    end
         
     | 
| 
       78 
127 
     | 
    
         
             
                  end
         
     | 
| 
       79 
128 
     | 
    
         | 
| 
       80 
     | 
    
         
            -
                  describe '#api_token' do
         
     | 
| 
       81 
     | 
    
         
            -
                    let(:base) { described_class.new }
         
     | 
| 
       82 
     | 
    
         
            -
                    
         
     | 
| 
       83 
     | 
    
         
            -
                    it 'calls File.read with the correct path' do
         
     | 
| 
       84 
     | 
    
         
            -
                      base.should_receive(:home_directory).and_return('~')
         
     | 
| 
       85 
     | 
    
         
            -
                      File.should_receive(:read).with('~/.relish/api_token')
         
     | 
| 
       86 
     | 
    
         
            -
                      base.api_token
         
     | 
| 
       87 
     | 
    
         
            -
                    end
         
     | 
| 
       88 
     | 
    
         
            -
                  end
         
     | 
| 
       89 
     | 
    
         
            -
                  
         
     | 
| 
       90 
129 
     | 
    
         
             
                end
         
     | 
| 
       91 
130 
     | 
    
         
             
              end
         
     | 
| 
       92 
131 
     | 
    
         
             
            end
         
     | 
| 
         @@ -4,55 +4,62 @@ module Relish 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module Command
         
     | 
| 
       5 
5 
     | 
    
         
             
                describe Push do
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
      
 7 
     | 
    
         
            +
                  describe '#default' do
         
     | 
| 
      
 8 
     | 
    
         
            +
                    let(:push) { described_class.new([]) }
         
     | 
| 
      
 9 
     | 
    
         
            +
                    
         
     | 
| 
      
 10 
     | 
    
         
            +
                    it 'calls #run' do
         
     | 
| 
      
 11 
     | 
    
         
            +
                      push.should_receive(:run)
         
     | 
| 
      
 12 
     | 
    
         
            +
                      push.default
         
     | 
| 
      
 13 
     | 
    
         
            +
                    end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
                  
         
     | 
| 
       7 
16 
     | 
    
         
             
                  describe '#url' do
         
     | 
| 
       8 
17 
     | 
    
         
             
                    before do
         
     | 
| 
       9 
     | 
    
         
            -
                      push.should_receive(:account).and_return('rspec')
         
     | 
| 
       10 
18 
     | 
    
         
             
                      push.should_receive(:project).and_return('rspec')
         
     | 
| 
       11 
19 
     | 
    
         
             
                      push.should_receive(:api_token).and_return('abc')
         
     | 
| 
       12 
20 
     | 
    
         
             
                    end
         
     | 
| 
       13 
21 
     | 
    
         | 
| 
       14 
22 
     | 
    
         
             
                    context 'without version' do 
         
     | 
| 
       15 
     | 
    
         
            -
                      let(:push) { described_class.new }
         
     | 
| 
      
 23 
     | 
    
         
            +
                      let(:push) { described_class.new([]) }
         
     | 
| 
       16 
24 
     | 
    
         | 
| 
       17 
25 
     | 
    
         
             
                      specify do
         
     | 
| 
       18 
26 
     | 
    
         
             
                        push.url.should eq(
         
     | 
| 
       19 
     | 
    
         
            -
                          "http://relishapp.com/pushes? 
     | 
| 
      
 27 
     | 
    
         
            +
                          "http://relishapp.com/pushes?project_id=rspec&api_token=abc"
         
     | 
| 
       20 
28 
     | 
    
         
             
                        )
         
     | 
| 
       21 
29 
     | 
    
         
             
                      end
         
     | 
| 
       22 
30 
     | 
    
         
             
                    end
         
     | 
| 
       23 
31 
     | 
    
         | 
| 
       24 
32 
     | 
    
         
             
                    context 'with version' do
         
     | 
| 
       25 
     | 
    
         
            -
                      let(:push) { described_class.new( 
     | 
| 
      
 33 
     | 
    
         
            +
                      let(:push) { described_class.new(['--version', 'one']) }
         
     | 
| 
       26 
34 
     | 
    
         | 
| 
       27 
35 
     | 
    
         
             
                      specify do
         
     | 
| 
       28 
36 
     | 
    
         
             
                        push.url.should eq(
         
     | 
| 
       29 
     | 
    
         
            -
                          "http://relishapp.com/pushes?" 
     | 
| 
       30 
     | 
    
         
            -
                          "account_id=rspec&project_id=rspec&version_id=one&api_token=abc"
         
     | 
| 
      
 37 
     | 
    
         
            +
                          "http://relishapp.com/pushes?project_id=rspec&version_id=one&api_token=abc"
         
     | 
| 
       31 
38 
     | 
    
         
             
                        )
         
     | 
| 
       32 
39 
     | 
    
         
             
                      end
         
     | 
| 
       33 
40 
     | 
    
         
             
                    end
         
     | 
| 
       34 
41 
     | 
    
         
             
                  end
         
     | 
| 
       35 
42 
     | 
    
         | 
| 
       36 
43 
     | 
    
         
             
                  describe '#version' do
         
     | 
| 
       37 
     | 
    
         
            -
                    context 'with  
     | 
| 
       38 
     | 
    
         
            -
                      let(:push) { described_class.new( 
     | 
| 
      
 44 
     | 
    
         
            +
                    context 'with --version in @options' do
         
     | 
| 
      
 45 
     | 
    
         
            +
                      let(:push) { described_class.new(['--version', 'one']) }
         
     | 
| 
       39 
46 
     | 
    
         
             
                      specify { push.version.should eq('one') }
         
     | 
| 
       40 
47 
     | 
    
         
             
                    end
         
     | 
| 
       41 
48 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
                    context 'with  
     | 
| 
       43 
     | 
    
         
            -
                      let(:push) { described_class.new }
         
     | 
| 
      
 49 
     | 
    
         
            +
                    context 'with --version not in @options' do
         
     | 
| 
      
 50 
     | 
    
         
            +
                      let(:push) { described_class.new([]) }
         
     | 
| 
       44 
51 
     | 
    
         
             
                      specify { push.version.should be_nil }
         
     | 
| 
       45 
52 
     | 
    
         
             
                    end
         
     | 
| 
       46 
53 
     | 
    
         
             
                  end
         
     | 
| 
       47 
54 
     | 
    
         | 
| 
       48 
55 
     | 
    
         
             
                  describe '#files_as_tar_gz' do
         
     | 
| 
       49 
     | 
    
         
            -
                    let(:push) { described_class.new }
         
     | 
| 
      
 56 
     | 
    
         
            +
                    let(:push) { described_class.new([]) }
         
     | 
| 
       50 
57 
     | 
    
         
             
                    specify { expect { push.files_as_tar_gz }.to_not raise_exception }
         
     | 
| 
       51 
58 
     | 
    
         
             
                    specify { push.files_as_tar_gz.should be_a(String) }
         
     | 
| 
       52 
59 
     | 
    
         
             
                  end
         
     | 
| 
       53 
60 
     | 
    
         | 
| 
       54 
61 
     | 
    
         
             
                  describe '#files' do
         
     | 
| 
       55 
     | 
    
         
            -
                    let(:push) { described_class.new }
         
     | 
| 
      
 62 
     | 
    
         
            +
                    let(:push) { described_class.new([]) }
         
     | 
| 
       56 
63 
     | 
    
         
             
                    specify { expect { push.files }.to_not raise_exception }
         
     | 
| 
       57 
64 
     | 
    
         
             
                    specify { push.files.should be_a(Array) }
         
     | 
| 
       58 
65 
     | 
    
         
             
                  end
         
     | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | 
         @@ -2,8 +2,12 @@ require 'rubygems' 
     | 
|
| 
       2 
2 
     | 
    
         
             
            require 'bundler'
         
     | 
| 
       3 
3 
     | 
    
         
             
            Bundler.setup
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            require 'relish'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'relish/command'
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            RSpec.configure do |config|
         
     | 
| 
       8 
8 
     | 
    
         
             
              config.color_enabled = true
         
     | 
| 
      
 9 
     | 
    
         
            +
              
         
     | 
| 
      
 10 
     | 
    
         
            +
              config.before(:suite) do
         
     | 
| 
      
 11 
     | 
    
         
            +
                Relish::Command::Base::GLOBAL_OPTIONS_FILE = '~/.relish'
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
       9 
13 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,121 +1,118 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: relish
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 27
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 2
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
     | 
    
         
            -
            - Matt Patterson
         
     | 
| 
       14 
13 
     | 
    
         
             
            - Matt Wynne
         
     | 
| 
       15 
14 
     | 
    
         
             
            - Justin Ko
         
     | 
| 
       16 
15 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       17 
16 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       18 
17 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       19 
18 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
            date: 2010-09-23 00:00:00  
     | 
| 
      
 19 
     | 
    
         
            +
            date: 2010-09-23 00:00:00 +01:00
         
     | 
| 
       21 
20 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       22 
21 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       23 
22 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       24 
     | 
    
         
            -
              name:  
     | 
| 
      
 23 
     | 
    
         
            +
              name: rest-client
         
     | 
| 
       25 
24 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       26 
25 
     | 
    
         
             
              requirement: &id001 !ruby/object:Gem::Requirement 
         
     | 
| 
       27 
26 
     | 
    
         
             
                none: false
         
     | 
| 
       28 
27 
     | 
    
         
             
                requirements: 
         
     | 
| 
       29 
28 
     | 
    
         
             
                - - ~>
         
     | 
| 
       30 
29 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       31 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 30 
     | 
    
         
            +
                    hash: 13
         
     | 
| 
       32 
31 
     | 
    
         
             
                    segments: 
         
     | 
| 
       33 
     | 
    
         
            -
                    -  
     | 
| 
       34 
     | 
    
         
            -
                    -  
     | 
| 
       35 
     | 
    
         
            -
                    -  
     | 
| 
       36 
     | 
    
         
            -
                    version:  
     | 
| 
       37 
     | 
    
         
            -
              type: : 
     | 
| 
      
 32 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 33 
     | 
    
         
            +
                    - 6
         
     | 
| 
      
 34 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 35 
     | 
    
         
            +
                    version: 1.6.1
         
     | 
| 
      
 36 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       38 
37 
     | 
    
         
             
              version_requirements: *id001
         
     | 
| 
       39 
38 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       40 
     | 
    
         
            -
              name:  
     | 
| 
      
 39 
     | 
    
         
            +
              name: archive-tar-minitar
         
     | 
| 
       41 
40 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       42 
41 
     | 
    
         
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         
     | 
| 
       43 
42 
     | 
    
         
             
                none: false
         
     | 
| 
       44 
43 
     | 
    
         
             
                requirements: 
         
     | 
| 
       45 
44 
     | 
    
         
             
                - - ~>
         
     | 
| 
       46 
45 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       47 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 46 
     | 
    
         
            +
                    hash: 15
         
     | 
| 
       48 
47 
     | 
    
         
             
                    segments: 
         
     | 
| 
       49 
     | 
    
         
            -
                    - 2
         
     | 
| 
       50 
     | 
    
         
            -
                    - 0
         
     | 
| 
       51 
48 
     | 
    
         
             
                    - 0
         
     | 
| 
       52 
     | 
    
         
            -
                    -  
     | 
| 
       53 
     | 
    
         
            -
                    -  
     | 
| 
       54 
     | 
    
         
            -
                    version:  
     | 
| 
       55 
     | 
    
         
            -
              type: : 
     | 
| 
      
 49 
     | 
    
         
            +
                    - 5
         
     | 
| 
      
 50 
     | 
    
         
            +
                    - 2
         
     | 
| 
      
 51 
     | 
    
         
            +
                    version: 0.5.2
         
     | 
| 
      
 52 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       56 
53 
     | 
    
         
             
              version_requirements: *id002
         
     | 
| 
       57 
54 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       58 
     | 
    
         
            -
              name:  
     | 
| 
      
 55 
     | 
    
         
            +
              name: fakeweb
         
     | 
| 
       59 
56 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       60 
57 
     | 
    
         
             
              requirement: &id003 !ruby/object:Gem::Requirement 
         
     | 
| 
       61 
58 
     | 
    
         
             
                none: false
         
     | 
| 
       62 
59 
     | 
    
         
             
                requirements: 
         
     | 
| 
       63 
60 
     | 
    
         
             
                - - ~>
         
     | 
| 
       64 
61 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       65 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 62 
     | 
    
         
            +
                    hash: 27
         
     | 
| 
       66 
63 
     | 
    
         
             
                    segments: 
         
     | 
| 
      
 64 
     | 
    
         
            +
                    - 1
         
     | 
| 
      
 65 
     | 
    
         
            +
                    - 3
         
     | 
| 
       67 
66 
     | 
    
         
             
                    - 0
         
     | 
| 
       68 
     | 
    
         
            -
                     
     | 
| 
       69 
     | 
    
         
            -
                    - 2
         
     | 
| 
       70 
     | 
    
         
            -
                    version: 0.2.2
         
     | 
| 
      
 67 
     | 
    
         
            +
                    version: 1.3.0
         
     | 
| 
       71 
68 
     | 
    
         
             
              type: :development
         
     | 
| 
       72 
69 
     | 
    
         
             
              version_requirements: *id003
         
     | 
| 
       73 
70 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       74 
     | 
    
         
            -
              name:  
     | 
| 
      
 71 
     | 
    
         
            +
              name: rake
         
     | 
| 
       75 
72 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       76 
73 
     | 
    
         
             
              requirement: &id004 !ruby/object:Gem::Requirement 
         
     | 
| 
       77 
74 
     | 
    
         
             
                none: false
         
     | 
| 
       78 
75 
     | 
    
         
             
                requirements: 
         
     | 
| 
       79 
76 
     | 
    
         
             
                - - ~>
         
     | 
| 
       80 
77 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       81 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 78 
     | 
    
         
            +
                    hash: 49
         
     | 
| 
       82 
79 
     | 
    
         
             
                    segments: 
         
     | 
| 
       83 
     | 
    
         
            -
                    -  
     | 
| 
       84 
     | 
    
         
            -
                    -  
     | 
| 
       85 
     | 
    
         
            -
                    -  
     | 
| 
       86 
     | 
    
         
            -
                    version:  
     | 
| 
      
 80 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 81 
     | 
    
         
            +
                    - 8
         
     | 
| 
      
 82 
     | 
    
         
            +
                    - 7
         
     | 
| 
      
 83 
     | 
    
         
            +
                    version: 0.8.7
         
     | 
| 
       87 
84 
     | 
    
         
             
              type: :development
         
     | 
| 
       88 
85 
     | 
    
         
             
              version_requirements: *id004
         
     | 
| 
       89 
86 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       90 
     | 
    
         
            -
              name:  
     | 
| 
      
 87 
     | 
    
         
            +
              name: rspec
         
     | 
| 
       91 
88 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       92 
89 
     | 
    
         
             
              requirement: &id005 !ruby/object:Gem::Requirement 
         
     | 
| 
       93 
90 
     | 
    
         
             
                none: false
         
     | 
| 
       94 
91 
     | 
    
         
             
                requirements: 
         
     | 
| 
       95 
92 
     | 
    
         
             
                - - ~>
         
     | 
| 
       96 
93 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       97 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 94 
     | 
    
         
            +
                    hash: 15
         
     | 
| 
       98 
95 
     | 
    
         
             
                    segments: 
         
     | 
| 
       99 
     | 
    
         
            -
                    - 1
         
     | 
| 
       100 
     | 
    
         
            -
                    - 16
         
     | 
| 
       101 
96 
     | 
    
         
             
                    - 2
         
     | 
| 
       102 
     | 
    
         
            -
                     
     | 
| 
      
 97 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 98 
     | 
    
         
            +
                    - 0
         
     | 
| 
      
 99 
     | 
    
         
            +
                    version: 2.0.0
         
     | 
| 
       103 
100 
     | 
    
         
             
              type: :development
         
     | 
| 
       104 
101 
     | 
    
         
             
              version_requirements: *id005
         
     | 
| 
       105 
102 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       106 
     | 
    
         
            -
              name:  
     | 
| 
      
 103 
     | 
    
         
            +
              name: aruba
         
     | 
| 
       107 
104 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       108 
105 
     | 
    
         
             
              requirement: &id006 !ruby/object:Gem::Requirement 
         
     | 
| 
       109 
106 
     | 
    
         
             
                none: false
         
     | 
| 
       110 
107 
     | 
    
         
             
                requirements: 
         
     | 
| 
       111 
108 
     | 
    
         
             
                - - ~>
         
     | 
| 
       112 
109 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       113 
     | 
    
         
            -
                    hash:  
     | 
| 
      
 110 
     | 
    
         
            +
                    hash: 19
         
     | 
| 
       114 
111 
     | 
    
         
             
                    segments: 
         
     | 
| 
       115 
112 
     | 
    
         
             
                    - 0
         
     | 
| 
       116 
     | 
    
         
            -
                    - 5
         
     | 
| 
       117 
113 
     | 
    
         
             
                    - 2
         
     | 
| 
       118 
     | 
    
         
            -
                     
     | 
| 
      
 114 
     | 
    
         
            +
                    - 2
         
     | 
| 
      
 115 
     | 
    
         
            +
                    version: 0.2.2
         
     | 
| 
       119 
116 
     | 
    
         
             
              type: :development
         
     | 
| 
       120 
117 
     | 
    
         
             
              version_requirements: *id006
         
     | 
| 
       121 
118 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -152,8 +149,8 @@ dependencies: 
     | 
|
| 
       152 
149 
     | 
    
         
             
              version_requirements: *id008
         
     | 
| 
       153 
150 
     | 
    
         
             
            description: Client gem for http://relishapp.com
         
     | 
| 
       154 
151 
     | 
    
         
             
            email: jko170@gmail.com
         
     | 
| 
       155 
     | 
    
         
            -
            executables:  
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
      
 152 
     | 
    
         
            +
            executables: 
         
     | 
| 
      
 153 
     | 
    
         
            +
            - relish
         
     | 
| 
       157 
154 
     | 
    
         
             
            extensions: []
         
     | 
| 
       158 
155 
     | 
    
         | 
| 
       159 
156 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
         @@ -161,21 +158,22 @@ extra_rdoc_files: [] 
     | 
|
| 
       161 
158 
     | 
    
         
             
            files: 
         
     | 
| 
       162 
159 
     | 
    
         
             
            - .gitignore
         
     | 
| 
       163 
160 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       164 
     | 
    
         
            -
            - Gemfile.lock
         
     | 
| 
       165 
161 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       166 
162 
     | 
    
         
             
            - README.md
         
     | 
| 
       167 
163 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       168 
164 
     | 
    
         
             
            - bin/relish
         
     | 
| 
      
 165 
     | 
    
         
            +
            - cucumber.yml
         
     | 
| 
       169 
166 
     | 
    
         
             
            - features/push.feature
         
     | 
| 
      
 167 
     | 
    
         
            +
            - features/step_definitions/aruba.rb
         
     | 
| 
      
 168 
     | 
    
         
            +
            - features/step_definitions/fake_web_steps.rb
         
     | 
| 
      
 169 
     | 
    
         
            +
            - features/step_definitions/relish_steps.rb
         
     | 
| 
       170 
170 
     | 
    
         
             
            - features/support/env.rb
         
     | 
| 
       171 
     | 
    
         
            -
            - lib/relish.rb
         
     | 
| 
       172 
     | 
    
         
            -
            - lib/relish/cli/options.rb
         
     | 
| 
       173 
     | 
    
         
            -
            - lib/relish/cli/runner.rb
         
     | 
| 
       174 
171 
     | 
    
         
             
            - lib/relish/command.rb
         
     | 
| 
       175 
172 
     | 
    
         
             
            - lib/relish/commands/base.rb
         
     | 
| 
      
 173 
     | 
    
         
            +
            - lib/relish/commands/config.rb
         
     | 
| 
       176 
174 
     | 
    
         
             
            - lib/relish/commands/push.rb
         
     | 
| 
       177 
     | 
    
         
            -
            - lib/relish/helpers.rb
         
     | 
| 
       178 
175 
     | 
    
         
             
            - relish.gemspec
         
     | 
| 
      
 176 
     | 
    
         
            +
            - spec/relish/command_spec.rb
         
     | 
| 
       179 
177 
     | 
    
         
             
            - spec/relish/commands/base_spec.rb
         
     | 
| 
       180 
178 
     | 
    
         
             
            - spec/relish/commands/push_spec.rb
         
     | 
| 
       181 
179 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
         @@ -217,7 +215,11 @@ specification_version: 3 
     | 
|
| 
       217 
215 
     | 
    
         
             
            summary: Client gem for http://relishapp.com
         
     | 
| 
       218 
216 
     | 
    
         
             
            test_files: 
         
     | 
| 
       219 
217 
     | 
    
         
             
            - features/push.feature
         
     | 
| 
      
 218 
     | 
    
         
            +
            - features/step_definitions/aruba.rb
         
     | 
| 
      
 219 
     | 
    
         
            +
            - features/step_definitions/fake_web_steps.rb
         
     | 
| 
      
 220 
     | 
    
         
            +
            - features/step_definitions/relish_steps.rb
         
     | 
| 
       220 
221 
     | 
    
         
             
            - features/support/env.rb
         
     | 
| 
      
 222 
     | 
    
         
            +
            - spec/relish/command_spec.rb
         
     | 
| 
       221 
223 
     | 
    
         
             
            - spec/relish/commands/base_spec.rb
         
     | 
| 
       222 
224 
     | 
    
         
             
            - spec/relish/commands/push_spec.rb
         
     | 
| 
       223 
225 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
    
        data/Gemfile.lock
    DELETED
    
    | 
         @@ -1,53 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            PATH
         
     | 
| 
       2 
     | 
    
         
            -
              remote: .
         
     | 
| 
       3 
     | 
    
         
            -
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                relish (0.0.1)
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            GEM
         
     | 
| 
       7 
     | 
    
         
            -
              remote: http://rubygems.org/
         
     | 
| 
       8 
     | 
    
         
            -
              specs:
         
     | 
| 
       9 
     | 
    
         
            -
                archive-tar-minitar (0.5.2)
         
     | 
| 
       10 
     | 
    
         
            -
                aruba (0.2.2)
         
     | 
| 
       11 
     | 
    
         
            -
                builder (2.1.2)
         
     | 
| 
       12 
     | 
    
         
            -
                cucumber (0.9.1)
         
     | 
| 
       13 
     | 
    
         
            -
                  builder (~> 2.1.2)
         
     | 
| 
       14 
     | 
    
         
            -
                  diff-lcs (~> 1.1.2)
         
     | 
| 
       15 
     | 
    
         
            -
                  gherkin (~> 2.2.5)
         
     | 
| 
       16 
     | 
    
         
            -
                  json (~> 1.4.6)
         
     | 
| 
       17 
     | 
    
         
            -
                  term-ansicolor (~> 1.0.5)
         
     | 
| 
       18 
     | 
    
         
            -
                diff-lcs (1.1.2)
         
     | 
| 
       19 
     | 
    
         
            -
                gherkin (2.2.7)
         
     | 
| 
       20 
     | 
    
         
            -
                  json (~> 1.4.6)
         
     | 
| 
       21 
     | 
    
         
            -
                  term-ansicolor (~> 1.0.5)
         
     | 
| 
       22 
     | 
    
         
            -
                  trollop (~> 1.16.2)
         
     | 
| 
       23 
     | 
    
         
            -
                json (1.4.6)
         
     | 
| 
       24 
     | 
    
         
            -
                mime-types (1.16)
         
     | 
| 
       25 
     | 
    
         
            -
                rake (0.8.7)
         
     | 
| 
       26 
     | 
    
         
            -
                rest-client (1.6.1)
         
     | 
| 
       27 
     | 
    
         
            -
                  mime-types (>= 1.16)
         
     | 
| 
       28 
     | 
    
         
            -
                rspec (2.0.0.beta.22)
         
     | 
| 
       29 
     | 
    
         
            -
                  rspec-core (= 2.0.0.beta.22)
         
     | 
| 
       30 
     | 
    
         
            -
                  rspec-expectations (= 2.0.0.beta.22)
         
     | 
| 
       31 
     | 
    
         
            -
                  rspec-mocks (= 2.0.0.beta.22)
         
     | 
| 
       32 
     | 
    
         
            -
                rspec-core (2.0.0.beta.22)
         
     | 
| 
       33 
     | 
    
         
            -
                rspec-expectations (2.0.0.beta.22)
         
     | 
| 
       34 
     | 
    
         
            -
                  diff-lcs (>= 1.1.2)
         
     | 
| 
       35 
     | 
    
         
            -
                rspec-mocks (2.0.0.beta.22)
         
     | 
| 
       36 
     | 
    
         
            -
                  rspec-core (= 2.0.0.beta.22)
         
     | 
| 
       37 
     | 
    
         
            -
                  rspec-expectations (= 2.0.0.beta.22)
         
     | 
| 
       38 
     | 
    
         
            -
                term-ansicolor (1.0.5)
         
     | 
| 
       39 
     | 
    
         
            -
                trollop (1.16.2)
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
            PLATFORMS
         
     | 
| 
       42 
     | 
    
         
            -
              ruby
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
            DEPENDENCIES
         
     | 
| 
       45 
     | 
    
         
            -
              archive-tar-minitar (~> 0.5.2)
         
     | 
| 
       46 
     | 
    
         
            -
              aruba (~> 0.2.2)
         
     | 
| 
       47 
     | 
    
         
            -
              bundler (~> 1.0.0)
         
     | 
| 
       48 
     | 
    
         
            -
              cucumber (~> 0.9.1)
         
     | 
| 
       49 
     | 
    
         
            -
              rake (~> 0.8.7)
         
     | 
| 
       50 
     | 
    
         
            -
              relish!
         
     | 
| 
       51 
     | 
    
         
            -
              rest-client (~> 1.6.1)
         
     | 
| 
       52 
     | 
    
         
            -
              rspec (~> 2.0.0.beta.22)
         
     | 
| 
       53 
     | 
    
         
            -
              trollop (~> 1.16.2)
         
     | 
    
        data/lib/relish.rb
    DELETED
    
    
    
        data/lib/relish/cli/options.rb
    DELETED
    
    | 
         @@ -1,51 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'trollop'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'relish/commands/push'
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            module Relish
         
     | 
| 
       5 
     | 
    
         
            -
              module Cli
         
     | 
| 
       6 
     | 
    
         
            -
                class OptionsParser < Trollop::Parser
         
     | 
| 
       7 
     | 
    
         
            -
                  
         
     | 
| 
       8 
     | 
    
         
            -
                  COMMANDS = { 'push' => Commands::Push }
         
     | 
| 
       9 
     | 
    
         
            -
                  
         
     | 
| 
       10 
     | 
    
         
            -
                  def initialize(error_stream, out_stream)
         
     | 
| 
       11 
     | 
    
         
            -
                    super
         
     | 
| 
       12 
     | 
    
         
            -
                    
         
     | 
| 
       13 
     | 
    
         
            -
                    banner "This is the relish gem. Valid commands are: #{valid_commands.join(",")}"
         
     | 
| 
       14 
     | 
    
         
            -
                    
         
     | 
| 
       15 
     | 
    
         
            -
                    opt :help,    "Show help information"
         
     | 
| 
       16 
     | 
    
         
            -
                    opt :host,    "Host to connect to",    :short => '-h', :type => String
         
     | 
| 
       17 
     | 
    
         
            -
                    opt :account, "Account to connect to", :short => '-a', :type => String
         
     | 
| 
       18 
     | 
    
         
            -
                    opt :project, "Project to connect to", :short => '-p', :type => String
         
     | 
| 
       19 
     | 
    
         
            -
                    opt :version, "Version to connect to", :short => '-v', :type => String
         
     | 
| 
       20 
     | 
    
         
            -
                    
         
     | 
| 
       21 
     | 
    
         
            -
                    stop_on valid_commands
         
     | 
| 
       22 
     | 
    
         
            -
                  end
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                  def command(args)
         
     | 
| 
       25 
     | 
    
         
            -
                    Trollop.with_standard_exception_handling(self) do
         
     | 
| 
       26 
     | 
    
         
            -
                      global_options = parse(args)
         
     | 
| 
       27 
     | 
    
         
            -
                      grab_command(global_options)
         
     | 
| 
       28 
     | 
    
         
            -
                    end
         
     | 
| 
       29 
     | 
    
         
            -
                  end
         
     | 
| 
       30 
     | 
    
         
            -
                  
         
     | 
| 
       31 
     | 
    
         
            -
                private
         
     | 
| 
       32 
     | 
    
         
            -
                
         
     | 
| 
       33 
     | 
    
         
            -
                  def grab_command(global_options)
         
     | 
| 
       34 
     | 
    
         
            -
                    command_name = leftovers.shift
         
     | 
| 
       35 
     | 
    
         
            -
                    raise Trollop::HelpNeeded unless command_name
         
     | 
| 
       36 
     | 
    
         
            -
                    unless valid_commands.include?(command_name)
         
     | 
| 
       37 
     | 
    
         
            -
                      die("'#{command_name}' is not a relish command", nil)
         
     | 
| 
       38 
     | 
    
         
            -
                    end
         
     | 
| 
       39 
     | 
    
         
            -
                    command_class(command_name).new(global_options)
         
     | 
| 
       40 
     | 
    
         
            -
                  end
         
     | 
| 
       41 
     | 
    
         
            -
                  
         
     | 
| 
       42 
     | 
    
         
            -
                  def valid_commands
         
     | 
| 
       43 
     | 
    
         
            -
                    COMMANDS.keys
         
     | 
| 
       44 
     | 
    
         
            -
                  end
         
     | 
| 
       45 
     | 
    
         
            -
                  
         
     | 
| 
       46 
     | 
    
         
            -
                  def command_class(command_name)
         
     | 
| 
       47 
     | 
    
         
            -
                    COMMANDS[command_name] or raise(NotImplementedError)
         
     | 
| 
       48 
     | 
    
         
            -
                  end
         
     | 
| 
       49 
     | 
    
         
            -
                end
         
     | 
| 
       50 
     | 
    
         
            -
              end
         
     | 
| 
       51 
     | 
    
         
            -
            end
         
     | 
    
        data/lib/relish/cli/runner.rb
    DELETED
    
    
    
        data/lib/relish/helpers.rb
    DELETED
    
    | 
         @@ -1,15 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            module Relish
         
     | 
| 
       2 
     | 
    
         
            -
              module Helpers
         
     | 
| 
       3 
     | 
    
         
            -
                def home_directory
         
     | 
| 
       4 
     | 
    
         
            -
                  running_on_windows? ? ENV['USERPROFILE'] : ENV['HOME']
         
     | 
| 
       5 
     | 
    
         
            -
                end
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                def running_on_windows?
         
     | 
| 
       8 
     | 
    
         
            -
                  RUBY_PLATFORM =~ /mswin32|mingw32/
         
     | 
| 
       9 
     | 
    
         
            -
                end
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                def running_on_a_mac?
         
     | 
| 
       12 
     | 
    
         
            -
                  RUBY_PLATFORM =~ /-darwin\d/
         
     | 
| 
       13 
     | 
    
         
            -
                end
         
     | 
| 
       14 
     | 
    
         
            -
              end
         
     | 
| 
       15 
     | 
    
         
            -
            end
         
     |