effective_developer 0.7.0 → 0.7.2
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 +4 -4
- data/README.md +9 -0
- data/app/models/effective/csv_importer.rb +1 -1
- data/lib/effective_developer/version.rb +1 -1
- data/lib/generators/effective/ability_generator.rb +1 -1
- data/lib/generators/effective/scaffold_generator.rb +1 -1
- data/lib/scaffolds/fields/_field_url.html.haml +1 -0
- data/lib/tasks/effective_csv_importer.rake +3 -3
- data/lib/tasks/pg_pull.rake +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d37c9d0a46ceaa1efa533de250dad4914adbc1c9b8b00bc530f3d0bedf725dfa
|
4
|
+
data.tar.gz: 81b6a6c729c22e066f437020a1d283af6503066d3f98bdd69a26c0bfd0712486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29a6152263a8d0d93ab15f42b7c9e4c68a6a561af5afb77bd23ab01844a6add49a4077ba9e317507b3aae7239b647bdd222ff99a02922e3bd210ae00308a5e6f
|
7
|
+
data.tar.gz: cd95e02868298e3982ce018ec4e6b81cc18a84dc36117450792ccd5745a6b21fb2b41c8f0d14f3b72f89808fc006dfe3bbd00ae87492db437e73252889094eab
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Effective Developer
|
2
2
|
|
3
|
+
|
3
4
|
This gem contains some developer quality of life scripts and rails helpers.
|
4
5
|
|
5
6
|
## Getting Started
|
@@ -440,6 +441,14 @@ rails generate effective:views thing
|
|
440
441
|
rails generate effective:form thing
|
441
442
|
```
|
442
443
|
|
444
|
+
## Replace SQL Example
|
445
|
+
|
446
|
+
You can do this:
|
447
|
+
|
448
|
+
```
|
449
|
+
Region.update_all("snippets = REPLACE(snippets, 'ActionController::Parameters', 'ActiveSupport::HashWithIndifferentAccess')")
|
450
|
+
```
|
451
|
+
|
443
452
|
## License
|
444
453
|
|
445
454
|
MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
|
@@ -12,7 +12,7 @@ module Effective
|
|
12
12
|
def initialize(csv_file = default_csv_files(), header: true)
|
13
13
|
@has_header_row = header
|
14
14
|
|
15
|
-
@csv_file = Array(csv_file).find { |csv_file| File.
|
15
|
+
@csv_file = Array(csv_file).find { |csv_file| File.exist?(csv_file) }
|
16
16
|
raise "#{csv_file} does not exist" unless @csv_file
|
17
17
|
end
|
18
18
|
|
@@ -18,7 +18,7 @@ module Effective
|
|
18
18
|
class_option :actions, type: :array, default: ['crud'], desc: 'Included actions', banner: 'index show'
|
19
19
|
|
20
20
|
def invoke_model
|
21
|
-
if File.
|
21
|
+
if File.exist?(resource.model_file)
|
22
22
|
say_status(:skipped, :model, :yellow) and return
|
23
23
|
end
|
24
24
|
|
@@ -0,0 +1 @@
|
|
1
|
+
= f.url_field :<%= attribute %>
|
@@ -20,7 +20,7 @@ namespace :csv do
|
|
20
20
|
Dir['lib/csv_importers/*.rb'].each do |file|
|
21
21
|
importer = file.sub('lib/csv_importers/', '').sub('_importer.rb', '')
|
22
22
|
csv_file = "lib/csv_importers/data/#{importer}.csv"
|
23
|
-
next unless File.
|
23
|
+
next unless File.exist?(csv_file)
|
24
24
|
|
25
25
|
# rake csv:import:foo
|
26
26
|
desc "Import #{importer} from #{csv_file}"
|
@@ -42,7 +42,7 @@ namespace :csv do
|
|
42
42
|
Dir['lib/csv_importers/*.rb'].each do |file|
|
43
43
|
importer = file.sub('lib/csv_importers/', '').sub('_importer.rb', '')
|
44
44
|
csv_file = "lib/csv_importers/data/#{importer}.csv"
|
45
|
-
next unless File.
|
45
|
+
next unless File.exist?(csv_file)
|
46
46
|
|
47
47
|
Rake::Task["csv:import:#{importer}"].invoke
|
48
48
|
end
|
@@ -65,7 +65,7 @@ namespace :csv do
|
|
65
65
|
csv_file = file.split('/').last.gsub('.csv', '')
|
66
66
|
|
67
67
|
next if (Array(args.file_name) != ['all'] && Array(args.file_name).include?(csv_file) == false)
|
68
|
-
next if args.file_name == 'all' && File.
|
68
|
+
next if args.file_name == 'all' && File.exist?("#{Rails.root}/lib/csv_importers/#{csv_file}_importer.rb")
|
69
69
|
|
70
70
|
klass = csv_file.classify.pluralize
|
71
71
|
columns = CSV.open(file, 'r') { |csv| csv.first }
|
data/lib/tasks/pg_pull.rake
CHANGED
@@ -99,7 +99,7 @@ namespace :pg do
|
|
99
99
|
args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
|
100
100
|
|
101
101
|
# Validate filename
|
102
|
-
unless File.
|
102
|
+
unless File.exist?(Rails.root + args.filename)
|
103
103
|
puts "#{args.filename || none} does not exist"; exit
|
104
104
|
end
|
105
105
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_developer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/scaffolds/fields/_field_select_constant.html.haml
|
109
109
|
- lib/scaffolds/fields/_field_string.html.haml
|
110
110
|
- lib/scaffolds/fields/_field_text.html.haml
|
111
|
+
- lib/scaffolds/fields/_field_url.html.haml
|
111
112
|
- lib/scaffolds/fields/_nested_resource_fields.html.haml
|
112
113
|
- lib/scaffolds/importers/csv_importer.rb
|
113
114
|
- lib/tasks/annotate.rake
|