effective_developer 0.8.2 → 0.8.3

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: 0f683ab9dcda556c93330af2e81a50c584768c8f0464c1124a6d0af2a9eadf99
4
- data.tar.gz: 2935dd2fef5e23e7a8470e436f1c7e613c561b556737f6c741273276b1372c5a
3
+ metadata.gz: 39fe3d6e71379807005ff5d46cf33e48e737b77d87e955bddaf6e6553453594a
4
+ data.tar.gz: 11dac114ce2e61603fc215c05ae40ecd232ed9d3d12e1d69c5f7764e60cdb336
5
5
  SHA512:
6
- metadata.gz: 706e83a7ed877f3fd686ca4b251db6dc68d393c89401e7266b2f3bfea9cec0c7d8364deda7f1dc3ba393d9f7edec3ec59c2a4d44d2a53e44e443993b5d9e67e9
7
- data.tar.gz: 639e094e77930330bbd6bc2695b058bea2ddf2333b7b74cfc115be8afadd6f454626b13f77060d8dbb0f0b540ea71bce83953154588e5a7b58e4519045bb8be0
6
+ metadata.gz: 47dc5389da4b549cd036456bdde5a08e9312077df43fbc7903c2e3c9dd916b9d013c4bd2434b317e82098a08e72aa5fca569d52adab7e0ff3ada2b4ed5e3949b
7
+ data.tar.gz: 3cd87bac6fb08a62e32e798e9e2ed1db0e6f8bf727033b2c1103529f15c1bd7962826185363e65dc68c969969d21093b0a44fc31b989f7110e1daf10815e1aac
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.8.2'.freeze
2
+ VERSION = '0.8.3'.freeze
3
3
  end
@@ -53,9 +53,11 @@ module Effective
53
53
  abilities += non_crud_actions
54
54
  end
55
55
 
56
- abilities = ['manage'] if abilities.blank? || abilities == (crud_actions - ['show'])
56
+ abilities = ['crud'] if abilities.blank? || abilities == (crud_actions - ['show'])
57
57
 
58
- if abilities.length == 1
58
+ if abilities == ['crud']
59
+ abilities = "#{abilities.first}"
60
+ elsif abilities.length == 1
59
61
  abilities = ":#{abilities.first}"
60
62
  else
61
63
  abilities = '[' + abilities.map { |action| ':' + action }.join(', ') + ']'
@@ -67,7 +69,7 @@ module Effective
67
69
  resource.class_name
68
70
  end
69
71
 
70
- "can #{abilities}, #{name}"
72
+ "can(#{abilities}, #{name})"
71
73
  )
72
74
  end
73
75
  end
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab '<%= resource.human_name.titleize %>' do
2
+ = tab(<%= resource.name %>) do
3
3
  = render '<%= resource.view_file_path("form_#{resource.name}").sub('effective/', '') %>', <%= resource.name %>: <%= resource.name %>
4
4
 
5
5
  <%- if resource.nested_resources.present? || resource.instance.respond_to?(:logs_datatable) %>
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab '<%= resource.human_name.titleize %>' do
2
+ = tab(<%= resource.name %>) do
3
3
  = render '<%= resource.view_file_path("form_#{resource.name}") %>', <%= resource.name %>: <%= resource.name %>
4
4
 
5
5
  <%- if resource.nested_resources.present? %>
@@ -1,5 +1,5 @@
1
1
  = tabs do
2
- = tab '<%= resource.human_name.titleize %>' do
2
+ = tab(<%= resource.name %>) do
3
3
  = render '<%= resource.view_file_path("form_#{resource.name}") %>', <%= resource.name %>: <%= resource.name %>
4
4
 
5
5
  <%- if resource.nested_resources.present? || resource.instance.respond_to?(:logs_datatable) %>
@@ -14,10 +14,10 @@ namespace :pg do
14
14
  # DATABASE=example bundle exec rake pg:load
15
15
  desc 'Creates a new backup on remote server and downloads it to latest.dump'
16
16
  task :pull, [:remote] => :environment do |t, args|
17
- defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
18
- env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'].to_s.presence }
17
+ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }.compact
18
+ env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }.compact
19
19
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
20
- args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
20
+ args.with_defaults(defaults.merge(env_keys).merge(keywords))
21
21
 
22
22
  # Validate Config
23
23
  configs = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env)
@@ -42,7 +42,7 @@ namespace :pg do
42
42
  end
43
43
 
44
44
  # Download it to local
45
- unless system("curl -o #{args.filename} `heroku pg:backups:public-url --remote #{args.remote}`")
45
+ unless system("curl -o #{args.filename} `heroku pg:backups:url --remote #{args.remote}`")
46
46
  abort("Error downloading database")
47
47
  end
48
48
 
@@ -93,10 +93,10 @@ namespace :pg do
93
93
  # DATABASE=example bundle exec rake pg:load
94
94
  desc 'Loads a postgresql .dump file into the development database (latest.dump by default)'
95
95
  task :load, [:filename] => :environment do |t, args|
96
- defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }
97
- env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'] }
96
+ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' }.compact
97
+ env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'] }.compact
98
98
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
99
- args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
99
+ args.with_defaults(defaults.merge(env_keys).merge(keywords))
100
100
 
101
101
  # Validate filename
102
102
  unless File.exist?(Rails.root + args.filename)
@@ -143,10 +143,10 @@ namespace :pg do
143
143
  # bundle exec rake pg:save[something.dump] => Will dump the database to something.dump
144
144
  desc 'Saves the development database to a postgresql .dump file (latest.dump by default)'
145
145
  task :save, [:filename] => :environment do |t, args|
146
- defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }
147
- env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'].to_s.presence }
146
+ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump', logs: 'false' }.compact
147
+ env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] }.compact
148
148
  keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h }
149
- args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords))
149
+ args.with_defaults(defaults.merge(env_keys).merge(keywords))
150
150
 
151
151
  db = if ENV['DATABASE_URL'].to_s.length > 0 && args.database.blank?
152
152
  uri = URI.parse(ENV['DATABASE_URL']) rescue nil
@@ -210,10 +210,10 @@ namespace :pg do
210
210
  abort "Error capturing heroku backup"
211
211
  end
212
212
 
213
- url = (`heroku pg:backups:public-url --app #{args.source}`).chomp
213
+ url = (`heroku pg:backups:url --app #{args.source}`).chomp
214
214
 
215
215
  unless (url || '').length > 0
216
- abort "Error reading public-url from app #{args.source}"
216
+ abort "Error reading url from app #{args.source}"
217
217
  end
218
218
 
219
219
  unless system("heroku pg:backups:restore '#{url}' DATABASE_URL --app #{args.target}")
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.8.2
4
+ version: 0.8.3
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: 2024-04-19 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails