skywalker 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skywalker/command.rb +6 -3
- data/lib/skywalker/version.rb +1 -1
- data/spec/lib/skywalker/command_spec.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d19f8fad7236722932ae900e99b7c4aaf0b8a708
|
4
|
+
data.tar.gz: 1373707d67ae212131fa3f4ac95dda7d942831c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f877c39807cb3b1b7948786d484e018b176ad6ffd036b2da28ffcc5dd2464fee06ee8c3635a133f0cf088d32eda857b2d0301545a9f7f13cbe99013c39eeaf56
|
7
|
+
data.tar.gz: 83eb7c4d081624d25378e2723595a62757b13642c7ef8b184b51a1a4885e4fc0d34409a36930caa6243b52e642a61e0def5fa03d2b3d7ca8dc2941a8471cc7ec
|
data/lib/skywalker/command.rb
CHANGED
@@ -14,12 +14,15 @@ module Skywalker
|
|
14
14
|
# Instantiates command, setting all arguments.
|
15
15
|
################################################################################
|
16
16
|
def initialize(**args)
|
17
|
-
args.each_pair do |
|
17
|
+
args.each_pair do |reader_method, value|
|
18
|
+
writer_method = "#{reader_method}="
|
19
|
+
|
18
20
|
singleton_class.class_eval do
|
19
|
-
send(:
|
21
|
+
send(:attr_reader, reader_method) unless respond_to?(reader_method)
|
22
|
+
send(:attr_writer, reader_method) unless respond_to?(writer_method)
|
20
23
|
end
|
21
24
|
|
22
|
-
self.send(
|
25
|
+
self.send(writer_method, value)
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
data/lib/skywalker/version.rb
CHANGED
@@ -16,7 +16,17 @@ module Skywalker
|
|
16
16
|
expect { Command.new(a_symbol: :my_symbol, a_string: "my string") }.not_to raise_error
|
17
17
|
end
|
18
18
|
|
19
|
-
it "sets
|
19
|
+
it "sets a reader for each argument" do
|
20
|
+
command = Command.new(a_symbol: :my_symbol)
|
21
|
+
expect(command).to respond_to(:a_symbol)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "sets a writer for each argument" do
|
25
|
+
command = Command.new(a_symbol: :my_symbol)
|
26
|
+
expect(command).to respond_to(:a_symbol=)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "sets the instance variable to the passed value" do
|
20
30
|
command = Command.new(a_symbol: :my_symbol)
|
21
31
|
expect(command.a_symbol).to eq(:my_symbol)
|
22
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skywalker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Yurkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|