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 +4 -4
- data/README.md +34 -1
- data/lib/clapton/version.rb +1 -1
- data/lib/clapton.rb +1 -0
- data/lib/rails/generators/clapton_generator.rb +23 -0
- metadata +8 -8
- 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: 0d6a54a06a936678c0f1340d20aef97b156df4ac6a7c792bbc20596bae616b04
|
4
|
+
data.tar.gz: 98f770d065fc6c48378d4e4782e9948e149cd3e73baf49c18512f98eba33437a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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).
|
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.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:
|