bullet_train-themes-light 1.3.24 → 1.4.0

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: 5928cebefcf72bf371bd19fd488587dcd20cbe6ca21f5f207f3530ab96a142c2
4
- data.tar.gz: de69366834b591529df60bc6499c2c3b3fd730684d32df30cdc27748da649688
3
+ metadata.gz: 15b257a23112f0b0ffae2175c3408b95474565503274e7f149d8d2fc185ae713
4
+ data.tar.gz: c21e0b35953ba7153dd8cab5fd51663e87e60e092aecc364c5b4a81e2a318d78
5
5
  SHA512:
6
- metadata.gz: 4189c039fc15e7f694d4154330164c631217a17df44a6d07b31651119481677d9517bebeaaf1bbfd9aa661068fa53cd006b5e781297e8547803ce1dd7b3bfe11
7
- data.tar.gz: 1a07949f68f306ff7a992bbd4de05d619e2df95de63cf2bacbedc4dc8be0e7ea8feeff778b5d715acf8d84d8499f19f5211e84ef394a911be2edbdc0dde4143f
6
+ metadata.gz: 4ed863ab94c33f78b784cd3088d814f50fbd546602761f6da2597edfa8561d0fc6274b8c560c22a4674d728fe10ca7a8f0c81d2b70a7b65d485b8a7407e21324
7
+ data.tar.gz: c458c9610daaacadcdd7fc4ad847b9e53377a5c3415a4767b5b81af8a9c03fac098012d1514464b0bde984d244fd533a86849a3f8054988ab67d81a23cde0584
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module Light
4
- VERSION = "1.3.24"
4
+ VERSION = "1.4.0"
5
5
  end
6
6
  end
7
7
  end
@@ -69,10 +69,19 @@ module BulletTrain
69
69
  %x(sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/module #{constantized_theme}/module #{ejected_theme_name.titlecase}/g" #{target_path})
70
70
  %x(sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/TailwindCss/#{constantized_theme}/g" #{target_path})
71
71
  %x(sed -i #{'""' if `echo $OSTYPE`.include?("darwin")} "s/#{theme_name}/#{ejected_theme_name}/g" #{target_path})
72
- ["require", "TODO", "mattr_accessor"].each do |thing_to_remove|
73
- `grep -v #{thing_to_remove} #{target_path} > #{target_path}.tmp`
74
- `mv #{target_path}.tmp #{target_path}`
72
+
73
+ theme_file = Pathname.new(target_path)
74
+ msmn = Masamune::AbstractSyntaxTree.new(theme_file.readlines.join)
75
+ data_to_skip =
76
+ msmn.method_calls(name: "require") +
77
+ msmn.method_calls(name: "mattr_accessor") +
78
+ msmn.comments.select { |comment| comment[:token].match?("TODO") }
79
+ lines_to_skip = data_to_skip.map { |data| data[:line_number] - 1 }
80
+ new_lines = theme_file.readlines.select.with_index do |line, idx|
81
+ !lines_to_skip.include?(idx) || line.match?("mattr_accessor :colors")
75
82
  end
83
+ theme_file.write new_lines.join
84
+
76
85
  `standardrb --fix #{target_path}`
77
86
 
78
87
  puts "Cutting local project over from `#{theme_name}` to `#{ejected_theme_name}` in `app/helpers/application_helper.rb`."
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.3.24
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard