picocss-gem 0.2.1 → 0.2.2
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 +4 -4
- data/lib/generators/bridgetown/install_theme_generator.rb +13 -5
- data/lib/generators/bridgetown/template_login_generator.rb +3 -3
- data/lib/generators/rails/install_generator.rb +11 -2
- data/lib/generators/rails/install_theme_generator.rb +37 -19
- data/lib/generators/rails/template_login_generator.rb +18 -4
- data/lib/picocss/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dda0b7c4ff7a811d4f5dad392a493780f42181289dd7b234993af410e03a7936
|
|
4
|
+
data.tar.gz: e21d75b68d5588f28f2afc2900899b881069de3bff154c9e305b8f029940e090
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 482bfc643e251360c2caaeb90f568b2b54a338f74a847105631fb97f28fe5af0a0f43fd333b854baff09cdf63e2df00621d6922ccf46a4591d107ad4d450b360
|
|
7
|
+
data.tar.gz: 4b67844061b8b25b58845e302ef26f180a5cc0e27562b9628e5ee1bc9ced9969ed01d6da6bc379c885919dc2919bb0e57a6ecefe9cd305f6c350dbb38da1583d
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "fileutils"
|
|
2
4
|
|
|
3
5
|
module Picocss
|
|
@@ -7,21 +9,27 @@ module Picocss
|
|
|
7
9
|
red pink fuchsia purple violet indigo blue
|
|
8
10
|
cyan jade green lime yellow amber pumpkin
|
|
9
11
|
orange sand grey zinc slate min
|
|
10
|
-
]
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
TEMPLATES_DIR = File.expand_path("../templates", __dir__)
|
|
11
15
|
|
|
12
16
|
def self.generate(theme = "min")
|
|
13
17
|
theme = "min" unless THEMES.include?(theme)
|
|
14
|
-
puts "📦 Instalando tema PicoCSS '#{theme}' no projeto Bridgetown..."
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
css_file =
|
|
20
|
+
if theme == "min"
|
|
21
|
+
File.join(TEMPLATES_DIR, "pico.min.css")
|
|
22
|
+
else
|
|
23
|
+
File.join(TEMPLATES_DIR, "pico.#{theme}.min.css")
|
|
24
|
+
end
|
|
18
25
|
|
|
19
26
|
dest_dir = "src/assets/stylesheets"
|
|
20
27
|
FileUtils.mkdir_p(dest_dir)
|
|
21
28
|
FileUtils.cp(css_file, File.join(dest_dir, "pico.css"))
|
|
22
29
|
|
|
23
|
-
puts "
|
|
30
|
+
puts "Tema '#{theme}' copiado para #{dest_dir}/pico.css"
|
|
24
31
|
puts "Adicione no layout: <link rel='stylesheet' href='/assets/css/pico.css' />"
|
|
32
|
+
puts ""
|
|
25
33
|
end
|
|
26
34
|
end
|
|
27
35
|
end
|
|
@@ -3,10 +3,10 @@ require "fileutils"
|
|
|
3
3
|
module Picocss
|
|
4
4
|
module Generators
|
|
5
5
|
class TemplateLoginGenerator
|
|
6
|
-
|
|
7
|
-
gem_path = Gem.loaded_specs["picocss-gem"].full_gem_path
|
|
8
|
-
template_file = File.join(gem_path, "lib", "generators", "picocss", "templates", "login.html.erb")
|
|
6
|
+
TEMPLATES_DIR ||= File.expand_path("../templates", __dir__)
|
|
9
7
|
|
|
8
|
+
def self.generate
|
|
9
|
+
template_file = File.join(TEMPLATES_DIR, "login.html.erb")
|
|
10
10
|
dest_dir = "src/_includes"
|
|
11
11
|
FileUtils.mkdir_p(dest_dir)
|
|
12
12
|
FileUtils.cp(template_file, File.join(dest_dir, "login.html"))
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
1
4
|
require "rails/generators"
|
|
2
5
|
|
|
3
6
|
module Picocss
|
|
4
7
|
module Generators
|
|
5
8
|
class InstallGenerator < Rails::Generators::Base
|
|
6
|
-
|
|
9
|
+
TEMPLATES_DIR = File.expand_path("../templates", __dir__)
|
|
10
|
+
source_root TEMPLATES_DIR
|
|
7
11
|
|
|
8
12
|
def copy_stylesheet
|
|
9
|
-
|
|
13
|
+
dest_dir = "app/assets/stylesheets"
|
|
14
|
+
FileUtils.mkdir_p(dest_dir)
|
|
15
|
+
FileUtils.cp(File.join(TEMPLATES_DIR, "pico.min.css"), File.join(dest_dir, "pico.css"))
|
|
16
|
+
|
|
17
|
+
say "✅ Tema padrão 'min' copiado para #{dest_dir}/pico.css", :green
|
|
18
|
+
say "Adicione no layout: <%= stylesheet_link_tag 'pico.css' %>", :yellow
|
|
10
19
|
end
|
|
11
20
|
end
|
|
12
21
|
end
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
require "rails/generators"
|
|
5
|
+
|
|
1
6
|
module Picocss
|
|
2
7
|
module Generators
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
module Rails
|
|
9
|
+
class InstallThemeGenerator < ::Rails::Generators::Base
|
|
10
|
+
argument :theme, type: :string, default: "min", banner: "Theme name"
|
|
11
|
+
class_option :destination_root, type: :string, default: "app/assets/stylesheets"
|
|
12
|
+
|
|
13
|
+
THEMES = %w[
|
|
14
|
+
red pink fuchsia purple violet indigo blue
|
|
15
|
+
cyan jade green lime yellow amber pumpkin
|
|
16
|
+
orange sand grey zinc slate min
|
|
17
|
+
].freeze
|
|
18
|
+
|
|
19
|
+
TEMPLATES_DIR = File.expand_path("../templates", __dir__)
|
|
20
|
+
source_root TEMPLATES_DIR
|
|
21
|
+
|
|
22
|
+
def copy_theme_file
|
|
23
|
+
theme_to_use = THEMES.include?(theme) ? theme : "min"
|
|
24
|
+
|
|
25
|
+
css_file =
|
|
26
|
+
if theme_to_use == "min"
|
|
27
|
+
File.join(TEMPLATES_DIR, "pico.min.css")
|
|
28
|
+
else
|
|
29
|
+
File.join(TEMPLATES_DIR, "pico.#{theme_to_use}.min.css")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
dest_dir = options[:destination_root]
|
|
33
|
+
FileUtils.mkdir_p(dest_dir)
|
|
34
|
+
FileUtils.cp(css_file, File.join(dest_dir, "pico.css"))
|
|
35
|
+
|
|
36
|
+
puts "Tema '#{theme_to_use}' copiado para #{dest_dir}/pico.css"
|
|
37
|
+
puts "Adicione no layout: <%= stylesheet_link_tag 'pico.css' %>"
|
|
38
|
+
puts ""
|
|
21
39
|
end
|
|
22
|
-
end
|
|
40
|
+
end
|
|
23
41
|
end
|
|
24
42
|
end
|
|
25
43
|
end
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
source_root File.expand_path("templates", __dir__)
|
|
1
|
+
# frozen_string_literal: true
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
require "fileutils"
|
|
4
|
+
require "rails/generators"
|
|
5
|
+
|
|
6
|
+
module Picocss
|
|
7
|
+
module Generators
|
|
8
|
+
class TemplateLoginGenerator < Rails::Generators::Base
|
|
9
|
+
TEMPLATES_DIR = File.expand_path("../templates", __dir__)
|
|
10
|
+
source_root TEMPLATES_DIR
|
|
11
|
+
|
|
12
|
+
def copy_login_template
|
|
13
|
+
dest_dir = "app/views/sessions"
|
|
14
|
+
FileUtils.mkdir_p(dest_dir)
|
|
15
|
+
FileUtils.cp(File.join(TEMPLATES_DIR, "login.html.erb"), File.join(dest_dir, "new.html.erb"))
|
|
16
|
+
|
|
17
|
+
say "✅ Template de login copiado para #{dest_dir}/new.html.erb", :green
|
|
18
|
+
end
|
|
19
|
+
end
|
|
6
20
|
end
|
|
7
21
|
end
|
data/lib/picocss/version.rb
CHANGED