relish 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/bin/relish CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'rubygems' rescue LoadError
2
3
  $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
3
4
 
4
5
  require 'relish/command'
@@ -7,4 +8,4 @@ args = ARGV.dup
7
8
  ARGV.clear
8
9
  command = args.shift.strip rescue 'help'
9
10
 
10
- Relish::Command.run(command, args)
11
+ Relish::Command.run(command, args)
@@ -1,23 +1,22 @@
1
- @announce
2
1
  Feature: Help
3
2
 
4
3
  The `relish help` command displays all available commands
5
4
  along with a description of each.
6
5
 
7
6
  Scenario: View all available commands with the help command
8
- When I successfully run "relish help"
7
+ When I successfully run `relish help`
9
8
  Then the output should contain:
10
9
  """
11
10
  === Available Commands
12
11
  """
13
12
 
14
13
  Scenario: Specifying no command runs the help command
15
- When I successfully run "relish"
14
+ When I successfully run `relish`
16
15
  Then the output should contain "=== Available Commands"
17
16
 
18
17
  Scenario: Specifying an unknown command gives an error message
19
- When I run "relish baloney"
18
+ When I run `relish baloney`
20
19
  Then it should fail with:
21
20
  """
22
21
  Unknown command. Run 'relish help' for usage information.
23
- """
22
+ """
@@ -1,8 +1 @@
1
1
  require 'aruba/cucumber'
2
-
3
- gem_bin_path = File.dirname(__FILE__) + '/../../bin'
4
- ENV['PATH'] = "#{gem_bin_path}:#{ENV['PATH']}"
5
-
6
- When /^I run relish ([^\s]*) (.*)$/ do |command, args|
7
- Relish::Command.run(command, args.split(" "))
8
- end
@@ -28,7 +28,7 @@ module Relish
28
28
  end
29
29
 
30
30
  def url
31
- "http://#{host}/api"
31
+ "https://#{host}/api"
32
32
  end
33
33
 
34
34
  def get_param
@@ -57,6 +57,7 @@ module Relish
57
57
  def resource(options = {})
58
58
  options[:user] ||= api_token
59
59
  options[:password] ||= 'X'
60
+ options[:headers] = { :client_version => Relish::Version::STRING }
60
61
  RestClient::Resource.new(url, options)
61
62
  end
62
63
 
@@ -70,7 +71,6 @@ module Relish
70
71
 
71
72
  def validate_cli_options
72
73
  cli_options.keys.each do |option|
73
-
74
74
  unless valid_option_names.include?(option.to_s)
75
75
  error "'#{option}' is not a valid option."
76
76
  end
@@ -107,4 +107,4 @@ module Relish
107
107
 
108
108
  end
109
109
  end
110
- end
110
+ end
@@ -0,0 +1,6 @@
1
+ module Relish
2
+ module Version
3
+ STRING = '0.5.0'
4
+ end
5
+ end
6
+
data/lib/relish.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Relish
2
2
  class << self
3
-
3
+
4
4
  def self.setting(name, value)
5
5
  attr_writer name
6
6
  class_eval %{
@@ -11,9 +11,11 @@ module Relish
11
11
  end # end
12
12
  }
13
13
  end
14
-
14
+
15
15
  setting :global_options_file, File.join(File.expand_path('~'), '.relish')
16
16
  setting :local_options_file, '.relish'
17
- setting :default_host, 'relishapp.com'
17
+ setting :default_host, 'api.relishapp.com'
18
18
  end
19
- end
19
+ end
20
+
21
+ require 'relish/version'
data/relish.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ require File.dirname(__FILE__) + '/lib/relish/version'
2
+
1
3
  Gem::Specification.new do |s|
2
4
  s.name = "relish"
3
- s.version = "0.4.0"
5
+ s.version = Relish::Version::STRING
4
6
 
5
7
  s.required_rubygems_version = '>= 1.3.5'
6
8
  s.authors = ["Matt Wynne", "Justin Ko"]
@@ -31,7 +33,7 @@ Gem::Specification.new do |s|
31
33
  'rake' => '~> 0.8.7',
32
34
  'rspec' => '~> 2.0.0',
33
35
  'cucumber' => '~> 0.9.1',
34
- 'aruba' => '~> 0.2.2',
36
+ 'aruba' => '~> 0.4.5',
35
37
  'fakeweb' => '~> 1.3.0'
36
38
  }.each do |lib, version|
37
39
  s.add_development_dependency lib, version
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relish
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 4
8
+ - 5
9
9
  - 0
10
- version: 0.4.0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Wynne
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-06-08 00:00:00 +01:00
19
+ date: 2011-09-02 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -123,12 +123,12 @@ dependencies:
123
123
  requirements:
124
124
  - - ~>
125
125
  - !ruby/object:Gem::Version
126
- hash: 19
126
+ hash: 5
127
127
  segments:
128
128
  - 0
129
- - 2
130
- - 2
131
- version: 0.2.2
129
+ - 4
130
+ - 5
131
+ version: 0.4.5
132
132
  type: :development
133
133
  version_requirements: *id007
134
134
  - !ruby/object:Gem::Dependency
@@ -205,6 +205,7 @@ files:
205
205
  - lib/relish/param_methods.rb
206
206
  - lib/relish/resource_methods.rb
207
207
  - lib/relish/ui.rb
208
+ - lib/relish/version.rb
208
209
  - relish.gemspec
209
210
  - spec/relish/command_spec.rb
210
211
  - spec/relish/commands/base_spec.rb