stimulus_reflex 2.1.4 → 2.1.5

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: 1e7f7d9dd1475b7a56d9920dc815ff1ac0609add399996e8b5992365955abdeb
4
- data.tar.gz: d32fa60ca923753176253f36c48507a85d9d7f859f9ffce13c56838cb60c1f15
3
+ metadata.gz: aea6766813264c7afd1b358207fadc8b43120e3194f47f246e50a68a2c8cc00a
4
+ data.tar.gz: 370e3640640c9f5cf6a083de90821a90749450c105d5a373b2737ae467037482
5
5
  SHA512:
6
- metadata.gz: f9498339be7be1297189373f155a6a92871e8c05e096b3027eff1a644e48ad693bd564d42d424724780fd93952fe867ef822c91d352f19bf0e5bf397a32611b4
7
- data.tar.gz: b9d49433b932ac09c2f6947ce243d5876861f35fb6caa8c9c25d8530e69d96f8b8a648f790d6cab5aed34962bd104a66a268faa5a0a8df935d1164fdecb712c1
6
+ metadata.gz: 785fe23622715978bd3ac716c6625fce2c2ddd5bbc8a97be25ec54a4559dea9fedcefe364519615925123e3e8e3dbe32b1e8614598459cacc649c36cb30ce89f
7
+ data.tar.gz: c4b4e67fb6e227b556c11b5809580777b76aff0dcc87ed987efb349dee8ad163173387c0dd59848d98e8716940d8153d5b174aeef5daac1292fe180ab63558a6
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stimulus_reflex (2.1.4)
5
- cable_ready (>= 4.0.7)
4
+ stimulus_reflex (2.1.5)
5
+ cable_ready (>= 4.0)
6
6
  nokogiri
7
7
  rack
8
8
  rails (>= 5.2)
@@ -67,7 +67,7 @@ GEM
67
67
  zeitwerk (~> 2.1, >= 2.1.8)
68
68
  ast (2.4.0)
69
69
  builder (3.2.3)
70
- cable_ready (4.0.7)
70
+ cable_ready (4.0.8)
71
71
  rails (>= 5.2)
72
72
  coderay (1.1.2)
73
73
  concurrent-ruby (1.1.5)
@@ -77,8 +77,8 @@ GEM
77
77
  activesupport (>= 4.2.0)
78
78
  i18n (1.7.0)
79
79
  concurrent-ruby (~> 1.0)
80
- jaro_winkler (1.5.3)
81
- loofah (2.3.0)
80
+ jaro_winkler (1.5.4)
81
+ loofah (2.3.1)
82
82
  crass (~> 1.0.2)
83
83
  nokogiri (>= 1.5.9)
84
84
  mail (2.7.1)
@@ -89,9 +89,9 @@ GEM
89
89
  mimemagic (0.3.3)
90
90
  mini_mime (1.0.2)
91
91
  mini_portile2 (2.4.0)
92
- minitest (5.12.2)
92
+ minitest (5.13.0)
93
93
  nio4r (2.5.2)
94
- nokogiri (1.10.4)
94
+ nokogiri (1.10.5)
95
95
  mini_portile2 (~> 2.4.0)
96
96
  parallel (1.18.0)
97
97
  parser (2.6.5.0)
@@ -132,14 +132,14 @@ GEM
132
132
  thor (>= 0.20.3, < 2.0)
133
133
  rainbow (3.0.0)
134
134
  rake (13.0.0)
135
- rubocop (0.72.0)
135
+ rubocop (0.75.1)
136
136
  jaro_winkler (~> 1.5.1)
137
137
  parallel (~> 1.10)
138
138
  parser (>= 2.6)
139
139
  rainbow (>= 2.2.2, < 4.0)
140
140
  ruby-progressbar (~> 1.7)
141
141
  unicode-display_width (>= 1.4.0, < 1.7)
142
- rubocop-performance (1.4.1)
142
+ rubocop-performance (1.5.0)
143
143
  rubocop (>= 0.71.0)
144
144
  ruby-progressbar (1.10.1)
145
145
  sprockets (4.0.0)
@@ -149,9 +149,9 @@ GEM
149
149
  actionpack (>= 4.0)
150
150
  activesupport (>= 4.0)
151
151
  sprockets (>= 3.0.0)
152
- standard (0.1.4)
153
- rubocop (~> 0.72.0)
154
- rubocop-performance (~> 1.4.0)
152
+ standard (0.1.5)
153
+ rubocop (~> 0.75.0)
154
+ rubocop-performance (~> 1.5.0)
155
155
  standardrb (1.0.0)
156
156
  standard
157
157
  thor (0.20.3)
@@ -162,7 +162,7 @@ GEM
162
162
  websocket-driver (0.7.1)
163
163
  websocket-extensions (>= 0.1.0)
164
164
  websocket-extensions (0.1.4)
165
- zeitwerk (2.2.0)
165
+ zeitwerk (2.2.1)
166
166
 
167
167
  PLATFORMS
168
168
  ruby
data/README.md CHANGED
@@ -1,14 +1,18 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/hopsoft/stimulus_reflex/master/assets/stimulus-reflex-logo.svg?sanitize=true" height="100" />
3
+ </p>
1
4
  <p align="center">
2
5
  <a href="https://codefund.io/properties/525/visit-sponsor">
3
6
  <img src="https://codefund.io/properties/525/sponsor" />
4
7
  </a>
5
8
  </p>
6
9
 
7
- [![Lines of Code](http://img.shields.io/badge/lines_of_code-516-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
10
+ [![Lines of Code](http://img.shields.io/badge/lines_of_code-593-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
8
11
  [![Maintainability](https://api.codeclimate.com/v1/badges/2b24fdbd1ae37a24bedb/maintainability)](https://codeclimate.com/github/hopsoft/stimulus_reflex/maintainability)
9
12
  ![Prettier-Standard](https://github.com/hopsoft/stimulus_reflex/workflows/Prettier-Standard/badge.svg)
10
13
  ![StandardRB](https://github.com/hopsoft/stimulus_reflex/workflows/StandardRB/badge.svg)
11
14
  ![Tests](https://github.com/hopsoft/stimulus_reflex/workflows/Tests/badge.svg)
15
+ [![Discourse](https://img.shields.io/badge/Forum-Discourse-blue.svg?style=flat)](https://stimulus-reflex.discourse.group)
12
16
 
13
17
  # StimulusReflex
14
18
 
@@ -21,7 +25,10 @@ _Inspired by [Phoenix LiveView](https://youtu.be/Z2DU0qLfPIY?t=670)._ 🙌
21
25
  ## Docs
22
26
 
23
27
  - [Official Documentation](https://docs.stimulusreflex.com)
24
- - [Documentation Source Code](https://github.com/hopsoft/stimulus_reflex/tree/master/docs)
28
+
29
+ ## Demos
30
+
31
+ - http://expo.stimulusreflex.com
25
32
 
26
33
  ## Contributing
27
34
 
@@ -31,10 +38,10 @@ Everyone interacting with StimulusReflex is expected to follow the [Code of Cond
31
38
 
32
39
  ### Coding Standards
33
40
 
34
- This project uses [Standard](https://github.com/testdouble/standard)
35
- and [Prettier-Standard](https://github.com/sheerun/prettier-standard) to minimize bike shedding related to code formatting.
41
+ This project uses [Standard](https://github.com/testdouble/standard) for Ruby code
42
+ and [Prettier-Standard](https://github.com/sheerun/prettier-standard) for JavaScript code to minimize bike shedding related to source formatting.
36
43
 
37
- Please run `./bin/standardize` prior submitting pull requests.
44
+ Please run `./bin/standardize` prior to submitting pull requests.
38
45
 
39
46
  View the [wiki](https://github.com/hopsoft/stimulus_reflex/wiki/Editor-Configuration) to see recommendations for configuring your editor to work best with the project.
40
47
 
data/README.md.orig ADDED
@@ -0,0 +1,62 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/hopsoft/stimulus_reflex/master/assets/stimulus-reflex-logo.svg?sanitize=true" height="100" />
3
+ </p>
4
+ <p align="center">
5
+ <a href="https://codefund.io/properties/525/visit-sponsor">
6
+ <img src="https://codefund.io/properties/525/sponsor" />
7
+ </a>
8
+ </p>
9
+
10
+ <<<<<<< HEAD
11
+ [![Lines of Code](http://img.shields.io/badge/lines_of_code-593-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
12
+ =======
13
+ [![Lines of Code](https://img.shields.io/badge/lines_of_code-516-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
14
+ >>>>>>> master
15
+ [![Maintainability](https://api.codeclimate.com/v1/badges/2b24fdbd1ae37a24bedb/maintainability)](https://codeclimate.com/github/hopsoft/stimulus_reflex/maintainability)
16
+ ![Prettier-Standard](https://github.com/hopsoft/stimulus_reflex/workflows/Prettier-Standard/badge.svg)
17
+ ![StandardRB](https://github.com/hopsoft/stimulus_reflex/workflows/StandardRB/badge.svg)
18
+ ![Tests](https://github.com/hopsoft/stimulus_reflex/workflows/Tests/badge.svg)
19
+ [![Discourse](https://img.shields.io/badge/Forum-Discourse-blue.svg?style=flat)](https://stimulus-reflex.discourse.group)
20
+
21
+ # StimulusReflex
22
+
23
+ _reflex_ - an action that is performed as a response to a stimulus
24
+
25
+ **Build reactive applications with the Rails tooling you already know and love.** StimulusReflex is designed to work perfectly with [server rendered HTML](https://guides.rubyonrails.org/action_view_overview.html), [Russian doll caching](https://edgeguides.rubyonrails.org/caching_with_rails.html#russian-doll-caching), [Stimulus](https://stimulusjs.org/), [Turbolinks](https://www.youtube.com/watch?v=SWEts0rlezA), etc... and strives to live up to the vision outlined in [The Rails Doctrine](https://rubyonrails.org/doctrine/).
26
+
27
+ _Inspired by [Phoenix LiveView](https://youtu.be/Z2DU0qLfPIY?t=670)._ 🙌
28
+
29
+ ## Docs
30
+
31
+ - [Official Documentation](https://docs.stimulusreflex.com)
32
+
33
+ ## Demos
34
+
35
+ - http://expo.stimulusreflex.com
36
+
37
+ ## Contributing
38
+
39
+ ### Code of Conduct
40
+
41
+ Everyone interacting with StimulusReflex is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md)
42
+
43
+ ### Coding Standards
44
+
45
+ This project uses [Standard](https://github.com/testdouble/standard) for Ruby code
46
+ and [Prettier-Standard](https://github.com/sheerun/prettier-standard) for JavaScript code to minimize bike shedding related to source formatting.
47
+
48
+ Please run `./bin/standardize` prior to submitting pull requests.
49
+
50
+ View the [wiki](https://github.com/hopsoft/stimulus_reflex/wiki/Editor-Configuration) to see recommendations for configuring your editor to work best with the project.
51
+
52
+ ### Releasing
53
+
54
+ 1. Bump version number at `lib/stimulus_reflex/version.rb`
55
+ 1. Run `rake build`
56
+ 1. Run `rake release`
57
+ 1. Change directories `cd ./javascript`
58
+ 1. Run `yarn publish` - NOTE: this will throw a fatal error because the tag already exists but the package will still publish
59
+
60
+ ## License
61
+
62
+ StimulusReflex is released under the [MIT License](LICENSE.txt).
@@ -6,7 +6,7 @@ class ApplicationReflex < StimulusReflex::Reflex
6
6
  # Example:
7
7
  #
8
8
  # # If your ActionCable connection is: `identified_by :current_user`
9
- # delegate :current_user, to: :channel
9
+ # delegate :current_user, to: :connection
10
10
  #
11
11
  # Learn more at: https://docs.stimulusreflex.com
12
12
  end
@@ -32,6 +32,6 @@ export default class extends ApplicationController {
32
32
 
33
33
  // updateError(element, reflex, error) {
34
34
  // console.error('updateError', error);
35
- // element.innerText = 'Updated Failed!'
35
+ // element.innerText = 'Update Failed!'
36
36
  // }
37
37
  }
@@ -106,7 +106,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
106
106
  selector: selector,
107
107
  html: document.css(selector).inner_html,
108
108
  children_only: true,
109
- permanent_attribute_name: "data-reflex-permanent",
109
+ permanent_attribute_name: data["permanent_attribute_name"],
110
110
  stimulus_reflex: data.merge(last: selector == selectors.last)
111
111
  )
112
112
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StimulusReflex
4
- VERSION = "2.1.4"
4
+ VERSION = "2.1.5"
5
5
  end
@@ -11,7 +11,11 @@ namespace :stimulus_reflex do
11
11
  FileUtils.mkdir_p Rails.root.join("app/javascript/controllers"), verbose: true
12
12
  FileUtils.mkdir_p Rails.root.join("app/reflexes"), verbose: true
13
13
 
14
- filepath = Rails.root.join("app/javascript/controllers/index.js")
14
+ filepath = if File.exist? Rails.root.join("app/javascript/controllers/index.js")
15
+ Rails.root.join("app/javascript/controllers/index.js")
16
+ else
17
+ Rails.root.join("app/javascript/packs/application.js")
18
+ end
15
19
  puts "Updating #{filepath}"
16
20
  lines = File.open(filepath, "r") { |f| f.readlines }
17
21
  import_line = lines.find { |line| line.start_with?("import StimulusReflex") }
@@ -0,0 +1,25 @@
1
+ require File.expand_path("../lib/stimulus_reflex/version", __FILE__)
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "stimulus_reflex"
5
+ gem.license = "MIT"
6
+ gem.version = StimulusReflex::VERSION
7
+ gem.authors = ["Nathan Hopkins"]
8
+ gem.email = ["natehop@gmail.com"]
9
+ gem.homepage = "https://github.com/hopsoft/stimulus_reflex"
10
+ gem.summary = "Build reactive applications with the Rails tooling you already know and love."
11
+
12
+ gem.files = Dir["lib/**/*", "bin/*", "[A-Z]*"]
13
+ gem.test_files = Dir["test/**/*.rb"]
14
+
15
+ gem.add_dependency "rack"
16
+ gem.add_dependency "nokogiri"
17
+ gem.add_dependency "rails", ">= 5.2"
18
+ gem.add_dependency "cable_ready", ">= 4.0"
19
+
20
+ gem.add_development_dependency "bundler", "~> 2.0"
21
+ gem.add_development_dependency "rake"
22
+ gem.add_development_dependency "pry"
23
+ gem.add_development_dependency "pry-nav"
24
+ gem.add_development_dependency "standardrb"
25
+ end
data/tags ADDED
@@ -0,0 +1,38 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
7
+ ApplicationReflex lib/generators/templates/application_reflex.rb /^class ApplicationReflex < StimulusReflex::Reflex$/;" c
8
+ ApplicationReflex test/tmp/app/reflexes/application_reflex.rb /^class ApplicationReflex < StimulusReflex::Reflex$/;" c
9
+ DemoReflex test/tmp/app/reflexes/demo_reflex.rb /^class DemoReflex < ApplicationReflex$/;" c
10
+ Engine lib/stimulus_reflex.rb /^ class Engine < Rails::Engine$/;" c class:StimulusReflex
11
+ StimulusReflex lib/stimulus_reflex.rb /^module StimulusReflex$/;" m
12
+ StimulusReflex lib/stimulus_reflex/channel.rb /^class StimulusReflex::Channel < ActionCable::Channel::Base$/;" c
13
+ StimulusReflex lib/stimulus_reflex/element.rb /^class StimulusReflex::Element$/;" c
14
+ StimulusReflex lib/stimulus_reflex/reflex.rb /^class StimulusReflex::Reflex$/;" c
15
+ StimulusReflex lib/stimulus_reflex/version.rb /^module StimulusReflex$/;" m
16
+ StimulusReflexGenerator lib/generators/stimulus_reflex_generator.rb /^class StimulusReflexGenerator < Rails::Generators::NamedBase$/;" c
17
+ StimulusReflexGeneratorTest test/generators/stimulus_reflex_generator_test.rb /^class StimulusReflexGeneratorTest < Rails::Generators::TestCase$/;" c
18
+ broadcast_error lib/stimulus_reflex/channel.rb /^ def broadcast_error(message, data = {})$/;" f class:StimulusReflex
19
+ broadcast_morphs lib/stimulus_reflex/channel.rb /^ def broadcast_morphs(selectors, data, html)$/;" f class:StimulusReflex
20
+ copy_controller_files lib/generators/stimulus_reflex_generator.rb /^ def copy_controller_files$/;" f class:StimulusReflexGenerator
21
+ copy_reflex_files lib/generators/stimulus_reflex_generator.rb /^ def copy_reflex_files$/;" f class:StimulusReflexGenerator
22
+ dataset lib/stimulus_reflex/element.rb /^ def dataset$/;" f class:StimulusReflex
23
+ delegate_call_to_reflex lib/stimulus_reflex/channel.rb /^ def delegate_call_to_reflex(reflex, method_name, arguments = [])$/;" f class:StimulusReflex
24
+ export.reflexAttribute javascript/schema.js /^ reflexAttribute: 'data-reflex',$/;" p
25
+ export.reflexPermanentAttribute javascript/schema.js /^ reflexPermanentAttribute: 'data-reflex-permanent',$/;" p
26
+ export.reflexRootAttribute javascript/schema.js /^ reflexRootAttribute: 'data-reflex-root',$/;" p
27
+ export.roomAttribute javascript/schema.js /^ roomAttribute: 'data-room'$/;" p
28
+ initialize lib/stimulus_reflex/element.rb /^ def initialize(attrs = {})$/;" f class:StimulusReflex
29
+ initialize lib/stimulus_reflex/reflex.rb /^ def initialize(channel, url: nil, element: nil, selectors: [])$/;" f class:StimulusReflex
30
+ initialize_controllers lib/generators/stimulus_reflex_generator.rb /^ def initialize_controllers$/;" f class:StimulusReflexGenerator
31
+ initialize_reflexes lib/generators/stimulus_reflex_generator.rb /^ def initialize_reflexes$/;" f class:StimulusReflexGenerator
32
+ is_reflex? lib/stimulus_reflex/channel.rb /^ def is_reflex?(reflex_class)$/;" f class:StimulusReflex
33
+ receive lib/stimulus_reflex/channel.rb /^ def receive(data)$/;" f class:StimulusReflex
34
+ render_page lib/stimulus_reflex/channel.rb /^ def render_page(url, reflex)$/;" f class:StimulusReflex
35
+ render_page_and_broadcast_morph lib/stimulus_reflex/channel.rb /^ def render_page_and_broadcast_morph(url, reflex, selectors, data = {})$/;" f class:StimulusReflex
36
+ request lib/stimulus_reflex/reflex.rb /^ def request$/;" f class:StimulusReflex
37
+ stream_name lib/stimulus_reflex/channel.rb /^ def stream_name$/;" f class:StimulusReflex
38
+ subscribed lib/stimulus_reflex/channel.rb /^ def subscribed$/;" f class:StimulusReflex
@@ -6,7 +6,7 @@ class ApplicationReflex < StimulusReflex::Reflex
6
6
  # Example:
7
7
  #
8
8
  # # If your ActionCable connection is: `identified_by :current_user`
9
- # delegate :current_user, to: :channel
9
+ # delegate :current_user, to: :connection
10
10
  #
11
11
  # Learn more at: https://docs.stimulusreflex.com
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-19 00:00:00.000000000 Z
11
+ date: 2019-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 4.0.7
61
+ version: '4.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 4.0.7
68
+ version: '4.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +148,7 @@ files:
148
148
  - Gemfile.lock
149
149
  - LICENSE.txt
150
150
  - README.md
151
+ - README.md.orig
151
152
  - Rakefile
152
153
  - bin/console
153
154
  - bin/loc
@@ -166,6 +167,8 @@ files:
166
167
  - lib/stimulus_reflex/reflex.rb
167
168
  - lib/stimulus_reflex/version.rb
168
169
  - lib/tasks/stimulus_reflex/install.rake
170
+ - stimulus_reflex.gemspec
171
+ - tags
169
172
  - test/generators/stimulus_reflex_generator_test.rb
170
173
  - test/test_helper.rb
171
174
  - test/tmp/app/reflexes/application_reflex.rb