simple-service 0.1.1 → 0.1.6
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/.gitignore +2 -2
- data/.rubocop.yml +7 -0
- data/.tm_properties +1 -1
- data/Makefile +8 -0
- data/README.md +68 -1
- data/TODO.txt +3 -0
- data/VERSION +1 -1
- data/doc/Simple.html +117 -0
- data/doc/Simple/Service.html +865 -0
- data/doc/Simple/Service/Action.html +923 -0
- data/doc/Simple/Service/Action/Comment.html +451 -0
- data/doc/Simple/Service/Action/Comment/Extractor.html +347 -0
- data/doc/Simple/Service/Action/MethodReflection.html +285 -0
- data/doc/Simple/Service/Action/Parameter.html +816 -0
- data/doc/Simple/Service/ArgumentError.html +128 -0
- data/doc/Simple/Service/ClassMethods.html +187 -0
- data/doc/Simple/Service/Context.html +379 -0
- data/doc/Simple/Service/ContextMissingError.html +124 -0
- data/doc/Simple/Service/ContextReadOnlyError.html +206 -0
- data/doc/Simple/Service/ExtraArguments.html +428 -0
- data/doc/Simple/Service/GemHelper.html +190 -0
- data/doc/Simple/Service/MissingArguments.html +426 -0
- data/doc/Simple/Service/NoSuchAction.html +433 -0
- data/doc/_index.html +274 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +146 -0
- data/doc/file.TODO.html +70 -0
- data/doc/file_list.html +61 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +146 -0
- data/doc/js/app.js +303 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +483 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/simple/service.rb +161 -56
- data/lib/simple/service/action.rb +104 -107
- data/lib/simple/service/action/comment.rb +3 -1
- data/lib/simple/service/action/method_reflection.rb +3 -3
- data/lib/simple/service/action/parameter.rb +3 -7
- data/lib/simple/service/context.rb +69 -27
- data/lib/simple/service/errors.rb +54 -0
- data/lib/simple/service/version.rb +7 -2
- data/scripts/stats +2 -1
- data/spec/simple/service/action_invoke3_spec.rb +266 -0
- data/spec/simple/service/action_invoke_spec.rb +237 -0
- data/spec/simple/service/action_spec.rb +51 -0
- data/spec/simple/service/context_spec.rb +39 -7
- data/spec/simple/service/service_spec.rb +158 -0
- data/spec/simple/service/version_spec.rb +7 -0
- data/spec/spec_helper.rb +15 -2
- data/spec/support/spec_services.rb +58 -0
- metadata +48 -6
- data/lib/simple.rb +0 -2
- data/spec/support/004_simplecov.rb +0 -13
data/spec/spec_helper.rb
CHANGED
@@ -4,10 +4,23 @@ ENV["RAILS_ENV"] = "test"
|
|
4
4
|
require "byebug"
|
5
5
|
require "rspec"
|
6
6
|
|
7
|
-
|
7
|
+
require "simplecov"
|
8
|
+
|
9
|
+
SimpleCov.start do
|
10
|
+
# return true to remove src from coverage
|
11
|
+
add_filter do |src|
|
12
|
+
next true if src.filename =~ /\/spec\//
|
13
|
+
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
# minimum_coverage 90
|
18
|
+
end
|
8
19
|
|
9
20
|
require "simple/service"
|
10
21
|
|
22
|
+
Dir.glob("./spec/support/**/*.rb").sort.each { |path| load path }
|
23
|
+
|
11
24
|
RSpec.configure do |config|
|
12
25
|
config.run_all_when_everything_filtered = true
|
13
26
|
config.filter_run focus: (ENV["CI"] != "true")
|
@@ -16,8 +29,8 @@ RSpec.configure do |config|
|
|
16
29
|
config.example_status_persistence_file_path = ".rspec.data"
|
17
30
|
|
18
31
|
config.backtrace_exclusion_patterns << /spec\/support/
|
32
|
+
config.backtrace_exclusion_patterns << /spec\/helpers/
|
19
33
|
config.backtrace_exclusion_patterns << /spec_helper/
|
20
|
-
config.backtrace_exclusion_patterns << /database_cleaner/
|
21
34
|
|
22
35
|
# config.around(:each) do |example|
|
23
36
|
# example.run
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# rubocop:disable Naming/UncommunicativeMethodParamName
|
2
|
+
|
3
|
+
module NoServiceModule
|
4
|
+
end
|
5
|
+
|
6
|
+
module SpecService
|
7
|
+
include Simple::Service
|
8
|
+
|
9
|
+
# This is service1
|
10
|
+
#
|
11
|
+
# Service 1 has a full description
|
12
|
+
def service1(a, b, c = "speed-of-light", d:, e: 2.781); end
|
13
|
+
|
14
|
+
# This is service2 (no full description)
|
15
|
+
def service2
|
16
|
+
"service2 return"
|
17
|
+
end
|
18
|
+
|
19
|
+
def service3
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def not_a_service; end
|
26
|
+
end
|
27
|
+
|
28
|
+
module InvokeTestService
|
29
|
+
include Simple::Service
|
30
|
+
|
31
|
+
def no_params
|
32
|
+
"service2 return"
|
33
|
+
end
|
34
|
+
|
35
|
+
def positional_params(a, b, c = "speed-of-light", e = 2.781)
|
36
|
+
[a, b, c, e]
|
37
|
+
end
|
38
|
+
|
39
|
+
def named_params(a:, b:, c: "speed-of-light", e: 2.781)
|
40
|
+
[a, b, c, e]
|
41
|
+
end
|
42
|
+
|
43
|
+
def mixed_optional_params(a, b = "default-b", c = "speed-of-light", e: 2.781)
|
44
|
+
[a, b, c, e]
|
45
|
+
end
|
46
|
+
|
47
|
+
def variadic_params(a, b = "queen bee", *args, e: 2.781)
|
48
|
+
[a, b, args, e]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module SpecTestService
|
53
|
+
include Simple::Service
|
54
|
+
|
55
|
+
def foo(bar, baz:)
|
56
|
+
[ bar, baz ]
|
57
|
+
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expectation
|
@@ -37,19 +37,51 @@ files:
|
|
37
37
|
- Makefile
|
38
38
|
- README.md
|
39
39
|
- Rakefile
|
40
|
+
- TODO.txt
|
40
41
|
- VERSION
|
41
42
|
- bin/bundle
|
42
43
|
- bin/console
|
43
44
|
- bin/rake
|
44
45
|
- bin/rspec
|
46
|
+
- doc/Simple.html
|
47
|
+
- doc/Simple/Service.html
|
48
|
+
- doc/Simple/Service/Action.html
|
49
|
+
- doc/Simple/Service/Action/Comment.html
|
50
|
+
- doc/Simple/Service/Action/Comment/Extractor.html
|
51
|
+
- doc/Simple/Service/Action/MethodReflection.html
|
52
|
+
- doc/Simple/Service/Action/Parameter.html
|
53
|
+
- doc/Simple/Service/ArgumentError.html
|
54
|
+
- doc/Simple/Service/ClassMethods.html
|
55
|
+
- doc/Simple/Service/Context.html
|
56
|
+
- doc/Simple/Service/ContextMissingError.html
|
57
|
+
- doc/Simple/Service/ContextReadOnlyError.html
|
58
|
+
- doc/Simple/Service/ExtraArguments.html
|
59
|
+
- doc/Simple/Service/GemHelper.html
|
60
|
+
- doc/Simple/Service/MissingArguments.html
|
61
|
+
- doc/Simple/Service/NoSuchAction.html
|
62
|
+
- doc/_index.html
|
63
|
+
- doc/class_list.html
|
64
|
+
- doc/css/common.css
|
65
|
+
- doc/css/full_list.css
|
66
|
+
- doc/css/style.css
|
67
|
+
- doc/file.README.html
|
68
|
+
- doc/file.TODO.html
|
69
|
+
- doc/file_list.html
|
70
|
+
- doc/frames.html
|
71
|
+
- doc/index.html
|
72
|
+
- doc/js/app.js
|
73
|
+
- doc/js/full_list.js
|
74
|
+
- doc/js/jquery.js
|
75
|
+
- doc/method_list.html
|
76
|
+
- doc/top-level-namespace.html
|
45
77
|
- lib/simple-service.rb
|
46
|
-
- lib/simple.rb
|
47
78
|
- lib/simple/service.rb
|
48
79
|
- lib/simple/service/action.rb
|
49
80
|
- lib/simple/service/action/comment.rb
|
50
81
|
- lib/simple/service/action/method_reflection.rb
|
51
82
|
- lib/simple/service/action/parameter.rb
|
52
83
|
- lib/simple/service/context.rb
|
84
|
+
- lib/simple/service/errors.rb
|
53
85
|
- lib/simple/service/version.rb
|
54
86
|
- log/.gitkeep
|
55
87
|
- scripts/release
|
@@ -57,9 +89,14 @@ files:
|
|
57
89
|
- scripts/stats
|
58
90
|
- scripts/watch
|
59
91
|
- simple-service.gemspec
|
92
|
+
- spec/simple/service/action_invoke3_spec.rb
|
93
|
+
- spec/simple/service/action_invoke_spec.rb
|
94
|
+
- spec/simple/service/action_spec.rb
|
60
95
|
- spec/simple/service/context_spec.rb
|
96
|
+
- spec/simple/service/service_spec.rb
|
97
|
+
- spec/simple/service/version_spec.rb
|
61
98
|
- spec/spec_helper.rb
|
62
|
-
- spec/support/
|
99
|
+
- spec/support/spec_services.rb
|
63
100
|
homepage: http://github.com/radiospiel/simple-service
|
64
101
|
licenses: []
|
65
102
|
metadata: {}
|
@@ -78,11 +115,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
115
|
- !ruby/object:Gem::Version
|
79
116
|
version: '0'
|
80
117
|
requirements: []
|
81
|
-
rubygems_version: 3.0.
|
118
|
+
rubygems_version: 3.0.6
|
82
119
|
signing_key:
|
83
120
|
specification_version: 4
|
84
121
|
summary: Pretty simple and somewhat abstract service description
|
85
122
|
test_files:
|
123
|
+
- spec/simple/service/action_invoke3_spec.rb
|
124
|
+
- spec/simple/service/action_invoke_spec.rb
|
125
|
+
- spec/simple/service/action_spec.rb
|
86
126
|
- spec/simple/service/context_spec.rb
|
127
|
+
- spec/simple/service/service_spec.rb
|
128
|
+
- spec/simple/service/version_spec.rb
|
87
129
|
- spec/spec_helper.rb
|
88
|
-
- spec/support/
|
130
|
+
- spec/support/spec_services.rb
|
data/lib/simple.rb
DELETED