effective_developer 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- 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/tasks/effective_csv_importer.rake +3 -3
- data/lib/tasks/pg_pull.rake +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a3baa552965dbfe71604a75dfe3ceae261b67c4108eac57de0628026879d254
|
4
|
+
data.tar.gz: 00c286b3d94e36094a92f08091d096afdc1c234c04aae15e07b8507b992b6156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fb5e6317fc49a9e189e44b3607f612713808c736d86b7991fddcec2cc6177c1b82cb41be672243508697d666c968f0d8d6061f63c5c07ab9c12b471c93263dc
|
7
|
+
data.tar.gz: c7f341a2f2272c2fa9863269b1e30b4f1395a2e7df072e1b6d7ee62153a67bd04ac326f91b99a082d2184444c98b6e2adb11047b8994882195ed2ebce738b893
|
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
|
|
@@ -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.1
|
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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|