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 +4 -4
- data/README.md +28 -1
- data/lib/clapton/version.rb +1 -1
- data/lib/clapton.rb +1 -0
- data/lib/rails/generators/clapton_generator.rb +23 -0
- metadata +2 -2
- data/lib/clapton/javascripts/dist/index.js +0 -1592
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00186fb4222527f33913e8cb95ceff617bff3da3de2ffcf8f460e2b6bfa0b650'
|
4
|
+
data.tar.gz: f6d46d7d1a833dea7fe9720b740fcf23f012a523193c16439b398bcb2f65b842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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).
|
data/lib/clapton/version.rb
CHANGED
data/lib/clapton.rb
CHANGED
@@ -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.
|
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:
|