bullet_train-themes-light 1.3.25 → 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: 2b9e569259f074a5ca53363647d567548e9a31d7c9d8b0b964478ae148c83e93
4
- data.tar.gz: aa6f4203e628447612531324453ac6caaa1f20fec0464e6183f35f06c9214906
3
+ metadata.gz: 15b257a23112f0b0ffae2175c3408b95474565503274e7f149d8d2fc185ae713
4
+ data.tar.gz: c21e0b35953ba7153dd8cab5fd51663e87e60e092aecc364c5b4a81e2a318d78
5
5
  SHA512:
6
- metadata.gz: ee9e323aa4997bc9c7eb0206d554db8ade837e380c5681abe2c30abbbd10f17f016805e2d14eb278f7d40dda86ba513e4189c36fae836335a7aae1e9a0a209d2
7
- data.tar.gz: c0a34771fb0aa43b957b7c24bfc0fa380bcb341603a807c757ffc6b962f8f1ea38118558d94239e2c8f8e5855d16021d5ccae3bc0746bc3aaf0e99ee2b748ec1
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.25"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes-light
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.25
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver