charsi 0.1.0 → 0.1.1

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: f1f4d275d1e0160a13c59583ba73d13718c6010935543c5dd9281b97071b4a4b
4
- data.tar.gz: 4f85f65b66740a9f6bfe9c1f3204ed8f50a3fe8509facd150698c3c1dd65beb6
3
+ metadata.gz: 13f9c33cc143b1ba678512bc2a2a2d18eaec7dc0cf415b56de4aed7ccbc0de91
4
+ data.tar.gz: cda881471b17de5bdadde2380bc3597cc2c58fae1eb7aaa70c89b2a5d763b2bd
5
5
  SHA512:
6
- metadata.gz: ca51e1d73a4d3aed16d2ea3c72ab1638c38c035b68c3bc93ead2e1b85fe84b36dca66d2ed05d0dc4c6c111349fa79a05478d3debaf2fba0a73efd58d0715f4fb
7
- data.tar.gz: f278453dca7038b2b10a3ea3c4750243c9138864b28ca3833b3aab55e263ddab7092da003f1939fca3d7c078c1fc5db311da3bbf42821c51e7797b27c016eea5
6
+ metadata.gz: 755013228a16d5982abf82c05c4536818fd5d9b52ffa69d5213d0da1619393b8f22d52007a3e2ad6e15fdf68b671548fcfd2c83580c5853f05b92d9d5c013650
7
+ data.tar.gz: 5ba4457348c9d05d987a17721e6fadec39c47896778bdc649d9f126cbcfa0600729d43954c02faa9654b893c62156d22367b2d7615b60139075ae94857bbb5a0
data/charsi.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'charsi'
3
- spec.version = '0.1.0'
3
+ spec.version = '0.1.1'
4
4
 
5
5
  spec.authors = ['Ryan Beasse']
6
6
  spec.email = ['me@ryanbeasse.com']
data/lib/charsi/app.rb CHANGED
@@ -8,6 +8,9 @@ module Charsi
8
8
 
9
9
  def initialize
10
10
  @cache_slug = Time.now.to_i
11
+ @config = Configuration.new
12
+
13
+ load_helpers
11
14
  end
12
15
 
13
16
  protected
@@ -19,5 +22,15 @@ module Charsi
19
22
  def javascript_tag(asset)
20
23
  "<script src='assets/javascript/#{asset}?#{@cache_slug}'></script>"
21
24
  end
25
+
26
+ private
27
+
28
+ def load_helpers
29
+ helpers_path = @config.path(:helpers_dir)
30
+
31
+ Dir.glob(File.join(helpers_path, '**', '*.rb')).each do |helper_file|
32
+ require_relative helper_file
33
+ end
34
+ end
22
35
  end
23
36
  end
@@ -2,7 +2,7 @@ module Charsi
2
2
  # Builds the application and handles file watching for changes.
3
3
  class Builder
4
4
  def initialize
5
- @app = defined?(::App) ? ::App.new : Charsi::App.new
5
+ @app = Charsi::App.new
6
6
  @config = Configuration.new
7
7
  end
8
8
 
@@ -13,6 +13,7 @@ module Charsi
13
13
  File.join(Dir.pwd, config_path, *keys)
14
14
  end
15
15
 
16
+
16
17
  private
17
18
 
18
19
  def app_config
@@ -2,4 +2,5 @@ paths:
2
2
  output_dir: '_build'
3
3
  layout_dir: 'layouts'
4
4
  assets_dir: 'assets'
5
- views_dir: 'views'
5
+ views_dir: 'views'
6
+ helpers_dir: 'helpers'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Beasse