bullet_train-super_scaffolding 1.6.17 → 1.6.19
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eafd70da2079b3901c1d863670e76da7058d10eec9aa25158b7b60bfb6599b98
|
4
|
+
data.tar.gz: 5ee1b5f7fcadae48a99923d5228408cee0d80ce69990907e5882ba234e71505d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e38a7f78a0e925e3cc7250a8f16ae583315902347f61d9ea2c36d8db88634e60b500f3702c2c2ce5ae23f6df5d3c20c56fd7e1c15f4ec6b33f1eda4a15503892
|
7
|
+
data.tar.gz: 5cb14fe691394c3656e29e604f09ba1f2e80a7de36efdb717abdf01fb5dee610628feb54b73d4f8d2a18aecfde3f095c8c68e44dd4290a6913acfc54f9abe275
|
@@ -52,28 +52,19 @@ class Scaffolding::RoutesFileManipulator
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def find_namespaces(namespaces, within = nil)
|
55
|
+
namespaces = namespaces.dup
|
55
56
|
results = {}
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# TODO: For some reason we use both strings and symbols for namespaces.
|
63
|
-
# i.e. - ["account"] and [:v1].
|
64
|
-
if namespaces.include?(name.to_sym)
|
65
|
-
results[name.to_sym] = node.line_number - 1
|
66
|
-
elsif namespaces.include?(name)
|
67
|
-
results[name] = node.line_number - 1
|
57
|
+
block_end = Scaffolding::BlockManipulator.find_block_end(starting_from: within, lines: lines) if within
|
58
|
+
lines.each_with_index do |line, line_number|
|
59
|
+
if within
|
60
|
+
next unless line_number > within
|
61
|
+
return results if line_number >= block_end
|
68
62
|
end
|
63
|
+
if line.include?("namespace :#{namespaces.first} do")
|
64
|
+
results[namespaces.shift] = line_number
|
65
|
+
end
|
66
|
+
return results unless namespaces.any?
|
69
67
|
end
|
70
|
-
|
71
|
-
# `within` uses an Array index whereas Masamune nodes use the actual line number, so we write `within + 1` here.
|
72
|
-
if within
|
73
|
-
block_end = @msmn.method_calls.find { |node| node.line_number == within + 1 }.location.end_line
|
74
|
-
results.reject! { |name, line_number| line_number >= block_end }
|
75
|
-
end
|
76
|
-
|
77
68
|
results
|
78
69
|
end
|
79
70
|
|
@@ -427,10 +418,4 @@ class Scaffolding::RoutesFileManipulator
|
|
427
418
|
lines[line_number].gsub!(/resources :(.*)$/, "resources :\\1, concerns: [#{existing_concerns.map { |e| ":#{e}" }.join(", ")}]")
|
428
419
|
end
|
429
420
|
end
|
430
|
-
|
431
|
-
# We have to do this because the `lines` object is constantly changing,
|
432
|
-
# so we reinstantiate this object wherever necessary.
|
433
|
-
def reinstantiate_masamune_object
|
434
|
-
@msmn = Masamune::AbstractSyntaxTree.new(lines.join)
|
435
|
-
end
|
436
421
|
end
|
data/lib/scaffolding/script.rb
CHANGED
@@ -50,16 +50,7 @@ def standard_protip
|
|
50
50
|
puts "If you do that, you can reset to your last commit state by using `git checkout .` and `git clean -d -f` ."
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
`git status`.split("\n")
|
55
|
-
end
|
56
|
-
|
57
|
-
def has_untracked_files?(status_lines)
|
58
|
-
status_lines.include?("Untracked files:")
|
59
|
-
end
|
60
|
-
|
61
|
-
# All untracked files begin with a tab (i.e. - "\tapp/models/model.rb").
|
62
|
-
def get_untracked_files(status_lines)
|
53
|
+
def get_untracked_files
|
63
54
|
`git ls-files --other --exclude-standard`.split("\n")
|
64
55
|
end
|
65
56
|
|
@@ -198,11 +189,11 @@ def check_required_options_for_attributes(scaffolding_type, attributes, child, p
|
|
198
189
|
puts ""
|
199
190
|
|
200
191
|
unless @options["skip-migration-generation"]
|
201
|
-
untracked_files =
|
192
|
+
untracked_files = get_untracked_files
|
202
193
|
generation_thread = Thread.new { `#{generation_command}` }
|
203
194
|
generation_thread.join # Wait for the process to finish.
|
204
195
|
|
205
|
-
newly_untracked_files =
|
196
|
+
newly_untracked_files = get_untracked_files
|
206
197
|
if (newly_untracked_files - untracked_files).size.zero?
|
207
198
|
error_message = <<~MESSAGE
|
208
199
|
Since you have already created the #{child} model, Super Scaffolding won't allow you to re-create it.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-super_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|