relish 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,6 +47,8 @@ module Relish
47
47
  end
48
48
 
49
49
  def resource(options = {})
50
+ options[:user] ||= api_token
51
+ options[:password] ||= 'X'
50
52
  RestClient::Resource.new(url, options)
51
53
  end
52
54
 
@@ -18,14 +18,14 @@ module Relish
18
18
  end
19
19
 
20
20
  def add
21
- puts resource['projects'].post(:api_token => api_token, :handle => @param)
21
+ puts resource['projects'].post(:handle => @param)
22
22
  rescue RestClient::Exception => exception
23
23
  warn exception.response
24
24
  exit 1
25
25
  end
26
26
 
27
27
  def remove
28
- puts resource["projects/#{@param}?api_token=#{api_token}"].delete
28
+ puts resource["projects/#{@param}"].delete
29
29
  rescue RestClient::Exception => exception
30
30
  warn exception.response
31
31
  exit 1
@@ -30,9 +30,8 @@ module Relish
30
30
 
31
31
  def parameters
32
32
  "".tap do |str|
33
- str << "project_id=#{project}&"
34
- str << "version_id=#{version}&" if version
35
- str << "api_token=#{api_token}"
33
+ str << "project_id=#{project}"
34
+ str << "&version_id=#{version}" if version
36
35
  end
37
36
  end
38
37
 
@@ -13,10 +13,10 @@ module Relish
13
13
  # Store the given options into the file. Existing options with the same keys
14
14
  # will be overwritten.
15
15
  def store(options)
16
- new_options = self.options.merge(options)
16
+ @options = self.options.merge(options)
17
17
  FileUtils.touch(@path)
18
18
  File.open(@path, 'w') do |file|
19
- YAML.dump(new_options, file)
19
+ YAML.dump(@options, file)
20
20
  end
21
21
  end
22
22
 
data/relish.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "relish"
3
- s.version = "0.0.7"
3
+ s.version = "0.0.8"
4
4
 
5
5
  s.required_rubygems_version = '>= 1.3.5'
6
6
  s.authors = ["Matt Wynne", "Justin Ko"]
@@ -14,18 +14,13 @@ module Relish
14
14
  end
15
15
 
16
16
  describe '#parameters' do
17
- before do
18
- push.should_receive(:project).and_return('rspec')
19
- push.should_receive(:api_token).and_return('abc')
20
- end
17
+ before { push.should_receive(:project).and_return('rspec') }
21
18
 
22
19
  context 'without version' do
23
20
  let(:push) { described_class.new }
24
21
 
25
22
  specify do
26
- push.parameters.should eq(
27
- "project_id=rspec&api_token=abc"
28
- )
23
+ push.parameters.should eq("project_id=rspec")
29
24
  end
30
25
  end
31
26
 
@@ -33,9 +28,7 @@ module Relish
33
28
  let(:push) { described_class.new(['--version', 'one']) }
34
29
 
35
30
  specify do
36
- push.parameters.should eq(
37
- "project_id=rspec&version_id=one&api_token=abc"
38
- )
31
+ push.parameters.should eq("project_id=rspec&version_id=one")
39
32
  end
40
33
  end
41
34
  end
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: 17
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
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: 2010-09-23 00:00:00 -06:00
19
+ date: 2010-09-23 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency