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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8cbbc8b5ba4d68308ca2a88b89429babda497104898294b75cc19dab4a647f62
4
- data.tar.gz: 173a56355b32830c2e559bf0c3fc9437d379ee769055f1ef488d2df49c5d914f
3
+ metadata.gz: 2a3baa552965dbfe71604a75dfe3ceae261b67c4108eac57de0628026879d254
4
+ data.tar.gz: 00c286b3d94e36094a92f08091d096afdc1c234c04aae15e07b8507b992b6156
5
5
  SHA512:
6
- metadata.gz: 2a6e277768ad7dfe4bdb4343e51a1a54c9d393111191ec826e099c4c87553cf8086cba87e2156da8c172056e77ab93884b908cefdaeec2daf664da9554f64459
7
- data.tar.gz: 36af9570a2236981884481ef865220326a8ca5a54c85add457d4cf1ee9a9bedae2538f8d88586deda7bde946c22b86e94a90744446993c8b4ecd01d946b9dc14
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.7.0'.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
 
@@ -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.7.0
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-04-14 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