breakfast 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 85745d03b1181faa797c521daf152ac125061542
4
- data.tar.gz: f2366625165c66c770a05928eca64dc86cb24e0e
3
+ metadata.gz: a1921d73960db6220372261094df549425a17f87
4
+ data.tar.gz: e98eb67524ab7eef41caf5651b394191cc356e79
5
5
  SHA512:
6
- metadata.gz: 45c9038b1d2a10e4e956ff3a38341ac5d19a0ad4829e998920055544cc8b6730935dc8ff9da9e967ff6ea432af6da831a0eadf7e219f12d89fa0dce56d7052ed
7
- data.tar.gz: 394312cf9ca5d820042c411b8adc868bc9a02235b4903f7c4ac774c2fbb45396dae74fcf6d1a4f48b4025ba24f6d8eb3e6df89ed9da26c1b8c14a8aff4365dbe
6
+ metadata.gz: a4f46f6998d520f4cfa0dedb651e98900dc24a6e0975c58c5f2375d04a2d86068769366a809d42c0d1a6ef4ad088b01eb1b74bbf65b5c1f446ec368721dc3510
7
+ data.tar.gz: 49da1174fb90a1f7303a1fee22156874b99f3ee6eeba8b92e4aa23bc72e47c449fb3ac8235dfe915be2c67b6a87636a2eddbeeedf534b888f4cce18b1b2b9418
@@ -0,0 +1,8 @@
1
+ require 'capistrano/version'
2
+
3
+ if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0')
4
+ load File.expand_path("../capistrano/tasks/breakfast.rake", __FILE__)
5
+ else
6
+ raise "Requires Capistrano V3"
7
+ end
8
+
@@ -0,0 +1,20 @@
1
+ namespace :breakfast do
2
+ desc "Compile assets for production use"
3
+ task :compile do
4
+ on roles fetch(:breakfast_roles) do |host|
5
+ within release_path do
6
+ execute :npm, "install"
7
+ execute "node_modules/brunch/bin/brunch", "build --production"
8
+ end
9
+ end
10
+ end
11
+
12
+ after "deploy:updated", "breakfast:compile"
13
+ end
14
+
15
+
16
+ namespace :load do
17
+ task :defaults do
18
+ set :breakfast_roles, -> { :web }
19
+ end
20
+ end
@@ -6,7 +6,6 @@ module BrunchRails
6
6
  config.breakfast = ActiveSupport::OrderedOptions.new
7
7
 
8
8
  config.before_configuration do |app|
9
- config.breakfast.live_reload = true
10
9
  config.breakfast.html_reload_strategy = :turbolinks
11
10
  config.breakfast.js_reload_strategy = :page
12
11
  config.breakfast.css_reload_strategy = :hot
@@ -17,16 +16,15 @@ module BrunchRails
17
16
  end
18
17
 
19
18
  initializer "breakfast.setup_view_helpers" do |app|
20
- if config.breakfast.environments.include?(Rails.env)
21
- ActiveSupport.on_load(:action_view) do
22
- include ::Breakfast::ViewHelper
23
- end
19
+ ActiveSupport.on_load(:action_view) do
20
+ include ::Breakfast::ViewHelper
24
21
  end
25
22
  end
26
23
 
27
24
  config.after_initialize do |app|
28
25
  if config.breakfast.environments.include?(Rails.env) && defined?(Rails::Server)
29
- Process.spawn("brunch watch")
26
+ @brunch_pid = Process.spawn("brunch watch")
27
+ Process.detach(@brunch_pid)
30
28
 
31
29
  listen_to_paths = Array.wrap(config.breakfast.asset_output_folders) +
32
30
  Array.wrap(config.breakfast.view_folders)
@@ -45,5 +43,9 @@ module BrunchRails
45
43
  listener.start
46
44
  end
47
45
  end
46
+
47
+ ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES[:javascript] = "/assets"
48
+ ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES[:image] = "/assets"
49
+ ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES[:stylesheet] = "/assets"
48
50
  end
49
51
  end
@@ -1,3 +1,3 @@
1
1
  module Breakfast
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -4,8 +4,6 @@ module Breakfast
4
4
  if Rails.configuration.breakfast.environments.include?(Rails.env)
5
5
  content_tag :script do
6
6
  <<-SCRIPT.html_safe
7
- window.Breakfast = window.Breakfast || {};
8
- window.Breakfast.liveReload = #{Rails.configuration.breakfast.live_reload};
9
7
  require("breakfast-rails").init({
10
8
  host: "#{request.host}",
11
9
  port: #{request.port},
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "breakfast-rails",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Assets for the Breakfast Gem",
5
5
  "main": "./lib/breakfast-rails.js",
6
6
  "scripts": {
@@ -69,18 +69,17 @@ class LiveReloader {
69
69
 
70
70
  document.addEventListener('DOMContentLoaded', () => {
71
71
  let Breakfast = window.Breakfast || {};
72
+ Breakfast.options = options
72
73
 
73
- if(Breakfast.liveReload) {
74
- let reloadChannel = 'Breakfast::LiveReloadChannel'
74
+ let reloadChannel = 'Breakfast::LiveReloadChannel'
75
75
 
76
- Breakfast.cable = ActionCable.createConsumer(`ws://${options.host}:${options.port}/cable`);
77
- Breakfast.channel = Breakfast.cable.subscriptions.create(reloadChannel, {
78
- received: (data) => {
79
- let reloader = reloaders[data.extension];
80
- reloader(options.reloadStrategies[data.extension]);
81
- }
82
- })
83
- }
76
+ Breakfast.cable = ActionCable.createConsumer(`ws://${options.host}:${options.port}/cable`);
77
+ Breakfast.channel = Breakfast.cable.subscriptions.create(reloadChannel, {
78
+ received: (data) => {
79
+ let reloader = reloaders[data.extension];
80
+ reloader(options.reloadStrategies[data.extension]);
81
+ }
82
+ })
84
83
  });
85
84
  }
86
85
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breakfast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Koperwas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-19 00:00:00.000000000 Z
11
+ date: 2016-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,6 +113,8 @@ files:
113
113
  - bin/setup
114
114
  - breakfast.gemspec
115
115
  - lib/breakfast.rb
116
+ - lib/breakfast/capistrano.rb
117
+ - lib/breakfast/capistrano/tasks/breakfast.rake
116
118
  - lib/breakfast/live_reload_channel.rb
117
119
  - lib/breakfast/railtie.rb
118
120
  - lib/breakfast/version.rb