light-services 0.5.4 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 64fa03a8ae523e8d36365fc478335a254cebaf9f
4
- data.tar.gz: 07f31e1df821d985eae324b41c6e935b8b850b29
2
+ SHA256:
3
+ metadata.gz: c5f5f3c3664c416d809462a0deecc2befbc7a5a9334abd728d21a7bc77d92b92
4
+ data.tar.gz: 1e6406a429ab78354bdf24e853fd5365c465358aa1cd24762f5dbe149126f205
5
5
  SHA512:
6
- metadata.gz: dadf31aca9b4a2290281d4c2c95e0ee198faaad6bcf8f7353d4800c80ec175590f04d33943b02057a31139aee556939da41e6cf2cf95567ac51903d97e49f8d5
7
- data.tar.gz: be117b25c7ea8b9dccde2fc445325668e93c6eae941d14b68e38da4229d1408d61bb7dd05b33a85a28c85f783774f6bb020e1319af38ce91d2c97b5f6f1b2c7a
6
+ metadata.gz: 1cfb0ce5441e9327fb27fb22093522445d0d0f6c64a549e2077d52ec03ec35a08c255940979a85eabc1c5eb7dec451c612ef842888eb2bc3ef87a0a187c71015
7
+ data.tar.gz: 34586b8899e19fc41d3995d9636b0d4f14c13d2360dc5ed9eef46c30c0540eef14c4812556d79b8accefed6f2945c9ebadb371b0d43cb58f300b97fc1b43824c
data/.codeclimate.yml CHANGED
@@ -9,8 +9,10 @@ engines:
9
9
  enabled: true
10
10
  rubocop:
11
11
  enabled: true
12
+
12
13
  ratings:
13
14
  paths:
14
15
  - "**.rb"
16
+
15
17
  exclude_paths:
16
18
  - spec/
data/.gitignore CHANGED
@@ -8,6 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /.idea/
11
- /spec/internal/db/combustion_test.sqlite
11
+ /gemfiles/.bundle/
12
12
  /*.gem
13
- /.ruby-version
13
+ /*.iml
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/.travis.yml CHANGED
@@ -1,24 +1,31 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.1
5
+
1
6
  env:
2
7
  global:
3
8
  - CC_TEST_REPORTER_ID=dedf6049120e32b166263dd9e07b2abea3991a18b2d0c8dc86792776ca7578ce
4
9
  - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
5
- sudo: false
6
- language: ruby
7
- rvm:
8
- - 2.4.1
10
+
9
11
  before_script:
10
12
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
13
  - chmod +x ./cc-test-reporter
12
14
  - ./cc-test-reporter before-build
15
+
13
16
  before_install: gem install bundler
17
+
14
18
  gemfile:
15
19
  - gemfiles/rails_4_0.gemfile
16
20
  - gemfiles/rails_4_1.gemfile
17
21
  - gemfiles/rails_4_2.gemfile
18
22
  - gemfiles/rails_5_0.gemfile
19
23
  - gemfiles/rails_5_1.gemfile
24
+ - gemfiles/rails_5_2.gemfile
25
+
20
26
  script:
21
27
  - bundle exec rake
28
+
22
29
  after_script:
23
30
  # Preferably you will run test-reporter on branch update events. But
24
31
  # if you setup travis to build PR updates only, you don't need to run
data/Appraisals CHANGED
@@ -5,17 +5,21 @@ appraise 'rails-4-0' do
5
5
  end
6
6
 
7
7
  appraise 'rails-4-1' do
8
- gem 'rails', '4.1.15'
8
+ gem 'rails', '4.1.16'
9
9
  end
10
10
 
11
11
  appraise 'rails-4-2' do
12
- gem 'rails', '4.2.6'
12
+ gem 'rails', '4.2.10'
13
13
  end
14
14
 
15
15
  appraise 'rails-5-0' do
16
- gem 'rails', '5.0.5'
16
+ gem 'rails', '5.0.7'
17
17
  end
18
18
 
19
19
  appraise 'rails-5-1' do
20
- gem 'rails', '5.1.3'
20
+ gem 'rails', '5.1.6'
21
+ end
22
+
23
+ appraise 'rails-5-2' do
24
+ gem 'rails', '5.2.1'
21
25
  end
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/light-ruby/light-services.svg?branch=master)](https://travis-ci.org/light-ruby/light-services)
4
4
  [![Code Climate](https://codeclimate.com/github/light-ruby/light-services/badges/gpa.svg)](https://codeclimate.com/github/light-ruby/light-services)
5
- [![Test Coverage](https://codeclimate.com/github/light-ruby/light-services/badges/coverage.svg)](https://codeclimate.com/github/light-ruby/light-services/coverage)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/ed8713a891f19318bd7c/test_coverage)](https://codeclimate.com/github/light-ruby/light-services/test_coverage)
6
6
 
7
7
  Implementation of Service Object Pattern for Ruby/Rails. Compatible with Rails 5.1 and 5.0, 4.2, 4.1, 4.0.
8
8
 
@@ -15,7 +15,7 @@ Service Object Pattern – What is it? Check it here:
15
15
  Add this line to your application's Gemfile:
16
16
 
17
17
  ```ruby
18
- gem 'light-services', '~> 0.5'
18
+ gem 'light-services', '~> 0.6'
19
19
  ```
20
20
 
21
21
  And then execute:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.5.4)
4
+ light-services (0.6.0)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -112,4 +112,4 @@ DEPENDENCIES
112
112
  simplecov (~> 0.11.2)
113
113
 
114
114
  BUNDLED WITH
115
- 1.15.4
115
+ 1.16.2
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.1.15"
5
+ gem "rails", "4.1.16"
6
6
 
7
7
  gemspec path: "../"
@@ -1,33 +1,33 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.5.4)
4
+ light-services (0.6.0)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (4.1.15)
11
- actionpack (= 4.1.15)
12
- actionview (= 4.1.15)
10
+ actionmailer (4.1.16)
11
+ actionpack (= 4.1.16)
12
+ actionview (= 4.1.16)
13
13
  mail (~> 2.5, >= 2.5.4)
14
- actionpack (4.1.15)
15
- actionview (= 4.1.15)
16
- activesupport (= 4.1.15)
14
+ actionpack (4.1.16)
15
+ actionview (= 4.1.16)
16
+ activesupport (= 4.1.16)
17
17
  rack (~> 1.5.2)
18
18
  rack-test (~> 0.6.2)
19
- actionview (4.1.15)
20
- activesupport (= 4.1.15)
19
+ actionview (4.1.16)
20
+ activesupport (= 4.1.16)
21
21
  builder (~> 3.1)
22
22
  erubis (~> 2.7.0)
23
- activemodel (4.1.15)
24
- activesupport (= 4.1.15)
23
+ activemodel (4.1.16)
24
+ activesupport (= 4.1.16)
25
25
  builder (~> 3.1)
26
- activerecord (4.1.15)
27
- activemodel (= 4.1.15)
28
- activesupport (= 4.1.15)
26
+ activerecord (4.1.16)
27
+ activemodel (= 4.1.16)
28
+ activesupport (= 4.1.16)
29
29
  arel (~> 5.0.0)
30
- activesupport (4.1.15)
30
+ activesupport (4.1.16)
31
31
  i18n (~> 0.6, >= 0.6.9)
32
32
  json (~> 1.7, >= 1.7.7)
33
33
  minitest (~> 5.1)
@@ -38,37 +38,36 @@ GEM
38
38
  rake
39
39
  thor (>= 0.14.0)
40
40
  arel (5.0.1.20140414130214)
41
- builder (3.2.2)
41
+ builder (3.2.3)
42
42
  codeclimate-test-reporter (0.5.1)
43
43
  simplecov (>= 0.7.1, < 1.0.0)
44
- concurrent-ruby (1.0.2)
44
+ concurrent-ruby (1.0.5)
45
45
  diff-lcs (1.2.5)
46
46
  docile (1.1.5)
47
47
  erubis (2.7.0)
48
- i18n (0.7.0)
48
+ i18n (0.9.5)
49
+ concurrent-ruby (~> 1.0)
49
50
  json (1.8.6)
50
- mail (2.6.4)
51
- mime-types (>= 1.16, < 4)
52
- mime-types (3.1)
53
- mime-types-data (~> 3.2015)
54
- mime-types-data (3.2016.0521)
55
- minitest (5.9.0)
51
+ mail (2.7.0)
52
+ mini_mime (>= 0.1.1)
53
+ mini_mime (1.0.1)
54
+ minitest (5.11.3)
56
55
  rack (1.5.5)
57
56
  rack-test (0.6.3)
58
57
  rack (>= 1.0)
59
- rails (4.1.15)
60
- actionmailer (= 4.1.15)
61
- actionpack (= 4.1.15)
62
- actionview (= 4.1.15)
63
- activemodel (= 4.1.15)
64
- activerecord (= 4.1.15)
65
- activesupport (= 4.1.15)
58
+ rails (4.1.16)
59
+ actionmailer (= 4.1.16)
60
+ actionpack (= 4.1.16)
61
+ actionview (= 4.1.16)
62
+ activemodel (= 4.1.16)
63
+ activerecord (= 4.1.16)
64
+ activesupport (= 4.1.16)
66
65
  bundler (>= 1.3.0, < 2.0)
67
- railties (= 4.1.15)
66
+ railties (= 4.1.16)
68
67
  sprockets-rails (~> 2.0)
69
- railties (4.1.15)
70
- actionpack (= 4.1.15)
71
- activesupport (= 4.1.15)
68
+ railties (4.1.16)
69
+ actionpack (= 4.1.16)
70
+ activesupport (= 4.1.16)
72
71
  rake (>= 0.8.7)
73
72
  thor (>= 0.18.1, < 2.0)
74
73
  rake (10.5.0)
@@ -90,7 +89,7 @@ GEM
90
89
  json (~> 1.8)
91
90
  simplecov-html (~> 0.10.0)
92
91
  simplecov-html (0.10.0)
93
- sprockets (3.6.1)
92
+ sprockets (3.7.2)
94
93
  concurrent-ruby (~> 1.0)
95
94
  rack (> 1, < 3)
96
95
  sprockets-rails (2.3.3)
@@ -98,8 +97,8 @@ GEM
98
97
  activesupport (>= 3.0)
99
98
  sprockets (>= 2.8, < 4.0)
100
99
  thor (0.19.1)
101
- thread_safe (0.3.5)
102
- tzinfo (1.2.2)
100
+ thread_safe (0.3.6)
101
+ tzinfo (1.2.5)
103
102
  thread_safe (~> 0.1)
104
103
 
105
104
  PLATFORMS
@@ -110,10 +109,10 @@ DEPENDENCIES
110
109
  bundler (~> 1.12)
111
110
  codeclimate-test-reporter
112
111
  light-services!
113
- rails (= 4.1.15)
112
+ rails (= 4.1.16)
114
113
  rake (~> 10.0)
115
114
  rspec (~> 3.0)
116
115
  simplecov (~> 0.11.2)
117
116
 
118
117
  BUNDLED WITH
119
- 1.15.4
118
+ 1.16.2
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.2.6"
5
+ gem "rails", "4.2.10"
6
6
 
7
7
  gemspec path: "../"
@@ -1,44 +1,43 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.5.4)
4
+ light-services (0.6.0)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (4.2.6)
11
- actionpack (= 4.2.6)
12
- actionview (= 4.2.6)
13
- activejob (= 4.2.6)
10
+ actionmailer (4.2.10)
11
+ actionpack (= 4.2.10)
12
+ actionview (= 4.2.10)
13
+ activejob (= 4.2.10)
14
14
  mail (~> 2.5, >= 2.5.4)
15
15
  rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.6)
17
- actionview (= 4.2.6)
18
- activesupport (= 4.2.6)
16
+ actionpack (4.2.10)
17
+ actionview (= 4.2.10)
18
+ activesupport (= 4.2.10)
19
19
  rack (~> 1.6)
20
20
  rack-test (~> 0.6.2)
21
21
  rails-dom-testing (~> 1.0, >= 1.0.5)
22
22
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- actionview (4.2.6)
24
- activesupport (= 4.2.6)
23
+ actionview (4.2.10)
24
+ activesupport (= 4.2.10)
25
25
  builder (~> 3.1)
26
26
  erubis (~> 2.7.0)
27
27
  rails-dom-testing (~> 1.0, >= 1.0.5)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- activejob (4.2.6)
30
- activesupport (= 4.2.6)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
+ activejob (4.2.10)
30
+ activesupport (= 4.2.10)
31
31
  globalid (>= 0.3.0)
32
- activemodel (4.2.6)
33
- activesupport (= 4.2.6)
32
+ activemodel (4.2.10)
33
+ activesupport (= 4.2.10)
34
34
  builder (~> 3.1)
35
- activerecord (4.2.6)
36
- activemodel (= 4.2.6)
37
- activesupport (= 4.2.6)
35
+ activerecord (4.2.10)
36
+ activemodel (= 4.2.10)
37
+ activesupport (= 4.2.10)
38
38
  arel (~> 6.0)
39
- activesupport (4.2.6)
39
+ activesupport (4.2.10)
40
40
  i18n (~> 0.7)
41
- json (~> 1.7, >= 1.7.7)
42
41
  minitest (~> 5.1)
43
42
  thread_safe (~> 0.3, >= 0.3.4)
44
43
  tzinfo (~> 1.1)
@@ -46,56 +45,55 @@ GEM
46
45
  bundler
47
46
  rake
48
47
  thor (>= 0.14.0)
49
- arel (6.0.3)
50
- builder (3.2.2)
48
+ arel (6.0.4)
49
+ builder (3.2.3)
51
50
  codeclimate-test-reporter (0.5.1)
52
51
  simplecov (>= 0.7.1, < 1.0.0)
53
- concurrent-ruby (1.0.2)
52
+ concurrent-ruby (1.0.5)
53
+ crass (1.0.4)
54
54
  diff-lcs (1.2.5)
55
55
  docile (1.1.5)
56
56
  erubis (2.7.0)
57
- globalid (0.3.6)
58
- activesupport (>= 4.1.0)
59
- i18n (0.7.0)
57
+ globalid (0.4.1)
58
+ activesupport (>= 4.2.0)
59
+ i18n (0.9.5)
60
+ concurrent-ruby (~> 1.0)
60
61
  json (1.8.6)
61
- loofah (2.0.3)
62
+ loofah (2.2.2)
63
+ crass (~> 1.0.2)
62
64
  nokogiri (>= 1.5.9)
63
- mail (2.6.4)
64
- mime-types (>= 1.16, < 4)
65
- mime-types (3.1)
66
- mime-types-data (~> 3.2015)
67
- mime-types-data (3.2016.0521)
68
- mini_portile2 (2.1.0)
69
- minitest (5.9.0)
70
- nokogiri (1.6.8)
71
- mini_portile2 (~> 2.1.0)
72
- pkg-config (~> 1.1.7)
73
- pkg-config (1.1.7)
74
- rack (1.6.4)
65
+ mail (2.7.0)
66
+ mini_mime (>= 0.1.1)
67
+ mini_mime (1.0.1)
68
+ mini_portile2 (2.3.0)
69
+ minitest (5.11.3)
70
+ nokogiri (1.8.4)
71
+ mini_portile2 (~> 2.3.0)
72
+ rack (1.6.10)
75
73
  rack-test (0.6.3)
76
74
  rack (>= 1.0)
77
- rails (4.2.6)
78
- actionmailer (= 4.2.6)
79
- actionpack (= 4.2.6)
80
- actionview (= 4.2.6)
81
- activejob (= 4.2.6)
82
- activemodel (= 4.2.6)
83
- activerecord (= 4.2.6)
84
- activesupport (= 4.2.6)
75
+ rails (4.2.10)
76
+ actionmailer (= 4.2.10)
77
+ actionpack (= 4.2.10)
78
+ actionview (= 4.2.10)
79
+ activejob (= 4.2.10)
80
+ activemodel (= 4.2.10)
81
+ activerecord (= 4.2.10)
82
+ activesupport (= 4.2.10)
85
83
  bundler (>= 1.3.0, < 2.0)
86
- railties (= 4.2.6)
84
+ railties (= 4.2.10)
87
85
  sprockets-rails
88
86
  rails-deprecated_sanitizer (1.0.3)
89
87
  activesupport (>= 4.2.0.alpha)
90
- rails-dom-testing (1.0.7)
91
- activesupport (>= 4.2.0.beta, < 5.0)
92
- nokogiri (~> 1.6.0)
88
+ rails-dom-testing (1.0.9)
89
+ activesupport (>= 4.2.0, < 5.0)
90
+ nokogiri (~> 1.6)
93
91
  rails-deprecated_sanitizer (>= 1.0.1)
94
- rails-html-sanitizer (1.0.3)
95
- loofah (~> 2.0)
96
- railties (4.2.6)
97
- actionpack (= 4.2.6)
98
- activesupport (= 4.2.6)
92
+ rails-html-sanitizer (1.0.4)
93
+ loofah (~> 2.2, >= 2.2.2)
94
+ railties (4.2.10)
95
+ actionpack (= 4.2.10)
96
+ activesupport (= 4.2.10)
99
97
  rake (>= 0.8.7)
100
98
  thor (>= 0.18.1, < 2.0)
101
99
  rake (10.5.0)
@@ -117,16 +115,16 @@ GEM
117
115
  json (~> 1.8)
118
116
  simplecov-html (~> 0.10.0)
119
117
  simplecov-html (0.10.0)
120
- sprockets (3.6.1)
118
+ sprockets (3.7.2)
121
119
  concurrent-ruby (~> 1.0)
122
120
  rack (> 1, < 3)
123
- sprockets-rails (3.0.4)
121
+ sprockets-rails (3.2.1)
124
122
  actionpack (>= 4.0)
125
123
  activesupport (>= 4.0)
126
124
  sprockets (>= 3.0.0)
127
125
  thor (0.19.1)
128
- thread_safe (0.3.5)
129
- tzinfo (1.2.2)
126
+ thread_safe (0.3.6)
127
+ tzinfo (1.2.5)
130
128
  thread_safe (~> 0.1)
131
129
 
132
130
  PLATFORMS
@@ -137,10 +135,10 @@ DEPENDENCIES
137
135
  bundler (~> 1.12)
138
136
  codeclimate-test-reporter
139
137
  light-services!
140
- rails (= 4.2.6)
138
+ rails (= 4.2.10)
141
139
  rake (~> 10.0)
142
140
  rspec (~> 3.0)
143
141
  simplecov (~> 0.11.2)
144
142
 
145
143
  BUNDLED WITH
146
- 1.15.4
144
+ 1.16.2
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "5.0.5"
5
+ gem "rails", "5.0.7"
6
6
 
7
7
  gemspec path: "../"
@@ -1,47 +1,47 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.5.4)
4
+ light-services (0.6.0)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.0.5)
11
- actionpack (= 5.0.5)
10
+ actioncable (5.0.7)
11
+ actionpack (= 5.0.7)
12
12
  nio4r (>= 1.2, < 3.0)
13
13
  websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.5)
15
- actionpack (= 5.0.5)
16
- actionview (= 5.0.5)
17
- activejob (= 5.0.5)
14
+ actionmailer (5.0.7)
15
+ actionpack (= 5.0.7)
16
+ actionview (= 5.0.7)
17
+ activejob (= 5.0.7)
18
18
  mail (~> 2.5, >= 2.5.4)
19
19
  rails-dom-testing (~> 2.0)
20
- actionpack (5.0.5)
21
- actionview (= 5.0.5)
22
- activesupport (= 5.0.5)
20
+ actionpack (5.0.7)
21
+ actionview (= 5.0.7)
22
+ activesupport (= 5.0.7)
23
23
  rack (~> 2.0)
24
24
  rack-test (~> 0.6.3)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.0.5)
28
- activesupport (= 5.0.5)
27
+ actionview (5.0.7)
28
+ activesupport (= 5.0.7)
29
29
  builder (~> 3.1)
30
30
  erubis (~> 2.7.0)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.5)
34
- activesupport (= 5.0.5)
33
+ activejob (5.0.7)
34
+ activesupport (= 5.0.7)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.0.5)
37
- activesupport (= 5.0.5)
38
- activerecord (5.0.5)
39
- activemodel (= 5.0.5)
40
- activesupport (= 5.0.5)
36
+ activemodel (5.0.7)
37
+ activesupport (= 5.0.7)
38
+ activerecord (5.0.7)
39
+ activemodel (= 5.0.7)
40
+ activesupport (= 5.0.7)
41
41
  arel (~> 7.0)
42
- activesupport (5.0.5)
42
+ activesupport (5.0.7)
43
43
  concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (~> 0.7)
44
+ i18n (>= 0.7, < 2)
45
45
  minitest (~> 5.1)
46
46
  tzinfo (~> 1.1)
47
47
  appraisal (2.2.0)
@@ -53,49 +53,50 @@ GEM
53
53
  codeclimate-test-reporter (1.0.8)
54
54
  simplecov (<= 0.13)
55
55
  concurrent-ruby (1.0.5)
56
+ crass (1.0.4)
56
57
  diff-lcs (1.3)
57
58
  docile (1.1.5)
58
59
  erubis (2.7.0)
59
- globalid (0.4.0)
60
+ globalid (0.4.1)
60
61
  activesupport (>= 4.2.0)
61
- i18n (0.8.6)
62
+ i18n (1.1.0)
63
+ concurrent-ruby (~> 1.0)
62
64
  json (1.8.6)
63
- loofah (2.0.3)
65
+ loofah (2.2.2)
66
+ crass (~> 1.0.2)
64
67
  nokogiri (>= 1.5.9)
65
- mail (2.6.6)
66
- mime-types (>= 1.16, < 4)
67
- method_source (0.8.2)
68
- mime-types (3.1)
69
- mime-types-data (~> 3.2015)
70
- mime-types-data (3.2016.0521)
71
- mini_portile2 (2.2.0)
72
- minitest (5.10.3)
73
- nio4r (2.1.0)
74
- nokogiri (1.8.0)
75
- mini_portile2 (~> 2.2.0)
76
- rack (2.0.3)
68
+ mail (2.7.0)
69
+ mini_mime (>= 0.1.1)
70
+ method_source (0.9.0)
71
+ mini_mime (1.0.1)
72
+ mini_portile2 (2.3.0)
73
+ minitest (5.11.3)
74
+ nio4r (2.3.1)
75
+ nokogiri (1.8.4)
76
+ mini_portile2 (~> 2.3.0)
77
+ rack (2.0.5)
77
78
  rack-test (0.6.3)
78
79
  rack (>= 1.0)
79
- rails (5.0.5)
80
- actioncable (= 5.0.5)
81
- actionmailer (= 5.0.5)
82
- actionpack (= 5.0.5)
83
- actionview (= 5.0.5)
84
- activejob (= 5.0.5)
85
- activemodel (= 5.0.5)
86
- activerecord (= 5.0.5)
87
- activesupport (= 5.0.5)
80
+ rails (5.0.7)
81
+ actioncable (= 5.0.7)
82
+ actionmailer (= 5.0.7)
83
+ actionpack (= 5.0.7)
84
+ actionview (= 5.0.7)
85
+ activejob (= 5.0.7)
86
+ activemodel (= 5.0.7)
87
+ activerecord (= 5.0.7)
88
+ activesupport (= 5.0.7)
88
89
  bundler (>= 1.3.0)
89
- railties (= 5.0.5)
90
+ railties (= 5.0.7)
90
91
  sprockets-rails (>= 2.0.0)
91
92
  rails-dom-testing (2.0.3)
92
93
  activesupport (>= 4.2.0)
93
94
  nokogiri (>= 1.6)
94
- rails-html-sanitizer (1.0.3)
95
- loofah (~> 2.0)
96
- railties (5.0.5)
97
- actionpack (= 5.0.5)
98
- activesupport (= 5.0.5)
95
+ rails-html-sanitizer (1.0.4)
96
+ loofah (~> 2.2, >= 2.2.2)
97
+ railties (5.0.7)
98
+ actionpack (= 5.0.7)
99
+ activesupport (= 5.0.7)
99
100
  method_source
100
101
  rake (>= 0.8.7)
101
102
  thor (>= 0.18.1, < 2.0)
@@ -118,20 +119,20 @@ GEM
118
119
  json (~> 1.8)
119
120
  simplecov-html (~> 0.10.0)
120
121
  simplecov-html (0.10.2)
121
- sprockets (3.7.1)
122
+ sprockets (3.7.2)
122
123
  concurrent-ruby (~> 1.0)
123
124
  rack (> 1, < 3)
124
- sprockets-rails (3.2.0)
125
+ sprockets-rails (3.2.1)
125
126
  actionpack (>= 4.0)
126
127
  activesupport (>= 4.0)
127
128
  sprockets (>= 3.0.0)
128
129
  thor (0.20.0)
129
130
  thread_safe (0.3.6)
130
- tzinfo (1.2.3)
131
+ tzinfo (1.2.5)
131
132
  thread_safe (~> 0.1)
132
133
  websocket-driver (0.6.5)
133
134
  websocket-extensions (>= 0.1.0)
134
- websocket-extensions (0.1.2)
135
+ websocket-extensions (0.1.3)
135
136
 
136
137
  PLATFORMS
137
138
  ruby
@@ -141,10 +142,10 @@ DEPENDENCIES
141
142
  bundler (~> 1.12)
142
143
  codeclimate-test-reporter
143
144
  light-services!
144
- rails (= 5.0.5)
145
+ rails (= 5.0.7)
145
146
  rake (~> 10.0)
146
147
  rspec (~> 3.0)
147
148
  simplecov (~> 0.11.2)
148
149
 
149
150
  BUNDLED WITH
150
- 1.15.4
151
+ 1.16.2
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "5.1.3"
5
+ gem "rails", "5.1.6"
6
6
 
7
7
  gemspec path: "../"
@@ -1,47 +1,47 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.5.4)
4
+ light-services (0.6.0)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.1.3)
11
- actionpack (= 5.1.3)
10
+ actioncable (5.1.6)
11
+ actionpack (= 5.1.6)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (~> 0.6.1)
14
- actionmailer (5.1.3)
15
- actionpack (= 5.1.3)
16
- actionview (= 5.1.3)
17
- activejob (= 5.1.3)
14
+ actionmailer (5.1.6)
15
+ actionpack (= 5.1.6)
16
+ actionview (= 5.1.6)
17
+ activejob (= 5.1.6)
18
18
  mail (~> 2.5, >= 2.5.4)
19
19
  rails-dom-testing (~> 2.0)
20
- actionpack (5.1.3)
21
- actionview (= 5.1.3)
22
- activesupport (= 5.1.3)
20
+ actionpack (5.1.6)
21
+ actionview (= 5.1.6)
22
+ activesupport (= 5.1.6)
23
23
  rack (~> 2.0)
24
- rack-test (~> 0.6.3)
24
+ rack-test (>= 0.6.3)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.1.3)
28
- activesupport (= 5.1.3)
27
+ actionview (5.1.6)
28
+ activesupport (= 5.1.6)
29
29
  builder (~> 3.1)
30
30
  erubi (~> 1.4)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.1.3)
34
- activesupport (= 5.1.3)
33
+ activejob (5.1.6)
34
+ activesupport (= 5.1.6)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.1.3)
37
- activesupport (= 5.1.3)
38
- activerecord (5.1.3)
39
- activemodel (= 5.1.3)
40
- activesupport (= 5.1.3)
36
+ activemodel (5.1.6)
37
+ activesupport (= 5.1.6)
38
+ activerecord (5.1.6)
39
+ activemodel (= 5.1.6)
40
+ activesupport (= 5.1.6)
41
41
  arel (~> 8.0)
42
- activesupport (5.1.3)
42
+ activesupport (5.1.6)
43
43
  concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (~> 0.7)
44
+ i18n (>= 0.7, < 2)
45
45
  minitest (~> 5.1)
46
46
  tzinfo (~> 1.1)
47
47
  appraisal (2.2.0)
@@ -53,49 +53,50 @@ GEM
53
53
  codeclimate-test-reporter (1.0.8)
54
54
  simplecov (<= 0.13)
55
55
  concurrent-ruby (1.0.5)
56
+ crass (1.0.4)
56
57
  diff-lcs (1.3)
57
58
  docile (1.1.5)
58
- erubi (1.6.1)
59
- globalid (0.4.0)
59
+ erubi (1.7.1)
60
+ globalid (0.4.1)
60
61
  activesupport (>= 4.2.0)
61
- i18n (0.8.6)
62
+ i18n (1.1.0)
63
+ concurrent-ruby (~> 1.0)
62
64
  json (1.8.6)
63
- loofah (2.0.3)
65
+ loofah (2.2.2)
66
+ crass (~> 1.0.2)
64
67
  nokogiri (>= 1.5.9)
65
- mail (2.6.6)
66
- mime-types (>= 1.16, < 4)
67
- method_source (0.8.2)
68
- mime-types (3.1)
69
- mime-types-data (~> 3.2015)
70
- mime-types-data (3.2016.0521)
71
- mini_portile2 (2.2.0)
72
- minitest (5.10.3)
73
- nio4r (2.1.0)
74
- nokogiri (1.8.0)
75
- mini_portile2 (~> 2.2.0)
76
- rack (2.0.3)
77
- rack-test (0.6.3)
78
- rack (>= 1.0)
79
- rails (5.1.3)
80
- actioncable (= 5.1.3)
81
- actionmailer (= 5.1.3)
82
- actionpack (= 5.1.3)
83
- actionview (= 5.1.3)
84
- activejob (= 5.1.3)
85
- activemodel (= 5.1.3)
86
- activerecord (= 5.1.3)
87
- activesupport (= 5.1.3)
68
+ mail (2.7.0)
69
+ mini_mime (>= 0.1.1)
70
+ method_source (0.9.0)
71
+ mini_mime (1.0.1)
72
+ mini_portile2 (2.3.0)
73
+ minitest (5.11.3)
74
+ nio4r (2.3.1)
75
+ nokogiri (1.8.4)
76
+ mini_portile2 (~> 2.3.0)
77
+ rack (2.0.5)
78
+ rack-test (1.1.0)
79
+ rack (>= 1.0, < 3)
80
+ rails (5.1.6)
81
+ actioncable (= 5.1.6)
82
+ actionmailer (= 5.1.6)
83
+ actionpack (= 5.1.6)
84
+ actionview (= 5.1.6)
85
+ activejob (= 5.1.6)
86
+ activemodel (= 5.1.6)
87
+ activerecord (= 5.1.6)
88
+ activesupport (= 5.1.6)
88
89
  bundler (>= 1.3.0)
89
- railties (= 5.1.3)
90
+ railties (= 5.1.6)
90
91
  sprockets-rails (>= 2.0.0)
91
92
  rails-dom-testing (2.0.3)
92
93
  activesupport (>= 4.2.0)
93
94
  nokogiri (>= 1.6)
94
- rails-html-sanitizer (1.0.3)
95
- loofah (~> 2.0)
96
- railties (5.1.3)
97
- actionpack (= 5.1.3)
98
- activesupport (= 5.1.3)
95
+ rails-html-sanitizer (1.0.4)
96
+ loofah (~> 2.2, >= 2.2.2)
97
+ railties (5.1.6)
98
+ actionpack (= 5.1.6)
99
+ activesupport (= 5.1.6)
99
100
  method_source
100
101
  rake (>= 0.8.7)
101
102
  thor (>= 0.18.1, < 2.0)
@@ -118,20 +119,20 @@ GEM
118
119
  json (~> 1.8)
119
120
  simplecov-html (~> 0.10.0)
120
121
  simplecov-html (0.10.2)
121
- sprockets (3.7.1)
122
+ sprockets (3.7.2)
122
123
  concurrent-ruby (~> 1.0)
123
124
  rack (> 1, < 3)
124
- sprockets-rails (3.2.0)
125
+ sprockets-rails (3.2.1)
125
126
  actionpack (>= 4.0)
126
127
  activesupport (>= 4.0)
127
128
  sprockets (>= 3.0.0)
128
129
  thor (0.20.0)
129
130
  thread_safe (0.3.6)
130
- tzinfo (1.2.3)
131
+ tzinfo (1.2.5)
131
132
  thread_safe (~> 0.1)
132
133
  websocket-driver (0.6.5)
133
134
  websocket-extensions (>= 0.1.0)
134
- websocket-extensions (0.1.2)
135
+ websocket-extensions (0.1.3)
135
136
 
136
137
  PLATFORMS
137
138
  ruby
@@ -141,10 +142,10 @@ DEPENDENCIES
141
142
  bundler (~> 1.12)
142
143
  codeclimate-test-reporter
143
144
  light-services!
144
- rails (= 5.1.3)
145
+ rails (= 5.1.6)
145
146
  rake (~> 10.0)
146
147
  rspec (~> 3.0)
147
148
  simplecov (~> 0.11.2)
148
149
 
149
150
  BUNDLED WITH
150
- 1.15.4
151
+ 1.16.2
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "5.2.1"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,159 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ light-services (0.6.0)
5
+ rails (> 4.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.2.1)
11
+ actionpack (= 5.2.1)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.1)
15
+ actionpack (= 5.2.1)
16
+ actionview (= 5.2.1)
17
+ activejob (= 5.2.1)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.2.1)
21
+ actionview (= 5.2.1)
22
+ activesupport (= 5.2.1)
23
+ rack (~> 2.0)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.2.1)
28
+ activesupport (= 5.2.1)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.1)
34
+ activesupport (= 5.2.1)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.2.1)
37
+ activesupport (= 5.2.1)
38
+ activerecord (5.2.1)
39
+ activemodel (= 5.2.1)
40
+ activesupport (= 5.2.1)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.1)
43
+ actionpack (= 5.2.1)
44
+ activerecord (= 5.2.1)
45
+ marcel (~> 0.3.1)
46
+ activesupport (5.2.1)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (>= 0.7, < 2)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ appraisal (2.2.0)
52
+ bundler
53
+ rake
54
+ thor (>= 0.14.0)
55
+ arel (9.0.0)
56
+ builder (3.2.3)
57
+ codeclimate-test-reporter (1.0.8)
58
+ simplecov (<= 0.13)
59
+ concurrent-ruby (1.0.5)
60
+ crass (1.0.4)
61
+ diff-lcs (1.3)
62
+ docile (1.1.5)
63
+ erubi (1.7.1)
64
+ globalid (0.4.1)
65
+ activesupport (>= 4.2.0)
66
+ i18n (1.1.0)
67
+ concurrent-ruby (~> 1.0)
68
+ json (1.8.6)
69
+ loofah (2.2.2)
70
+ crass (~> 1.0.2)
71
+ nokogiri (>= 1.5.9)
72
+ mail (2.7.0)
73
+ mini_mime (>= 0.1.1)
74
+ marcel (0.3.2)
75
+ mimemagic (~> 0.3.2)
76
+ method_source (0.9.0)
77
+ mimemagic (0.3.2)
78
+ mini_mime (1.0.1)
79
+ mini_portile2 (2.3.0)
80
+ minitest (5.11.3)
81
+ nio4r (2.3.1)
82
+ nokogiri (1.8.4)
83
+ mini_portile2 (~> 2.3.0)
84
+ rack (2.0.5)
85
+ rack-test (1.1.0)
86
+ rack (>= 1.0, < 3)
87
+ rails (5.2.1)
88
+ actioncable (= 5.2.1)
89
+ actionmailer (= 5.2.1)
90
+ actionpack (= 5.2.1)
91
+ actionview (= 5.2.1)
92
+ activejob (= 5.2.1)
93
+ activemodel (= 5.2.1)
94
+ activerecord (= 5.2.1)
95
+ activestorage (= 5.2.1)
96
+ activesupport (= 5.2.1)
97
+ bundler (>= 1.3.0)
98
+ railties (= 5.2.1)
99
+ sprockets-rails (>= 2.0.0)
100
+ rails-dom-testing (2.0.3)
101
+ activesupport (>= 4.2.0)
102
+ nokogiri (>= 1.6)
103
+ rails-html-sanitizer (1.0.4)
104
+ loofah (~> 2.2, >= 2.2.2)
105
+ railties (5.2.1)
106
+ actionpack (= 5.2.1)
107
+ activesupport (= 5.2.1)
108
+ method_source
109
+ rake (>= 0.8.7)
110
+ thor (>= 0.19.0, < 2.0)
111
+ rake (10.5.0)
112
+ rspec (3.8.0)
113
+ rspec-core (~> 3.8.0)
114
+ rspec-expectations (~> 3.8.0)
115
+ rspec-mocks (~> 3.8.0)
116
+ rspec-core (3.8.0)
117
+ rspec-support (~> 3.8.0)
118
+ rspec-expectations (3.8.1)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.8.0)
121
+ rspec-mocks (3.8.0)
122
+ diff-lcs (>= 1.2.0, < 2.0)
123
+ rspec-support (~> 3.8.0)
124
+ rspec-support (3.8.0)
125
+ simplecov (0.11.2)
126
+ docile (~> 1.1.0)
127
+ json (~> 1.8)
128
+ simplecov-html (~> 0.10.0)
129
+ simplecov-html (0.10.2)
130
+ sprockets (3.7.2)
131
+ concurrent-ruby (~> 1.0)
132
+ rack (> 1, < 3)
133
+ sprockets-rails (3.2.1)
134
+ actionpack (>= 4.0)
135
+ activesupport (>= 4.0)
136
+ sprockets (>= 3.0.0)
137
+ thor (0.20.0)
138
+ thread_safe (0.3.6)
139
+ tzinfo (1.2.5)
140
+ thread_safe (~> 0.1)
141
+ websocket-driver (0.7.0)
142
+ websocket-extensions (>= 0.1.0)
143
+ websocket-extensions (0.1.3)
144
+
145
+ PLATFORMS
146
+ ruby
147
+
148
+ DEPENDENCIES
149
+ appraisal (~> 2.1)
150
+ bundler (~> 1.12)
151
+ codeclimate-test-reporter
152
+ light-services!
153
+ rails (= 5.2.1)
154
+ rake (~> 10.0)
155
+ rspec (~> 3.0)
156
+ simplecov (~> 0.11.2)
157
+
158
+ BUNDLED WITH
159
+ 1.16.2
@@ -22,7 +22,7 @@ module Light
22
22
  end
23
23
 
24
24
  def call
25
- run_service
25
+ within_transaction { run_service }
26
26
  end
27
27
 
28
28
  def success?
@@ -53,6 +53,16 @@ module Light
53
53
  run_callbacks(:finally, force_run: true)
54
54
  success?
55
55
  end
56
+
57
+ def within_transaction
58
+ if defined?(ActiveRecord::Base)
59
+ ActiveRecord::Base.transaction do
60
+ yield
61
+ end
62
+ else
63
+ yield
64
+ end
65
+ end
56
66
  end
57
67
  end
58
68
  end
@@ -7,21 +7,27 @@ module Light
7
7
  @storage = {}
8
8
  end
9
9
 
10
- def add(key, message)
10
+ def add(key, message, rollback: true)
11
11
  storage[key] ||= []
12
12
  storage[key] << message
13
+
14
+ rollback! if rollback
13
15
  end
14
16
 
15
- def from_record(record)
17
+ def from_record(record, rollback: true)
16
18
  record.errors.to_h.each do |key, message|
17
19
  add(key, message)
18
20
  end
21
+
22
+ rollback! if rollback
19
23
  end
20
24
 
21
- def from_service(service)
25
+ def from_service(service, rollback: true)
22
26
  service.errors.each do |key, message|
23
27
  add(key, message)
24
28
  end
29
+
30
+ rollback! if rollback
25
31
  end
26
32
 
27
33
  def delete(key)
@@ -58,8 +64,12 @@ module Light
58
64
 
59
65
  private
60
66
 
61
- # Getters/Setters
67
+ # Getters / Setters
62
68
  attr_accessor :storage
69
+
70
+ def rollback!
71
+ raise ActiveRecord::Rollback if defined?(ActiveRecord::Rollback)
72
+ end
63
73
  end
64
74
  end
65
75
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Light
4
4
  module Services
5
- VERSION = '0.5.4'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Emelianenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-22 00:00:00.000000000 Z
11
+ date: 2018-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -140,6 +140,8 @@ files:
140
140
  - gemfiles/rails_5_0.gemfile.lock
141
141
  - gemfiles/rails_5_1.gemfile
142
142
  - gemfiles/rails_5_1.gemfile.lock
143
+ - gemfiles/rails_5_2.gemfile
144
+ - gemfiles/rails_5_2.gemfile.lock
143
145
  - lib/light/services.rb
144
146
  - lib/light/services/base.rb
145
147
  - lib/light/services/callbacks.rb
@@ -169,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
171
  version: '0'
170
172
  requirements: []
171
173
  rubyforge_project:
172
- rubygems_version: 2.6.12
174
+ rubygems_version: 2.7.6
173
175
  signing_key:
174
176
  specification_version: 4
175
177
  summary: Light pattern Services Object for Ruby/Rails