gorails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +41 -12
- data/lib/gorails/commands/railsbytes.rb +44 -3
- data/lib/gorails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb227d76224d717af596ca69a9b7f670823bd20ae69e2225e21f4cccd4d349b
|
4
|
+
data.tar.gz: a836f4816f8c0d4b5db9e6dcb7c53005cd53f107f945d7efe611282f1e4a5137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0541289f21a733a8af0168d9360fe50e5bd3c7a5d3a68261e2b293b2ac10e60f600dd04d6cb8167babe3908275abae1d6821da37dbd242d95e43ce6eced8b62d'
|
7
|
+
data.tar.gz: 659d2cb41d4fca9c4ff76dc4e10f72429547cce50a256af8832f716fae3fcb8e4a6d5a6ac11ff04faa4eb16640ea30c70bebb41b65bba549ad8e525d2f8186d0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# GoRails CLI
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/gorails.svg)](https://badge.fury.io/rb/gorails)
|
4
4
|
|
5
|
-
|
5
|
+
An interactive CLI for [GoRails](https://gorails.com), [Railsbytes](https://railsbytes.com), [Jumpstart](https://github.com/excid3/jumpstart), [Ruby on Rails jobs](https://jobs.gorails.com), and more.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -12,27 +12,56 @@ Add this line to your application's Gemfile:
|
|
12
12
|
gem 'gorails'
|
13
13
|
```
|
14
14
|
|
15
|
-
And then
|
15
|
+
And then run
|
16
16
|
|
17
|
-
|
17
|
+
```bash
|
18
|
+
gorails
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
18
22
|
|
19
|
-
|
23
|
+
#### GoRails episodes
|
20
24
|
|
21
|
-
|
25
|
+
To see a list of the recent GoRails screencasts, you can run:
|
22
26
|
|
23
|
-
|
27
|
+
```sh
|
28
|
+
gorails episodes
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Ruby on Rails Jobs
|
32
|
+
|
33
|
+
To see a list of Ruby on Rails job posts, you can run:
|
34
|
+
|
35
|
+
```sh
|
36
|
+
gorails jobs
|
37
|
+
```
|
38
|
+
|
39
|
+
#### Railsbytes
|
40
|
+
|
41
|
+
To see a list of Railsbytes.com templates, you can run:
|
42
|
+
|
43
|
+
```sh
|
44
|
+
gorails railsbytes
|
45
|
+
gorails railsbytes x7msKX
|
46
|
+
```
|
47
|
+
|
48
|
+
#### Jumpstart
|
24
49
|
|
25
|
-
|
50
|
+
To create a Ruby on Rails app using the [Jumpstart template](https://github.com/excid3/jumpstart), you can run:
|
51
|
+
|
52
|
+
```sh
|
53
|
+
gorails jumpstart myapp
|
54
|
+
```
|
26
55
|
|
27
56
|
## Development
|
28
57
|
|
29
|
-
After checking out the repo, run `
|
58
|
+
After checking out the repo, run `bundle` to install dependencies. Then, run `rake test` to run the tests. You can also run `exe/gorails` to test the gem.
|
30
59
|
|
31
60
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
61
|
|
33
62
|
## Contributing
|
34
63
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/excid3/gorails-ruby. 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/excid3/gorails-ruby/blob/master/CODE_OF_CONDUCT.md).
|
36
65
|
|
37
66
|
## License
|
38
67
|
|
@@ -40,4 +69,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
69
|
|
41
70
|
## Code of Conduct
|
42
71
|
|
43
|
-
Everyone interacting in the
|
72
|
+
Everyone interacting in the GoRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/excid3/gorails-ruby/blob/master/CODE_OF_CONDUCT.md).
|
@@ -5,7 +5,24 @@ require "json"
|
|
5
5
|
module Gorails
|
6
6
|
module Commands
|
7
7
|
class Railsbytes < Gorails::Command
|
8
|
-
def call(
|
8
|
+
def call(args, _name)
|
9
|
+
if args.none?
|
10
|
+
list
|
11
|
+
else
|
12
|
+
apply(args.first)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.help
|
17
|
+
<<~EOF
|
18
|
+
View the latest Railsbytes templates or load a template by ID.
|
19
|
+
Usage:
|
20
|
+
{{command:#{Gorails::TOOL_NAME} railsbytes}}
|
21
|
+
{{command:#{Gorails::TOOL_NAME} railsbytes x7msKX}}
|
22
|
+
EOF
|
23
|
+
end
|
24
|
+
|
25
|
+
def list
|
9
26
|
bytes = JSON.parse Net::HTTP.get(URI("https://railsbytes.com/public/templates.json"))
|
10
27
|
|
11
28
|
CLI::UI::Frame.open("Railsbytes") do
|
@@ -18,8 +35,32 @@ module Gorails
|
|
18
35
|
end
|
19
36
|
end
|
20
37
|
|
21
|
-
def
|
22
|
-
|
38
|
+
def apply(id)
|
39
|
+
byte = JSON.parse Net::HTTP.get(URI("https://railsbytes.com/public/templates/#{id}.json"))
|
40
|
+
|
41
|
+
CLI::UI::Frame.open("Railsbyte") do
|
42
|
+
puts CLI::UI.fmt "{{green:#{byte["name"]}}} by #{byte["created_by"]}"
|
43
|
+
puts byte["short_description"]
|
44
|
+
puts
|
45
|
+
|
46
|
+
CLI::UI::Prompt.ask("What would you like to do?") do |handler|
|
47
|
+
handler.option("View source") do |selection|
|
48
|
+
puts
|
49
|
+
puts byte["script"]
|
50
|
+
end
|
51
|
+
|
52
|
+
handler.option("Apply Railsbyte") do |selection|
|
53
|
+
puts
|
54
|
+
puts "Running Railsbyte..."
|
55
|
+
|
56
|
+
Bundler.with_original_env do
|
57
|
+
system "rails app:template LOCATION=\"https://railsbytes.com/script/#{id}\""
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
handler.option("exit") { |selection| exit 0 }
|
62
|
+
end
|
63
|
+
end
|
23
64
|
end
|
24
65
|
end
|
25
66
|
end
|
data/lib/gorails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.3.
|
106
|
+
rubygems_version: 3.3.7
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: GoRails rubygem
|