bullet_train-super_scaffolding 1.0.15 → 1.0.20

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: 5c966df93c569e1cca8e0e0b8be383d696ce36652302d41a33e4d620b521b94d
4
- data.tar.gz: f241ebd8222f05cdb9c1b206f221cfc7b866be44518cfffbeb74df19970438c0
3
+ metadata.gz: a99ab79b243d73afc5fad26003dfd8fec704b86494417bf1fe714edc19c5386e
4
+ data.tar.gz: e6b2da40c5450302bc41446ce68ec07b44f9f92d36b7df7e99b5c0e230a00046
5
5
  SHA512:
6
- metadata.gz: 3a3455329a08c928e3cb85ede143268c8c7eec588676d823a0823b44c2e95847f3f8fa01afcf19dabe6c68e782386f1d5eff856b500b6314047c55bab460f2fc
7
- data.tar.gz: 2fa179db17354d27695821ab2555ca61b2c61130992a940a01533ab678e05f8ca06fa98bdad3bc5fcfb55c7ed16a5b3f7b7ebd10021efa96bf4ac87b07b2ee70
6
+ metadata.gz: b1938ac92de1c33f3a100da37dd8916c8f1c33740e10dd9dcc698c4554443e1a935720bc064b057b56b3fd9d3a57387cfc7a4e79c8535189cc2ebcf9461a291f
7
+ data.tar.gz: '09c7548dfcd53b9bb8e69728acac5bd1f442d82456e3b4817c71f5b11fa55e72e6d3a2f4c9bb717ce935eb7a4cf5170c082f91f41261be35266d849451219b90'
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 Andrew Culver
1
+ Copyright 2022 Bullet Train, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,2 +1,2 @@
1
- class BulletTrain::SuperScaffolding::CannotFindParentResourceException < Exception
1
+ class BulletTrain::SuperScaffolding::CannotFindParentResourceException < RuntimeError
2
2
  end
@@ -25,11 +25,11 @@ module BulletTrain
25
25
  puts ""
26
26
  puts " 2️⃣ Use `join-model` scaffolding to prepare the join model for use in `crud-field` scaffolding:".blue
27
27
  puts ""
28
- puts " bin/super-scaffold join-model Projects::AppliedTag project_id[class_name=Project] tag_id[class_name=Projects::Tag]"
28
+ puts " bin/super-scaffold join-model Projects::AppliedTag project_id{class_name=Project} tag_id{class_name=Projects::Tag}"
29
29
  puts ""
30
30
  puts " 3️⃣ Now you can use `crud-field` scaffolding to actually add the field to the form of the parent model:".blue
31
31
  puts ""
32
- puts " bin/super-scaffold crud-field Project tag_ids:super_select[class_name=Projects::Tag]"
32
+ puts " bin/super-scaffold crud-field Project tag_ids:super_select{class_name=Projects::Tag}"
33
33
  puts ""
34
34
  puts " 👋 Heads up! There will be one follow-up step output by this command that you need to take action on."
35
35
  puts ""
@@ -45,8 +45,8 @@ module BulletTrain
45
45
  attributes = [argv[1], argv[2]]
46
46
 
47
47
  # Pretend we're doing a `super_select` scaffolding because it will do the correct thing.
48
- attributes = attributes.map { |attribute| attribute.gsub("\[", ":super_select\[") }
49
- attributes = attributes.map { |attribute| attribute.gsub("\]", ",required\]") }
48
+ attributes = attributes.map { |attribute| attribute.gsub("{", ":super_select{") }
49
+ attributes = attributes.map { |attribute| attribute.gsub("}", ",required}") }
50
50
 
51
51
  transformer = Scaffolding::Transformer.new(child, [primary_parent], @options)
52
52
 
@@ -60,14 +60,14 @@ module BulletTrain
60
60
  inverse_has_many_through_transformer = Scaffolding::Transformer.new(primary_parent, [secondary_parent], @options)
61
61
 
62
62
  # However, for the first attribute, we actually don't need the scope validator (and can't really implement it).
63
- attributes[0] = attributes[0].gsub("\]", ",unscoped\]")
63
+ attributes[0] = attributes[0].gsub("}", ",unscoped}")
64
64
 
65
65
  has_many_through_association = has_many_through_transformer.transform_string("completely_concrete_tangible_things")
66
66
  source = transformer.transform_string("absolutely_abstract_creative_concept.valid_$HAS_MANY_THROUGH_ASSOCIATION")
67
67
  source.gsub!("$HAS_MANY_THROUGH_ASSOCIATION", has_many_through_association)
68
68
 
69
69
  # For the second one, we don't want users to have to define the list of valid options in the join model, so we do this:
70
- attributes[1] = attributes[1].gsub("\]", ",source=#{source}\]")
70
+ attributes[1] = attributes[1].gsub("}", ",source=#{source}}")
71
71
 
72
72
  # This model hasn't been crud scaffolded, so a bunch of views are skipped here, but that's OK!
73
73
  # It does what we need on the files that exist.
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.0.15"
3
+ VERSION = "1.0.20"
4
4
  end
5
5
  end
@@ -276,7 +276,7 @@ class Scaffolding::Transformer
276
276
  begin
277
277
  target_file_content = File.read(transformed_file_name)
278
278
  rescue Errno::ENOENT => _
279
- puts "Couldn't find '#{transformed_file_name}'".red unless (suppress_could_not_find || options[:suppress_could_not_find])
279
+ puts "Couldn't find '#{transformed_file_name}'".red unless suppress_could_not_find || options[:suppress_could_not_find]
280
280
  return false
281
281
  end
282
282
 
@@ -591,7 +591,7 @@ class Scaffolding::Transformer
591
591
 
592
592
  # extract any options they passed in with the field.
593
593
  # will extract options declared with either [] or {}.
594
- type, attribute_options = type.scan(/^(.*)[\[|{](.*)[\]|}]/).first || type
594
+ type, attribute_options = type.scan(/^(.*){(.*)}/).first || type
595
595
 
596
596
  # create a hash of the options.
597
597
  attribute_options = if attribute_options
@@ -1347,16 +1347,20 @@ class Scaffolding::Transformer
1347
1347
  $stdin.gets.chomp
1348
1348
  if `which open`.present?
1349
1349
  `open https://themify.me/themify-icons`
1350
- `open https://fontawesome.com/icons?d=gallery&s=light`
1350
+ if font_awesome?
1351
+ `open https://fontawesome.com/icons?d=gallery&s=light`
1352
+ end
1351
1353
  else
1352
1354
  puts "Sorry! We can't open these URLs automatically on your platform, but you can visit them manually:"
1353
1355
  puts ""
1354
1356
  puts " https://themify.me/themify-icons"
1355
- puts " https://fontawesome.com/icons?d=gallery&s=light"
1357
+ if font_awesome?
1358
+ puts " https://fontawesome.com/icons?d=gallery&s=light"
1359
+ end
1356
1360
  puts ""
1357
1361
  end
1358
1362
  puts ""
1359
- puts "Did you find an icon you wanted to use? Enter the full CSS class here (e.g. 'ti ti-globe' or 'fal fa-puzzle-piece') or hit enter to just use the puzzle piece:"
1363
+ puts "Did you find an icon you wanted to use? Enter the full CSS class here (e.g. 'ti ti-world'#{" or 'fal fa-puzzle-piece'" if font_awesome?}) or hit enter to just use the puzzle piece:"
1360
1364
  icon_name = $stdin.gets.chomp
1361
1365
  puts ""
1362
1366
  unless icon_name.length > 0 || icon_name.downcase == "y"
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.0.15
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-04 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails