spark_engine 1.2.18 → 1.2.19

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: 3bcdd68d659861632e0ad5bdc1304a3055309beed6b7e89c981d8397486b1e6a
4
- data.tar.gz: 21eb68e86e796ec06f42bbcacbbfac7c938af319bfa1f6fca19511cf0cc041e1
3
+ metadata.gz: 323fb412e81a3526b9d6646c352235543a85acdce829c638c06d6bd4d017d719
4
+ data.tar.gz: 2c4f064405af223ee1d2f3fe52bb2f86368910c609bbe426a06f40c0f01d176e
5
5
  SHA512:
6
- metadata.gz: c59d0ae4f5d37fbc66e98c54943eb04885e94374b079ce63c04e40b23baa01af4bbfd87e3febd9764d247ae7912bc4feae2bda934a579b896e2e803e025680c2
7
- data.tar.gz: 1b07bfbeb40f729b8f53b907933b9b2a391c75960c769410d9f41b8cf0e9b64e40518ffb577ff23264d2759bedd6ee4bfc1eb0182184c6be34ff5d5d00b8dd31
6
+ metadata.gz: 6d7df9de1a02684959e0037d154db05dcf7f721be566e020f99eae5b42ea41d3f96b4cad6b0563063548b8a6e68d184581df17932ef9174e13d7dff99d86c598
7
+ data.tar.gz: 2dc9b910c8e6c68fa068fa7f5a1215e3106d86a337c072b78823343d76a91c66f1371da7f74d023883619caa48457cb2d884c91f12b248b62e6a75a53306ca53
@@ -1,7 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
- require_relative "site/config/application"
3
- Rails.application.load_tasks
4
2
 
5
- Rake::Task["assets:precompile"].enhance do
6
- SparkEngine.plugin.build
3
+ task "assets:precompile" do
4
+ Dir.chdir("site") do
5
+ system "rake assets:precompile"
6
+ end
7
7
  end
@@ -0,0 +1,6 @@
1
+ require_relative "config/application"
2
+ Rails.application.load_tasks
3
+
4
+ Rake::Task["assets:precompile"].enhance do
5
+ SparkEngine.plugin.build
6
+ end
@@ -85,7 +85,7 @@ module SparkEngine
85
85
 
86
86
  remove.each { |f| FileUtils.rm_rf File.join(@gem, 'site', f), secure: true }
87
87
  end
88
-
88
+
89
89
 
90
90
  engine_copy
91
91
  end
@@ -125,8 +125,8 @@ module SparkEngine
125
125
  ext = File.extname(template)
126
126
 
127
127
  # Replace keywords with correct names (excluding file extensions)
128
- target_path = template.sub(/#{ext}$/, '').gsub(/(gem|engine|namespace)/, {
129
- 'gem' => @gem,
128
+ target_path = template.sub(/#{ext}$/, '').gsub(/(gem|engine|namespace)/, {
129
+ 'gem' => @gem,
130
130
  'engine' => @engine,
131
131
  'namespace' => @namespace
132
132
  }) + ext
@@ -145,7 +145,7 @@ module SparkEngine
145
145
  def write_file(path, content='', options={})
146
146
  options[:mode] ||= 'w'
147
147
 
148
- if File.exist?(path)
148
+ if File.exist?(path)
149
149
  if options[:force]
150
150
  type = 'update'
151
151
  else
@@ -169,7 +169,7 @@ module SparkEngine
169
169
  def post_install
170
170
  require 'pathname'
171
171
 
172
- target = Pathname.new File.join(@cwd, @gem)
172
+ target = Pathname.new File.join(@cwd, @gem)
173
173
  dir = target.relative_path_from Pathname.new(Dir.pwd)
174
174
  victory = "#{@plugin_module} Design System created at #{dir}. Huzzah!"
175
175
  dashes = ''
@@ -197,11 +197,20 @@ module SparkEngine
197
197
  component: path+'_component.rb',
198
198
  template: File.join(path, "_#{name}.html.erb"),
199
199
  css: File.join(SparkEngine.plugin.paths[:stylesheets], "components", "#{options[:component].sub(name, '_'+name)}.scss"),
200
- js: File.join(SparkEngine.plugin.paths[:javascripts], "components", "#{options[:component].sub(name, '_'+name)}.js")
200
+ js: File.join(SparkEngine.plugin.paths[:javascripts], "components", "#{options[:component].sub(name, '_'+name)}.js"),
201
+ docs: File.join(SparkEngine.plugin.root, "site/app/views/docs/components", "#{options[:component]}.html")
201
202
  }
202
203
 
204
+ if defined?(Slim)
205
+ paths[:docs] << ".slim"
206
+ elsif defined?(Haml)
207
+ paths[:docs] << ".haml"
208
+ else
209
+ paths[:docs] << ".erb"
210
+ end
211
+
203
212
  if options[:delete]
204
- return paths.values.each do |p|
213
+ return paths.values.each do |p|
205
214
  action_log('delete', FileUtils.rm_rf(p).first) if File.exist?(p)
206
215
  end
207
216
  end
@@ -211,12 +220,13 @@ module SparkEngine
211
220
  options[:class] << "Component" unless options[:class].end_with? "Component"
212
221
 
213
222
  # Write component class
214
- component_content = %Q{class #{modulize(options[:component])}Component < #{options[:class] }\nend}
223
+ component_content = %Q{class #{modulize(options[:component])}Component < #{options[:class] }\nend}
215
224
  write_file(paths[:component], component_content, options)
225
+ write_file(paths[:docs], '', options)
216
226
 
217
227
  write_file(paths[:template], '', options) if options[:template]
218
228
  write_file(paths[:css], '', options) if options[:css]
219
- write_file(paths[:js], '', options) if options[:js]
229
+ write_file(paths[:js], '', options) if options[:js]
220
230
  end
221
231
 
222
232
 
@@ -233,9 +243,9 @@ module SparkEngine
233
243
  end
234
244
 
235
245
  def modulize(input)
236
- classify = lambda { |name|
246
+ classify = lambda { |name|
237
247
  name = (name =~ /_/) ? name.split('_').map(&classify).join : name
238
- (name =~ /[A-Z]/) ? name : name.capitalize
248
+ (name =~ /[A-Z]/) ? name : name.capitalize
239
249
  }
240
250
  input.split('/').map(&classify).join('::')
241
251
  end
@@ -1,3 +1,3 @@
1
1
  module SparkEngine
2
- VERSION = "1.2.18"
2
+ VERSION = "1.2.19"
3
3
  end
data/spark_engine.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ['brandon@imathis.com']
10
10
 
11
11
  spec.summary = %q{A design system framework for Rails (and humans).}
12
- spec.homepage = 'https://github.com/imathis/spark'
12
+ spec.homepage = 'https://github.com/spark-engine/engine'
13
13
  spec.license = 'MIT'
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.18
4
+ version: 1.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2019-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: esvg
@@ -182,6 +182,7 @@ files:
182
182
  - lib/spark_engine/scaffold/gem/config/autoprefixer.yml
183
183
  - lib/spark_engine/scaffold/gem/gem.gemspec
184
184
  - lib/spark_engine/scaffold/gem/lib/gem.rb
185
+ - lib/spark_engine/scaffold/gem/site/Rakefile
185
186
  - lib/spark_engine/scaffold/gem/site/app/assets/javascripts/application.js
186
187
  - lib/spark_engine/scaffold/gem/site/app/assets/stylesheets/application.scss
187
188
  - lib/spark_engine/scaffold/gem/site/app/controllers/docs_controller.rb
@@ -193,7 +194,7 @@ files:
193
194
  - lib/spark_engine/scaffold/gem/site/config/routes.rb
194
195
  - lib/spark_engine/version.rb
195
196
  - spark_engine.gemspec
196
- homepage: https://github.com/imathis/spark
197
+ homepage: https://github.com/spark-engine/engine
197
198
  licenses:
198
199
  - MIT
199
200
  metadata: {}