clapton 0.0.1 → 0.0.2

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: '00186fb4222527f33913e8cb95ceff617bff3da3de2ffcf8f460e2b6bfa0b650'
4
+ data.tar.gz: f6d46d7d1a833dea7fe9720b740fcf23f012a523193c16439b398bcb2f65b842
5
5
  SHA512:
6
- metadata.gz: 419b8d916d31b1b0460f960fb739a49b9f6e5ec5d5014f7089eaeb8cad9cc5ffd6cdffe255b83be07d141642ee167db00720d7537d31fffb7a614d41b46c2270
7
- data.tar.gz: 4ba17a68785e298a67681ade8d6ef368340e08eea877684e368360b714af30ae660bc997f1f885af5131149a153a666d18126c1838841055a01063c6aeda079b
6
+ metadata.gz: d05d1b054991b838e9ed03daea64f2c99e65dea75fea16eb0f5ada880f537ebfd5ce0198524d8bf19ef3bded8e037b1325943a0228d1e85b0ee628f69358f419
7
+ data.tar.gz: 2c941d1d8bbd0170503a3b19b0af35f08ee983673c45ff10c77d8198e795c89d53fbea43321d80a696c8e16806d274271c8e8c33932398268d68bca1bb59b42c
data/README.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Clapton
2
2
  Clapton is a Ruby on Rails gem for building web apps with pure Ruby only (no JavaScript and no HTML templates).
3
3
 
4
- # Installation
4
+ ## Stack
5
+
6
+ - Ruby on Rails
7
+ - Action Cable (WebSocket)
8
+ - [Ruby2JS](https://www.ruby2js.com/) (for compiling Ruby to JavaScript)
9
+
10
+ ## Installation
5
11
 
6
12
  Add this line to your application's Gemfile:
7
13
 
@@ -125,6 +131,17 @@ mount Clapton::Engine => "/clapton"
125
131
 
126
132
  ![TODO APP DEMO](./docs/todo-app-demo.gif)
127
133
 
134
+ ### Generate Component and State
135
+
136
+ ```bash
137
+ rails generate clapton TaskList
138
+ ```
139
+
140
+ After running the generator, you will see the following files:
141
+
142
+ - `app/components/task_list_component.rb`
143
+ - `app/states/task_list_state.rb`
144
+
128
145
  ### Preset Components
129
146
 
130
147
  ```ruby
@@ -277,6 +294,16 @@ end
277
294
 
278
295
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/dev` to start the development server.
279
296
 
297
+ ### Testing
298
+
299
+ Run `bundle exec rake test` to run the test suite.
300
+
301
+ Run `cd test/dummy && bundle exec rake test` to run the test suite for the dummy app.
302
+
303
+ Run `cd test/dummy && bundle exec rspec` to run the test suite for the dummy app with RSpec.
304
+
305
+ Run `cd lib/clapton/javascripts && npm run test` to run the test suite for the JavaScript part.
306
+
280
307
  ## Contributing
281
308
 
282
309
  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.2'
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami
@@ -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: