draft_approve 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ca60f47abb98e39a15ed8e91908df99fe8c7e86cabd5b49f2c7af09d8dc3c81
4
- data.tar.gz: 6131c6c3c2ab5b356b3b83008102faedb4cdd9ef91f4a3a52b9b62c01d7933c4
3
+ metadata.gz: 3ba2c093a802d7fdfb81b21dfa278b46be1467cc35f9f16ba3b899b036e9baaf
4
+ data.tar.gz: 1b23bf671ac49b3fc89be8ed48266c1c51b021f06f656ad90e100f0aa365a7a8
5
5
  SHA512:
6
- metadata.gz: c9a69e0b14841cac940315acd0f6eaa17307b5c988c8f61ab67409ba3954b06a32840aa52786bddbc0908ef9b326fc89b29d52dcca9d3287c1dd90686d275deb
7
- data.tar.gz: e4c22ba25d5d9f106928dc154a3b380113f32a3748d6826c016f11f15f632f5a052e0664f8f3fdf6a733aa1bbdc24ff2b44731febb1f45343f8224805f1b42bb
6
+ metadata.gz: 261258a61c7f82a06cd1f239eb74642c2e4c0ce9eca19e8f44e0a0364e8eca8dffc40807e4ad0343645e28849e8b6a8eef467ba3466263d9a693f61c3bfa4f0f
7
+ data.tar.gz: 3c053ce7f96948595b378671666311940c33e574971ed3c7bb03494c4efd039c55f9499d5fade3392b679ea83a132a39fd633237c2c0dd1ac12e77767657b60b
@@ -0,0 +1,56 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/ruby:2.4.1-node-browsers
11
+ - image: circleci/postgres:10.6
12
+ environment:
13
+ - POSTGRES_USER=draft_approve_test
14
+ - POSTGRES_DB=draft_approve_test
15
+
16
+ # Specify service dependencies here if necessary
17
+ # CircleCI maintains a library of pre-built images
18
+ # documented at https://circleci.com/docs/2.0/circleci-images/
19
+ # - image: circleci/postgres:9.4
20
+
21
+ working_directory: ~/repo
22
+
23
+ steps:
24
+ - checkout
25
+
26
+ # Download and cache dependencies
27
+ - restore_cache:
28
+ keys:
29
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
30
+ # fallback to using the latest cache if no exact match is found
31
+ - v1-dependencies-
32
+
33
+ - run:
34
+ name: install dependencies
35
+ command: |
36
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
37
+
38
+ - save_cache:
39
+ paths:
40
+ - ./vendor/bundle
41
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
42
+
43
+ # run tests!
44
+ - run:
45
+ name: run tests
46
+ command: |
47
+ mkdir /tmp/test-results
48
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
49
+ bundle exec rspec
50
+
51
+ # collect reports
52
+ - store_test_results:
53
+ path: /tmp/test-results
54
+ - store_artifacts:
55
+ path: /tmp/test-results
56
+ destination: test-results
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- draft_approve (0.2.0)
4
+ draft_approve (0.3.0)
5
5
  activerecord (~> 5.2)
6
6
 
7
7
  GEM
@@ -28,13 +28,13 @@ GEM
28
28
  simplecov
29
29
  url
30
30
  coderay (1.1.2)
31
- concurrent-ruby (1.1.4)
31
+ concurrent-ruby (1.1.5)
32
32
  database_cleaner (1.7.0)
33
33
  diff-lcs (1.3)
34
34
  docile (1.3.1)
35
- factory_bot (4.11.1)
36
- activesupport (>= 3.0.0)
37
- i18n (1.5.3)
35
+ factory_bot (5.0.2)
36
+ activesupport (>= 4.2.0)
37
+ i18n (1.6.0)
38
38
  concurrent-ruby (~> 1.0)
39
39
  json (2.1.0)
40
40
  method_source (0.9.2)
@@ -43,7 +43,7 @@ GEM
43
43
  pry (0.12.2)
44
44
  coderay (~> 1.1.0)
45
45
  method_source (~> 0.9.0)
46
- rake (10.5.0)
46
+ rake (12.3.2)
47
47
  rspec (3.8.0)
48
48
  rspec-core (~> 3.8.0)
49
49
  rspec-expectations (~> 3.8.0)
@@ -62,13 +62,13 @@ GEM
62
62
  json (>= 1.8, < 3)
63
63
  simplecov-html (~> 0.10.0)
64
64
  simplecov-html (0.10.2)
65
- sqlite3 (1.3.13)
65
+ sqlite3 (1.4.1)
66
66
  thor (0.20.3)
67
67
  thread_safe (0.3.6)
68
68
  tzinfo (1.2.5)
69
69
  thread_safe (~> 0.1)
70
70
  url (0.3.2)
71
- yard (0.9.18)
71
+ yard (0.9.20)
72
72
 
73
73
  PLATFORMS
74
74
  ruby
@@ -79,10 +79,10 @@ DEPENDENCIES
79
79
  codecov (~> 0.1)
80
80
  database_cleaner (~> 1.7)
81
81
  draft_approve!
82
- factory_bot (~> 4.11)
82
+ factory_bot (~> 5.0)
83
83
  pg (>= 0.18, < 2.0)
84
84
  pry (~> 0.12)
85
- rake (~> 10.0)
85
+ rake (~> 12.3)
86
86
  rspec (~> 3.0)
87
87
  sqlite3 (~> 1.3)
88
88
  yard (~> 0.9.18)
@@ -43,12 +43,12 @@ Gem::Specification.new do |spec|
43
43
  spec.add_dependency "activerecord", "~> 5.2"
44
44
 
45
45
  spec.add_development_dependency "bundler", "~> 1.17"
46
- spec.add_development_dependency "rake", "~> 10.0"
46
+ spec.add_development_dependency "rake", "~> 12.3"
47
47
  spec.add_development_dependency "rspec", "~> 3.0"
48
48
  spec.add_development_dependency "database_cleaner", "~> 1.7"
49
49
  spec.add_development_dependency "sqlite3", "~> 1.3"
50
50
  spec.add_development_dependency "pg", ">= 0.18", "< 2.0"
51
- spec.add_development_dependency "factory_bot", "~> 4.11"
51
+ spec.add_development_dependency "factory_bot", "~> 5.0"
52
52
  spec.add_development_dependency "codecov", "~> 0.1"
53
53
  spec.add_development_dependency "appraisal", "~> 2.2"
54
54
  spec.add_development_dependency "pry", "~> 0.12"
@@ -228,12 +228,12 @@ module DraftApprove
228
228
  #
229
229
  # @param include_class_and_id [Boolean] if +true+ and the proxied object
230
230
  # already exists (ie. this isn't a proxy for a new draft), then append
231
- # "<{classname} #{id}>" to the end of the returned string
231
+ # "<[classname] #[id]>" to the end of the returned string
232
232
  #
233
233
  # @return [String] the +to_s+ of the current value of the proxied object
234
234
  # (ie. the value before any changes would take effect). If there is no
235
235
  # current value (ie. this is a proxy for a new draft) then simply
236
- # returns "New {classname}".
236
+ # returns "New [classname]".
237
237
  #
238
238
  # @example
239
239
  # # When draft_changes_proxy is for a new Person
@@ -72,4 +72,15 @@ class Draft < ActiveRecord::Base
72
72
  def apply_changes!
73
73
  DraftApprove::Persistor.write_model_from_draft(self)
74
74
  end
75
+
76
+ # Get a +DraftChangesProxy+ for this +Draft+
77
+ #
78
+ # @return [DraftChangesProxy] a proxy to get changes drafted in this +Draft+
79
+ # and related objects, within the scope of the +DraftTransaction+ this
80
+ # +Draft+ occurred within
81
+ #
82
+ # @see DraftTransaction#draft_proxy_for
83
+ def draft_proxy
84
+ draft_transaction.draft_proxy_for(self)
85
+ end
75
86
  end
@@ -1,3 +1,3 @@
1
1
  module DraftApprove
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draft_approve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Sibley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '12.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '12.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '4.11'
123
+ version: '5.0'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '4.11'
130
+ version: '5.0'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: codecov
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -195,6 +195,7 @@ executables: []
195
195
  extensions: []
196
196
  extra_rdoc_files: []
197
197
  files:
198
+ - ".circleci/config.yml"
198
199
  - ".gitignore"
199
200
  - ".rspec"
200
201
  - ".travis.yml"