faw_toast 1.2.0 → 1.2.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: b381797da514941ee2394cd7bcc634016d1af89942057800a7aab6c7a0c02435
4
- data.tar.gz: 8d6e392357aea77ba878035fd476efc8f2d0f0db944abeccecc13e7dd2e738a4
3
+ metadata.gz: b51a2a9ed8f15f940950a4edfaabb8268ae8f422966a085ef8d49f6780d19d5e
4
+ data.tar.gz: 44371edb70e43029d9e1004bd4f3c269a7048f5178a81e17f598d8269346bf24
5
5
  SHA512:
6
- metadata.gz: 2ad38aa056e63c5c9cc82f13f8958c68cc3afe233793589d324f833124427fb21843ee486d987c72ce9675fc0661c3342b8600123ab3d49d90942b253bc3c9a3
7
- data.tar.gz: 340e8bd832e3b8280c2137be0be7def84f918e825e4476e9e3ed4e854a4d735e8c7b62e4e37835ab257fee1c4de388cd2f1c9de030c6474e4a3fd995d05af31c
6
+ metadata.gz: e28dd393e86c36a71baeefbb41ed25753acd5f79886b08480bae06798cc3c0f994aa94cd462ff1305948b4b4cf6afa619f92d4e9e4e6dc78ce18de098d35f6c7
7
+ data.tar.gz: a6446d7cfeaf3f4027e9914df062570d95db2ff36f1fd1d32c52ed1ade48a9020ec6923b60d3b56068f415c117a66e4f3f2cb8e028547ce352bbf5c3670f0743
data/README.md CHANGED
@@ -66,6 +66,11 @@ def create
66
66
  flash[:success] = "Item was successfully created!"
67
67
  redirect_to items_path
68
68
  end
69
+
70
+ # using Turbo Streams
71
+ flash.now[flash_type] = message
72
+ render turbo_stream: turbo_stream.append("faw-toast-container", partial: "faw_toast/toast"), status: status
73
+
69
74
  ```
70
75
 
71
76
  ```ruby
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FawToast
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
@@ -20,6 +20,18 @@ module FawToast
20
20
  end
21
21
  end
22
22
 
23
+ def add_stylesheet_tag
24
+ inject_into_file "app/views/layouts/application.html.erb", after: "<%= stylesheet_link_tag \"application\", \"data-turbo-track\": \"reload\" %>" do
25
+ "\n <%= stylesheet_link_tag \"faw_toast\", \"data-turbo-track\": \"reload\" %>"
26
+ end
27
+ end
28
+
29
+ def add_javascript_tag
30
+ inject_into_file "app/views/layouts/application.html.erb", before: "</head>" do
31
+ " <%= javascript_include_tag \"faw_toast\", \"data-turbo-track\": \"reload\" %>\n"
32
+ end
33
+ end
34
+
23
35
  def add_toast_container_to_layout
24
36
  inject_into_file "app/views/layouts/application.html.erb", before: "</body>" do
25
37
  <<-HTML
@@ -27,16 +39,6 @@ module FawToast
27
39
  HTML
28
40
  end
29
41
  end
30
-
31
- def add_stylesheet_import
32
- if File.exist?("app/assets/stylesheets/application.scss")
33
- append_to_file "app/assets/stylesheets/application.scss" do
34
- "\n@import \"faw_toast\";\n"
35
- end
36
- else
37
- say "Please manually import the FawToast stylesheet in your application", :red
38
- end
39
- end
40
42
  end
41
43
  end
42
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faw_toast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexwebgr
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '9.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: sassc
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.4'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.4'
33
47
  description: FawToast provides an easy way to display flash messages as toast notifications
34
48
  in Rails applications
35
49
  email: