cluster-fuck 0.1.4.2 → 0.1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,8 @@ module ClusterFuck
3
3
  module AmicusEnvArgumentParser
4
4
 
5
5
  def self.included(base)
6
- [:amicus_env, :key].each do |reader_key|
7
- base.send(:attr_reader, reader_key) unless base.respond_to?(:reader_key)
8
- end
6
+ base.send(:attr_reader, :key) unless base.respond_to?(:reader_key)
7
+ base.send(:include, ClusterFuck::S3Methods)
9
8
  end
10
9
 
11
10
  def set_amicus_env_and_key_from_args(args)
@@ -4,13 +4,10 @@ require_relative "edit"
4
4
  module ClusterFuck
5
5
  module Commands
6
6
  class Create
7
- include ClusterFuck::S3Methods
8
7
  include AmicusEnvArgumentParser
9
8
 
10
- attr_reader :key
11
9
  def run_command(args, options = {})
12
10
  set_amicus_env_and_key_from_args(args)
13
-
14
11
  obj = s3_object(key)
15
12
  raise ConflictError, "#{key} already exists!" if obj.exists?
16
13
  obj.write('')
@@ -6,7 +6,6 @@ module ClusterFuck
6
6
  include Commander::UI
7
7
  include AmicusEnvArgumentParser
8
8
 
9
- attr_reader :key, :options
10
9
  def run_command(args, options = Hashie::Mash.new)
11
10
  set_amicus_env_and_key_from_args(args)
12
11
 
@@ -4,10 +4,8 @@ require 'fileutils'
4
4
  module ClusterFuck
5
5
  module Commands
6
6
  class Override
7
- include ClusterFuck::S3Methods
8
7
  include AmicusEnvArgumentParser
9
8
 
10
- attr_reader :key
11
9
  def run_command(args, options = {})
12
10
  set_amicus_env_and_key_from_args(args)
13
11
 
@@ -1,3 +1,3 @@
1
1
  module ClusterFuck
2
- VERSION = "0.1.4.2"
2
+ VERSION = "0.1.4.3"
3
3
  end
@@ -13,13 +13,13 @@ module ClusterFuck::Commands
13
13
  it "should use the key when only one arg" do
14
14
  subject.set_amicus_env_and_key_from_args(["test-key"])
15
15
  subject.key.should == "test-key"
16
- subject.amicus_env.should be_nil
16
+ subject.amicus_env.should == 'test'
17
17
  end
18
18
 
19
19
  it "should set amicus_env and key when two args" do
20
- subject.set_amicus_env_and_key_from_args(["test", "test-key"])
20
+ subject.set_amicus_env_and_key_from_args(["a_different_env", "test-key"])
21
21
  subject.key.should == "test-key"
22
- subject.amicus_env.should == "test"
22
+ subject.amicus_env.should == "a_different_env"
23
23
  end
24
24
 
25
25
  end
@@ -14,7 +14,7 @@ module ClusterFuck::Commands
14
14
  let(:args) { ["test-key"] }
15
15
 
16
16
  before do
17
- ClusterFuck::Reader.should_receive(:new).with(args.first, amicus_env: nil).and_return(mock_reader)
17
+ ClusterFuck::Reader.should_receive(:new).with(args.first, amicus_env: 'test').and_return(mock_reader)
18
18
  end
19
19
 
20
20
  it "should read the remote contents and write the local contents" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cluster-fuck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.2
4
+ version: 0.1.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-07 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk