bullet_train-themes-light 1.0.19 → 1.0.20

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: cf9815b8be1121970e9cdef38ce613a3cd3e59fc49135fed1d4f298ed62dae37
4
- data.tar.gz: 45078a516aeb4d3b2179a63658054ea4a1e6ee5e955aca01e1c707fd5c923a19
3
+ metadata.gz: 9b618c385969968cf23c4ca197ac329342a79a5d69c7cf54cb94770769d725bb
4
+ data.tar.gz: 10441e8958f53ca3b9c19295b3719519ff9d50fc56739be6523ae57275a6d1a1
5
5
  SHA512:
6
- metadata.gz: 5ba638cb69f69bfd1a3673c7d854447e7b0610392a08d941569f9fe6d0512683a5cfd6d21a5ef7d3fcd2a8a96cbe4baae3b6d66389f2ade7057cdf011f85bd47
7
- data.tar.gz: 34f1de87a9ba75309695cd1391073c111fa06c2a3eaaa2edec56038f666ce73f1cfc39ac017f579bf1a43ba8c3d7fee3ee915364d60a72e86c3dc9f9716f9bd9
6
+ metadata.gz: 6dd348d36fbfd662905c1a4021543bd106551cc9f28ea46cd1943e3bb1695347e101536fc537f54b4b4fed6925cedd50d3ddce05ace70e919dd209a45923613b
7
+ data.tar.gz: 8250d93ba50bafdc0960783c9414e8ad015ff5e3b93c4e6ad10f7b14b1facaf96d131ae92db8b621ef9abcb76c0b44b311ab6c1ea3cd4cf8ca0571a479b4d9e1
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.0.19"
4
+ VERSION = "1.0.20"
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,52 @@
1
- # desc "Explaining what the task does"
2
- # task :bullet_train_themes_light do
3
- # # Task goes here
4
- # end
1
+ namespace :bullet_train do
2
+ namespace :themes do
3
+ namespace :light do
4
+ desc "Fork the \"Light\" theme into your local repository."
5
+ task :eject, [:destination] => :environment do |task, args|
6
+ theme_base_path = `bundle show --paths bullet_train-themes-light`.chomp
7
+ puts "Ejecting from Light theme in `#{theme_base_path}`."
8
+
9
+ puts "Ejecting Tailwind configuration into `./tailwind.#{args[:destination]}.config.js`."
10
+ `cp #{theme_base_path}/tailwind.light.config.js #{Rails.root}/tailwind.#{args[:destination]}.config.js`
11
+
12
+ puts "Ejecting stylesheets into `./app/assets/stylesheets/#{args[:destination]}`."
13
+ `mkdir #{Rails.root}/app/assets/stylesheets`
14
+ `cp -R #{theme_base_path}/app/assets/stylesheets/light #{Rails.root}/app/assets/stylesheets/#{args[:destination]}`
15
+ `cp -R #{theme_base_path}/app/assets/stylesheets/light.tailwind.css #{Rails.root}/app/assets/stylesheets/#{args[:destination]}.tailwind.css`
16
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/light/#{args[:destination]}/g" #{Rails.root}/app/assets/stylesheets/#{args[:destination]}.tailwind.css`
17
+
18
+ puts "Ejecting JavaScript into `./app/javascript/application.#{args[:destination]}.js`."
19
+ `cp #{theme_base_path}/app/javascript/application.light.js #{Rails.root}/app/javascript/application.#{args[:destination]}.js`
20
+
21
+ puts "Ejecting all theme partials into `./app/views/themes/#{args[:destination]}`."
22
+ `mkdir #{Rails.root}/app/views/themes`
23
+ `cp -R #{theme_base_path}/app/views/themes/light #{Rails.root}/app/views/themes/#{args[:destination]}`
24
+
25
+ puts "Cutting local `Procfile.dev` over from `light` to `#{args[:destination]}`."
26
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/light/#{args[:destination]}/g" #{Rails.root}/Procfile.dev`
27
+
28
+ puts "Cutting local `package.json` over from `light` to `#{args[:destination]}`."
29
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/light/#{args[:destination]}/g" #{Rails.root}/package.json`
30
+
31
+ # Stub out the class that represents this theme and establishes its inheritance structure.
32
+ target_path = "#{Rails.root}/app/lib/bullet_train/themes/#{args[:destination]}.rb"
33
+ puts "Stubbing out a class that represents this theme in `./#{target_path}`."
34
+ `mkdir -p #{Rails.root}/app/lib/bullet_train/themes`
35
+ `cp #{theme_base_path}/lib/bullet_train/themes/light.rb #{target_path}`
36
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/module Light/module #{args[:destination].titlecase}/g" #{target_path}`
37
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/TailwindCss/Light/g" #{target_path}`
38
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/light/#{args[:destination]}/g" #{target_path}`
39
+ ["require", "TODO", "mattr_accessor"].each do |thing_to_remove|
40
+ `grep -v #{thing_to_remove} #{target_path} > #{target_path}.tmp`
41
+ `mv #{target_path}.tmp #{target_path}`
42
+ end
43
+ `standardrb --fix #{target_path}`
44
+
45
+ puts "Cutting local project over from `light` to `#{args[:destination]}` in `app/helpers/application_helper.rb`."
46
+ `sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/:light/:#{args[:destination]}/g" #{Rails.root}/app/helpers/application_helper.rb`
47
+
48
+ puts "You must restart `bin/dev` at this point, because of the changes to `Procfile.dev` and `package.json`."
49
+ end
50
+ end
51
+ end
52
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes-light
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-26 00:00:00.000000000 Z
11
+ date: 2022-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails