simple-service 0.1.1 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.rubocop.yml +7 -0
  4. data/.tm_properties +1 -1
  5. data/Makefile +8 -0
  6. data/README.md +68 -1
  7. data/TODO.txt +3 -0
  8. data/VERSION +1 -1
  9. data/doc/Simple.html +117 -0
  10. data/doc/Simple/Service.html +865 -0
  11. data/doc/Simple/Service/Action.html +923 -0
  12. data/doc/Simple/Service/Action/Comment.html +451 -0
  13. data/doc/Simple/Service/Action/Comment/Extractor.html +347 -0
  14. data/doc/Simple/Service/Action/MethodReflection.html +285 -0
  15. data/doc/Simple/Service/Action/Parameter.html +816 -0
  16. data/doc/Simple/Service/ArgumentError.html +128 -0
  17. data/doc/Simple/Service/ClassMethods.html +187 -0
  18. data/doc/Simple/Service/Context.html +379 -0
  19. data/doc/Simple/Service/ContextMissingError.html +124 -0
  20. data/doc/Simple/Service/ContextReadOnlyError.html +206 -0
  21. data/doc/Simple/Service/ExtraArguments.html +428 -0
  22. data/doc/Simple/Service/GemHelper.html +190 -0
  23. data/doc/Simple/Service/MissingArguments.html +426 -0
  24. data/doc/Simple/Service/NoSuchAction.html +433 -0
  25. data/doc/_index.html +274 -0
  26. data/doc/class_list.html +51 -0
  27. data/doc/css/common.css +1 -0
  28. data/doc/css/full_list.css +58 -0
  29. data/doc/css/style.css +496 -0
  30. data/doc/file.README.html +146 -0
  31. data/doc/file.TODO.html +70 -0
  32. data/doc/file_list.html +61 -0
  33. data/doc/frames.html +17 -0
  34. data/doc/index.html +146 -0
  35. data/doc/js/app.js +303 -0
  36. data/doc/js/full_list.js +216 -0
  37. data/doc/js/jquery.js +4 -0
  38. data/doc/method_list.html +483 -0
  39. data/doc/top-level-namespace.html +110 -0
  40. data/lib/simple/service.rb +161 -56
  41. data/lib/simple/service/action.rb +104 -107
  42. data/lib/simple/service/action/comment.rb +3 -1
  43. data/lib/simple/service/action/method_reflection.rb +3 -3
  44. data/lib/simple/service/action/parameter.rb +3 -7
  45. data/lib/simple/service/context.rb +69 -27
  46. data/lib/simple/service/errors.rb +54 -0
  47. data/lib/simple/service/version.rb +7 -2
  48. data/scripts/stats +2 -1
  49. data/spec/simple/service/action_invoke3_spec.rb +266 -0
  50. data/spec/simple/service/action_invoke_spec.rb +237 -0
  51. data/spec/simple/service/action_spec.rb +51 -0
  52. data/spec/simple/service/context_spec.rb +39 -7
  53. data/spec/simple/service/service_spec.rb +158 -0
  54. data/spec/simple/service/version_spec.rb +7 -0
  55. data/spec/spec_helper.rb +15 -2
  56. data/spec/support/spec_services.rb +58 -0
  57. metadata +48 -6
  58. data/lib/simple.rb +0 -2
  59. data/spec/support/004_simplecov.rb +0 -13
@@ -0,0 +1,7 @@
1
+ require "spec_helper"
2
+
3
+ describe "Simple::Service::VERSION" do
4
+ it "returns a version number" do
5
+ expect(Simple::Service::VERSION).to match(/\d\.\d\.\d/)
6
+ end
7
+ end
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
- Dir.glob("./spec/support/**/*.rb").sort.each { |path| load path }
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.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-26 00:00:00.000000000 Z
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/004_simplecov.rb
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.4
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/004_simplecov.rb
130
+ - spec/support/spec_services.rb
data/lib/simple.rb DELETED
@@ -1,2 +0,0 @@
1
- module Simple
2
- end
@@ -1,13 +0,0 @@
1
- require "simplecov"
2
-
3
- SimpleCov.start do
4
- # return true to remove src from coverage
5
- add_filter do |src|
6
- next true if src.filename =~ /\/spec\//
7
- next true if src.filename =~ /\/version.rb$/
8
-
9
- false
10
- end
11
-
12
- # minimum_coverage 90
13
- end