effective_developer 0.6.17 → 0.7.1

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: afdbfccc8efdc9eff2b4a6b42f5472e83db4c3ee982ef368e53b90d7714a48f6
4
- data.tar.gz: e6d453b984439748826f01b443f08a4c3f3badbb7b450368e09968b90d62de00
3
+ metadata.gz: 2a3baa552965dbfe71604a75dfe3ceae261b67c4108eac57de0628026879d254
4
+ data.tar.gz: 00c286b3d94e36094a92f08091d096afdc1c234c04aae15e07b8507b992b6156
5
5
  SHA512:
6
- metadata.gz: 5e1cd0f0c90c3ea5e43401fcc6c8117783009316a38b8905b0eb6720ba595d626844760df5deb36632f392eeb5c86b88c4261964b6196ca27db149a57bdfb0c9
7
- data.tar.gz: 6a5ee97023c33eb906509ea0f84796d31eedd9f4b42ca93fc41c0acc6ae2ce1607ac56db9253dde3a30344d5f17e757da1f2901477da30f8873861e219c779ab
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.exists?(csv_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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.6.17'.freeze
2
+ VERSION = '0.7.1'.freeze
3
3
  end
@@ -24,7 +24,7 @@ module Effective
24
24
  end
25
25
 
26
26
  def create_ability
27
- unless File.exists?(resource.abilities_file)
27
+ unless File.exist?(resource.abilities_file)
28
28
  say_status(:skipped, :ability, :yellow) and return
29
29
  end
30
30
 
@@ -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.exists?(resource.model_file)
21
+ if File.exist?(resource.model_file)
22
22
  say_status(:skipped, :model, :yellow) and return
23
23
  end
24
24
 
@@ -1,12 +1 @@
1
- %table.table
2
- %tbody
3
- <% resource.belong_tos.each do |reference| -%>
4
- %tr
5
- %th <%= reference.name.to_s.titleize %>
6
- %td= <%= resource.name %>.<%= reference.name %>
7
- <% end -%>
8
- <% attributes.each do |name, (type, _)| -%>
9
- %tr
10
- %th <%= name.to_s.titleize %>
11
- %td= <%= resource.name %>.<%= name %>
12
- <% end -%>
1
+ = effective_table_with(<%= resource.name %>)
@@ -1,13 +1,2 @@
1
1
  = render 'effective/<%= resource.plural_name %>/layout' do
2
- %table.table
3
- %tbody
4
- <% resource.belong_tos.each do |reference| -%>
5
- %tr
6
- %th <%= reference.name.to_s.titleize %>
7
- %td= <%= resource.name %>.<%= reference.name %>
8
- <% end -%>
9
- <% attributes.each do |name, (type, _)| -%>
10
- %tr
11
- %th <%= name.to_s.titleize %>
12
- %td= <%= resource.name %>.<%= name %>
13
- <% end -%>
2
+ = effective_table_with(<%= resource.name %>)
@@ -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.exists?(csv_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.exists?(csv_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.exists?("#{Rails.root}/lib/csv_importers/#{csv_file}_importer.rb")
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 }
@@ -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.exists?(Rails.root + args.filename)
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.6.17
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-02-24 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails