fixture_farm 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fixture_farm.rb +22 -0
- data/lib/fixture_farm/fixture_recorder.rb +1 -1
- data/lib/fixture_farm/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3e5adb6c4342555b969a75e117c91b3f004024b221c4213875db0548761c21e
|
4
|
+
data.tar.gz: 61d34c3eb3b0d7021a88942e7337ad9f5c216c2f1310ea125e9ab70a1baf26f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 799185e8d4ffc59caa5a8eccc23c0fdeb1d075c7b190ebd78b17f49da1d64ed543d1eeecf738c6107cf76fd8143f3df5ce3ecd2b4b8c327d92eb805cd9d746fc
|
7
|
+
data.tar.gz: 0a18ec774e121edb0dc8eafa0d67d57cd81cf5c01ace2765693121dc72b64a336554973713683a92b2bceb3d8ca96372ad63b3e4b642415e9e1ef26523f7b93e
|
data/bin/fixture_farm.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../lib/fixture_farm/fixture_recorder'
|
4
|
+
|
5
|
+
def usage
|
6
|
+
puts 'Usage: bundle exec fixture_farm <record|status|stop> [fixture_name_prefix]'
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
10
|
+
case ARGV[0]
|
11
|
+
when 'record'
|
12
|
+
usage unless ARGV[1]
|
13
|
+
FixtureFarm::FixtureRecorder.start_recording_session!(ARGV[1])
|
14
|
+
puts "Recording fixtures with prefix #{ARGV[1]}"
|
15
|
+
when 'status'
|
16
|
+
puts "Recording is #{FixtureFarm::FixtureRecorder.recording_session_in_progress? ? 'on' : 'off'}"
|
17
|
+
when 'stop'
|
18
|
+
FixtureFarm::FixtureRecorder.stop_recording_session!
|
19
|
+
puts 'Stopped recording'
|
20
|
+
else
|
21
|
+
usage
|
22
|
+
end
|
@@ -43,7 +43,7 @@ module FixtureFarm
|
|
43
43
|
subscriber = ActiveSupport::Notifications.subscribe 'sql.active_record' do |event|
|
44
44
|
payload = event.payload
|
45
45
|
|
46
|
-
next unless payload[:name] =~ /(
|
46
|
+
next unless payload[:name] =~ /([:\w]+) Create/
|
47
47
|
|
48
48
|
new_fixture_class_name = Regexp.last_match(1)
|
49
49
|
|
data/lib/fixture_farm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixture_farm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- artemave
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -35,6 +35,7 @@ email:
|
|
35
35
|
- mr@artem.rocks
|
36
36
|
executables:
|
37
37
|
- fixture_farm
|
38
|
+
- fixture_farm.rb
|
38
39
|
extensions: []
|
39
40
|
extra_rdoc_files: []
|
40
41
|
files:
|
@@ -42,6 +43,7 @@ files:
|
|
42
43
|
- README.md
|
43
44
|
- Rakefile
|
44
45
|
- bin/fixture_farm
|
46
|
+
- bin/fixture_farm.rb
|
45
47
|
- lib/fixture_farm.rb
|
46
48
|
- lib/fixture_farm/active_record_extension.rb
|
47
49
|
- lib/fixture_farm/controller_hook.rb
|