simple_operation 0.1.1 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/simple_operation.rb +2 -2
- data/lib/simple_operation/ext.rb +5 -0
- data/lib/simple_operation/version.rb +1 -1
- data/test/simple_operation_ext_test.rb +12 -0
- data/test/simple_operation_test.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7492ed2b8ed2e376b77f74c30765edcb7c54241
|
|
4
|
+
data.tar.gz: 67f8e2eece14bea9123482316603b318f0181b6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34b2980275b3f2bf0be1c4438cbd82ac9357b09982f4e70712709fa3ef433e5cdb79162e2d179ab4741f2afd166cf2a3c3f5699f9b195f6996e2dc287db89ba8
|
|
7
|
+
data.tar.gz: a03a556846569e45151a3720b166541d3e3280f03afede0e264950f724ee28813ff5aa0bc6ec0a97e38d8952fccbf0f37c12fcd32cc08bfdb0647f0ded90ed6b
|
data/README.md
CHANGED
|
@@ -45,7 +45,7 @@ CreateUser.('Grzegorz', 'arnvald.to@gmail.com')
|
|
|
45
45
|
# the same effect as line above
|
|
46
46
|
CreateUser.new('Grzegorz', 'arnvald.to@gmail.com').()
|
|
47
47
|
|
|
48
|
-
#
|
|
48
|
+
# `perform` is an alias for `call`
|
|
49
49
|
CreateUser.new('Grzegorz', 'arnvald.to@gmail.com').perform
|
|
50
50
|
```
|
|
51
51
|
|
data/lib/simple_operation.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
require_relative './simple_operation/version'
|
|
2
2
|
|
|
3
3
|
class SimpleOperation
|
|
4
4
|
|
|
5
5
|
def self.new(*args)
|
|
6
|
-
args_list_with_nils = args.join('=nil,
|
|
6
|
+
args_list_with_nils = args.empty? ? '' : "#{args.join('=nil,')}=nil"
|
|
7
7
|
Class.new do
|
|
8
8
|
class_eval <<-code
|
|
9
9
|
def self.call #{args_list_with_nils}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
|
+
require 'simple_operation'
|
|
3
|
+
require 'simple_operation/ext'
|
|
4
|
+
require 'minitest/autorun'
|
|
5
|
+
|
|
6
|
+
class SimpleOperationExtTest < Minitest::Test
|
|
7
|
+
|
|
8
|
+
def test_creates_new_class
|
|
9
|
+
assert SimpleOperation(:login).is_a? Class
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
end
|
|
@@ -8,6 +8,10 @@ class SimpleOperationTest < Minitest::Test
|
|
|
8
8
|
assert SimpleOperation.new(:login)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
def test_runs_correctly_with_no_params
|
|
12
|
+
assert SimpleOperation.new
|
|
13
|
+
end
|
|
14
|
+
|
|
11
15
|
def test_has_no_public_readers
|
|
12
16
|
assert_raises(NoMethodError) { object.login }
|
|
13
17
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_operation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Grzegorz Witek
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-04-
|
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -52,8 +52,10 @@ files:
|
|
|
52
52
|
- README.md
|
|
53
53
|
- Rakefile
|
|
54
54
|
- lib/simple_operation.rb
|
|
55
|
+
- lib/simple_operation/ext.rb
|
|
55
56
|
- lib/simple_operation/version.rb
|
|
56
57
|
- simple_operation.gemspec
|
|
58
|
+
- test/simple_operation_ext_test.rb
|
|
57
59
|
- test/simple_operation_test.rb
|
|
58
60
|
homepage: ''
|
|
59
61
|
licenses:
|
|
@@ -80,4 +82,6 @@ signing_key:
|
|
|
80
82
|
specification_version: 4
|
|
81
83
|
summary: Create simple service object
|
|
82
84
|
test_files:
|
|
85
|
+
- test/simple_operation_ext_test.rb
|
|
83
86
|
- test/simple_operation_test.rb
|
|
87
|
+
has_rdoc:
|