lato 0.1.8 → 0.1.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6adeb777cb566b2e9d542140ebf059a817c6f94a7afa11b508f194d3ffe6a1a
4
- data.tar.gz: 6e462303df7baf36f4dac902c5c25d1a5da45abeeaf3dca434c6333cc3793555
3
+ metadata.gz: 7ab1d90b203dab6864e4120b6b3dd3ff44bb42c5b42b54fba70e55f982bb260b
4
+ data.tar.gz: 676844d4597c20a7cb64cbaba297ccb55c4c0421b85da981e0fa94919ac2525b
5
5
  SHA512:
6
- metadata.gz: fb537cf7b8d676714301243ed815eb50e3ee9216ce72d10c0f034a38119952c8c5e8b404e70d641ba26c576c89de5a5ebe04085404cc5cb3749cee0ccbbbd931
7
- data.tar.gz: 8b9ef05c50607bce795873155a4be715162abe82c96f9792299fd4aeb91f4f07f50f8e5721d1361c11a9fe916dd13ce8b5531e0a8a8c1dd059d50634a0db0921
6
+ metadata.gz: 5b97a95b0b51722a8416083779d2fa6ee3f87445c36c366fb0ab25659d7d84c65db470c939884ea75755bcbe8cd26669d86919128908d507f24a1e7ed5f59800
7
+ data.tar.gz: 90bedf8377b7d4ba09de99d9fd8653239efdf3d53e0b633c9cba3c0680df7b6d22356addbdcbe7845cebac81e8cf75506b97f76d3dfd00af5784a76b424b5cdb
data/README.md CHANGED
@@ -90,7 +90,7 @@ $ foreman start -f Procfile.dev
90
90
  ## Publish
91
91
 
92
92
  ```shell
93
- $ ruby bin/publish.rb
93
+ $ ruby ./bin/publish.rb
94
94
  ```
95
95
 
96
96
  ## License
@@ -44,7 +44,7 @@ module Lato
44
44
  columns = options[:columns] || @_lato_index[key][:columns] || collection.column_names || []
45
45
  sortable_columns = @_lato_index[key][:sortable_columns] || []
46
46
  searchable_columns = @_lato_index[key][:searchable_columns] || []
47
- model_name_underscore = collection.model.name.underscore
47
+ model_name_underscore = options[:model_name] || collection.model.name.gsub('/', '_').underscore
48
48
 
49
49
  render(
50
50
  'lato/components/index',
@@ -75,7 +75,7 @@ module Lato
75
75
  # setup classes
76
76
  options[:class] ||= []
77
77
  options[:class].push(classes)
78
- options[:class].push('is-invalid') unless form.object.errors[key].blank?
78
+ options[:class].push('is-invalid') if form.object&.errors[key]&.any?
79
79
 
80
80
  # setup stimulus
81
81
  options[:data] ||= {}
@@ -4,7 +4,7 @@
4
4
  <%= hidden_field_tag :key, key %>
5
5
  <%= hidden_field_tag :sort_by, params[:sort_by] %>
6
6
 
7
- <% if false && browser.device.mobile? %>
7
+ <% if browser.device.mobile? %>
8
8
 
9
9
  <p>Work in progress</p>
10
10
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.10"
3
3
  end
@@ -3,6 +3,7 @@ require 'fileutils'
3
3
  namespace :lato do
4
4
  namespace :install do
5
5
  desc 'Install Lato engine and run tasks on main rails application'
6
+ # Usage: rails lato:install:application
6
7
  task :application do
7
8
  # Copy all "_content.html.erb" parials on layouts/lato from gem to main application
8
9
  ##
@@ -32,4 +33,26 @@ namespace :lato do
32
33
  FileUtils.copy(gem_concern_path, app_concern_path) unless File.exist? app_concern_path
33
34
  end
34
35
  end
36
+
37
+ namespace :bootstrap do
38
+ desc 'Generate SCSS variables for grays starting from a light color'
39
+ # Usage: rails lato:bootstrap:grays light=ffffff
40
+ task :grays do
41
+ light = ENV['light']
42
+ raise 'Light color not set' if light.blank?
43
+
44
+ rgb = light.match(/(..)(..)(..)$/).captures.map(&:hex)
45
+ r_range = rgb[0] / 9
46
+ g_range = rgb[1] / 9
47
+ b_range = rgb[2] / 9
48
+
49
+ puts rgb
50
+ (1..9).each do |level|
51
+ r_value = rgb[0] - r_range * (level - 1)
52
+ g_value = rgb[1] - g_range * (level - 1)
53
+ b_value = rgb[2] - b_range * (level - 1)
54
+ puts "$gray-#{level}00: rgb(#{r_value}, #{g_value}, #{b_value});"
55
+ end
56
+ end
57
+ end
35
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-28 00:00:00.000000000 Z
11
+ date: 2022-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails