clapton 0.0.1 → 0.0.3

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: 412ab8109c5fd546ff0bc9a48546fc0bec121e7d8f8239aebd40f970d552e275
4
- data.tar.gz: f041c1a17ad5651a1d90404086f0f225492f1cfe2a7f3557fb0f5862fe835d99
3
+ metadata.gz: 0d6a54a06a936678c0f1340d20aef97b156df4ac6a7c792bbc20596bae616b04
4
+ data.tar.gz: 98f770d065fc6c48378d4e4782e9948e149cd3e73baf49c18512f98eba33437a
5
5
  SHA512:
6
- metadata.gz: 419b8d916d31b1b0460f960fb739a49b9f6e5ec5d5014f7089eaeb8cad9cc5ffd6cdffe255b83be07d141642ee167db00720d7537d31fffb7a614d41b46c2270
7
- data.tar.gz: 4ba17a68785e298a67681ade8d6ef368340e08eea877684e368360b714af30ae660bc997f1f885af5131149a153a666d18126c1838841055a01063c6aeda079b
6
+ metadata.gz: eddbed0288f29a2864aa48329ba953639051c6b83405587af04c7b9b138b2af9b54d08d5b3ad84d54fd4f5d8a9ef9a03b9a17546438a1dc876160e7bf2f660d5
7
+ data.tar.gz: f84aafef47bc5554403c2183a0a8d763341055d545490e2eba862889a6477fdb30f1b95ad7e9012abef91f399c64e6b2fb10754a42af985423a203347ea85e8e
data/README.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # Clapton
2
+
3
+ ![version](https://badgen.net/rubygems/v/clapton)
4
+ ![downloads](https://badgen.net/rubygems/dt/clapton)
5
+ ![license](https://badgen.net/github/license/kawakamimoeki/clapton)
6
+
2
7
  Clapton is a Ruby on Rails gem for building web apps with pure Ruby only (no JavaScript and no HTML templates).
3
8
 
4
- # Installation
9
+ ## Stack
10
+
11
+ - Ruby on Rails
12
+ - Action Cable (WebSocket)
13
+ - [Ruby2JS](https://www.ruby2js.com/) (for compiling Ruby to JavaScript)
14
+ - [Morphdom](https://github.com/patrick-steele-idem/morphdom)
15
+
16
+ ## Installation
5
17
 
6
18
  Add this line to your application's Gemfile:
7
19
 
@@ -125,6 +137,17 @@ mount Clapton::Engine => "/clapton"
125
137
 
126
138
  ![TODO APP DEMO](./docs/todo-app-demo.gif)
127
139
 
140
+ ### Generate Component and State
141
+
142
+ ```bash
143
+ rails generate clapton TaskList
144
+ ```
145
+
146
+ After running the generator, you will see the following files:
147
+
148
+ - `app/components/task_list_component.rb`
149
+ - `app/states/task_list_state.rb`
150
+
128
151
  ### Preset Components
129
152
 
130
153
  ```ruby
@@ -277,6 +300,16 @@ end
277
300
 
278
301
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/dev` to start the development server.
279
302
 
303
+ ### Testing
304
+
305
+ Run `bundle exec rake test` to run the test suite.
306
+
307
+ Run `cd test/dummy && bundle exec rake test` to run the test suite for the dummy app.
308
+
309
+ Run `cd test/dummy && bundle exec rspec` to run the test suite for the dummy app with RSpec.
310
+
311
+ Run `cd lib/clapton/javascripts && npm run test` to run the test suite for the JavaScript part.
312
+
280
313
  ## Contributing
281
314
 
282
315
  Bug reports and pull requests are welcome on GitHub at https://github.com/kawakamimoeki/clapton. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/kawakamimoeki/clapton/blob/main/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module Clapton
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/clapton.rb CHANGED
@@ -5,6 +5,7 @@ require "clapton/engine"
5
5
  require "clapton/state"
6
6
  require "clapton/test_helper/rspec"
7
7
  require "clapton/test_helper/minitest"
8
+ require "rails/generators/clapton_generator"
8
9
 
9
10
  module Clapton
10
11
  end
@@ -0,0 +1,23 @@
1
+ require "rails/generators"
2
+
3
+ module Rails
4
+ module Generators
5
+ class ClaptonGenerator < Rails::Generators::NamedBase
6
+ def create_component_file
7
+ create_file "app/components/#{file_name}_component.rb" do
8
+ <<~RUBY
9
+ class #{class_name}Component < Clapton::Component
10
+ end
11
+ RUBY
12
+ end
13
+
14
+ create_file "app/states/#{file_name}_state.rb" do
15
+ <<~RUBY
16
+ class #{class_name}State < Clapton::State
17
+ end
18
+ RUBY
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clapton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami
@@ -14,22 +14,22 @@ dependencies:
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 6.1.7
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 6.1.7.8
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: 6.1.7
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 6.1.7.8
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ruby2js
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -104,7 +104,6 @@ files:
104
104
  - lib/clapton/engine.rb
105
105
  - lib/clapton/javascripts/dist/client.js
106
106
  - lib/clapton/javascripts/dist/components.js
107
- - lib/clapton/javascripts/dist/index.js
108
107
  - lib/clapton/javascripts/node_modules/@adobe/css-tools/LICENSE
109
108
  - lib/clapton/javascripts/node_modules/@adobe/css-tools/Readme.md
110
109
  - lib/clapton/javascripts/node_modules/@adobe/css-tools/dist/index.cjs
@@ -6696,6 +6695,7 @@ files:
6696
6695
  - lib/clapton/test_helper/minitest.rb
6697
6696
  - lib/clapton/test_helper/rspec.rb
6698
6697
  - lib/clapton/version.rb
6698
+ - lib/rails/generators/clapton_generator.rb
6699
6699
  - lib/tasks/clapton_tasks.rake
6700
6700
  homepage: https://github.com/kawakamimoeki/clapton
6701
6701
  licenses: